vmsdbg.h, [...]: Add documentation and minor cleanups.
[platform/upstream/gcc.git] / gcc / doc / invoke.texi
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2 @c 2000, 2001 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 COPYRIGHT
8 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
9 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
10
11 Permission is granted to copy, distribute and/or modify this document
12 under the terms of the GNU Free Documentation License, Version 1.1 or
13 any later version published by the Free Software Foundation; with the
14 Invariant Sections being ``GNU General Public License'' and ``Funding
15 Free Software'', the Front-Cover texts being (a) (see below), and with
16 the Back-Cover Texts being (b) (see below).  A copy of the license is
17 included in the gfdl(7) man page.
18
19 (a) The FSF's Front-Cover Text is:
20
21      A GNU Manual
22
23 (b) The FSF's Back-Cover Text is:
24
25      You have freedom to copy and modify this GNU Manual, like GNU
26      software.  Copies published by the Free Software Foundation raise
27      funds for GNU development.
28 @c man end
29 @c Set file name and title for the man page.
30 @setfilename gcc
31 @settitle GNU project C and C++ compiler
32 @c man begin SYNOPSIS
33 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
34     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
35     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
36     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
37     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
38     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
39     [@option{-o} @var{outfile}] @var{infile}@dots{}
40
41 Only the most useful options are listed here; see below for the
42 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
43 @c man end
44 @c man begin SEEALSO
45 gpl(7), gfdl(7), fsf-funding(7),
46 cpp(1), gcov(1), g77(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
47 and the Info entries for @file{gcc}, @file{cpp}, @file{g77}, @file{as},
48 @file{ld}, @file{binutils} and @file{gdb}.
49 @c man end
50 @c man begin BUGS
51 For instructions on reporting bugs, see
52 @w{@uref{http://gcc.gnu.org/bugs.html}}.  Use of the @command{gccbug}
53 script to report bugs is recommended.
54 @c man end
55 @c man begin AUTHOR
56 See the Info entry for @file{gcc}, or
57 @w{@uref{http://gcc.gnu.org/thanks.html}}, for contributors to GCC@.
58 @c man end
59 @end ignore
60
61 @node Invoking GCC
62 @chapter GCC Command Options
63 @cindex GCC command options
64 @cindex command options
65 @cindex options, GCC command
66
67 @c man begin DESCRIPTION
68
69 When you invoke GCC, it normally does preprocessing, compilation,
70 assembly and linking.  The ``overall options'' allow you to stop this
71 process at an intermediate stage.  For example, the @option{-c} option
72 says not to run the linker.  Then the output consists of object files
73 output by the assembler.
74
75 Other options are passed on to one stage of processing.  Some options
76 control the preprocessor and others the compiler itself.  Yet other
77 options control the assembler and linker; most of these are not
78 documented here, since you rarely need to use any of them.
79
80 @cindex C compilation options
81 Most of the command line options that you can use with GCC are useful
82 for C programs; when an option is only useful with another language
83 (usually C++), the explanation says so explicitly.  If the description
84 for a particular option does not mention a source language, you can use
85 that option with all supported languages.
86
87 @cindex C++ compilation options
88 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
89 options for compiling C++ programs.
90
91 @cindex grouping options
92 @cindex options, grouping
93 The @command{gcc} program accepts options and file names as operands.  Many
94 options have multi-letter names; therefore multiple single-letter options
95 may @emph{not} be grouped: @option{-dr} is very different from @w{@samp{-d
96 -r}}.
97
98 @cindex order of options
99 @cindex options, order
100 You can mix options and other arguments.  For the most part, the order
101 you use doesn't matter.  Order does matter when you use several options
102 of the same kind; for example, if you specify @option{-L} more than once,
103 the directories are searched in the order specified.
104
105 Many options have long names starting with @samp{-f} or with
106 @samp{-W}---for example, @option{-fforce-mem},
107 @option{-fstrength-reduce}, @option{-Wformat} and so on.  Most of
108 these have both positive and negative forms; the negative form of
109 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
110 only one of these two forms, whichever one is not the default.
111
112 @c man end
113
114 @xref{Option Index}, for an index to GCC's options.
115
116 @menu
117 * Option Summary::      Brief list of all options, without explanations.
118 * Overall Options::     Controlling the kind of output:
119                         an executable, object files, assembler files,
120                         or preprocessed source.
121 * Invoking G++::        Compiling C++ programs.
122 * C Dialect Options::   Controlling the variant of C language compiled.
123 * C++ Dialect Options:: Variations on C++.
124 * Objective-C Dialect Options:: Variations on Objective-C.
125 * Language Independent Options:: Controlling how diagnostics should be
126                         formatted.
127 * Warning Options::     How picky should the compiler be?
128 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
129 * Optimize Options::    How much optimization?
130 * Preprocessor Options:: Controlling header files and macro definitions.
131                          Also, getting dependency information for Make.
132 * Assembler Options::   Passing options to the assembler.
133 * Link Options::        Specifying libraries and so on.
134 * Directory Options::   Where to find header files and libraries.
135                         Where to find the compiler executable files.
136 * Spec Files::          How to pass switches to sub-processes.
137 * Target Options::      Running a cross-compiler, or an old version of GCC.
138 * Submodel Options::    Specifying minor hardware or convention variations,
139                         such as 68010 vs 68020.
140 * Code Gen Options::    Specifying conventions for function calls, data layout
141                         and register usage.
142 * Environment Variables:: Env vars that affect GCC.
143 * Running Protoize::    Automatically adding or removing function prototypes.
144 @end menu
145
146 @c man begin OPTIONS
147
148 @node Option Summary
149 @section Option Summary
150
151 Here is a summary of all the options, grouped by type.  Explanations are
152 in the following sections.
153
154 @table @emph
155 @item Overall Options
156 @xref{Overall Options,,Options Controlling the Kind of Output}.
157 @gccoptlist{
158 -c  -S  -E  -o @var{file}  -pipe  -pass-exit-codes  -x @var{language} @gol
159 -v  --target-help  --help}
160
161 @item C Language Options
162 @xref{C Dialect Options,,Options Controlling C Dialect}.
163 @gccoptlist{
164 -ansi  -std=@var{standard}  -aux-info @var{filename} @gol
165 -fno-asm  -fno-builtin -fno-builtin-@var{function} @gol
166 -fhosted  -ffreestanding @gol
167 -trigraphs  -traditional  -traditional-cpp @gol
168 -fallow-single-precision  -fcond-mismatch @gol
169 -fsigned-bitfields  -fsigned-char @gol
170 -funsigned-bitfields  -funsigned-char @gol
171 -fwritable-strings  -fshort-wchar}
172
173 @item C++ Language Options
174 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
175 @gccoptlist{
176 -fno-access-control  -fcheck-new  -fconserve-space @gol
177 -fno-const-strings  -fdollars-in-identifiers @gol
178 -fno-elide-constructors @gol
179 -fno-enforce-eh-specs  -fexternal-templates @gol
180 -falt-external-templates @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 -fuse-cxa-atexit  -fvtable-gc  -fno-weak  -nostdinc++ @gol
189 -fno-default-inline  -Wctor-dtor-privacy @gol
190 -Wnon-virtual-dtor  -Wreorder @gol
191 -Weffc++  -Wno-deprecated @gol
192 -Wno-non-template-friend  -Wold-style-cast @gol
193 -Woverloaded-virtual  -Wno-pmf-conversions @gol
194 -Wsign-promo  -Wsynth}
195
196 @item Objective-C Language Options
197 @xref{Objective-C Dialect Options,,Options Controlling Objective-C Dialect}.
198 @gccoptlist{
199 -fconstant-string-class=@var{class-name} @gol
200 -fgnu-runtime  -fnext-runtime  -gen-decls @gol
201 -Wno-protocol  -Wselector}
202
203 @item Language Independent Options
204 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
205 @gccoptlist{
206 -fmessage-length=@var{n}  @gol
207 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}}
208
209 @item Warning Options
210 @xref{Warning Options,,Options to Request or Suppress Warnings}.
211 @gccoptlist{
212 -fsyntax-only  -pedantic  -pedantic-errors @gol
213 -w  -W  -Wall  -Waggregate-return @gol
214 -Wcast-align  -Wcast-qual  -Wchar-subscripts  -Wcomment @gol
215 -Wconversion  -Wdisabled-optimization  -Wdiv-by-zero  -Werror @gol
216 -Wfloat-equal  -Wformat  -Wformat=2 @gol
217 -Wformat-nonliteral  -Wformat-security @gol
218 -Wimplicit  -Wimplicit-int  @gol
219 -Wimplicit-function-declaration @gol
220 -Werror-implicit-function-declaration @gol
221 -Wimport  -Winline @gol
222 -Wlarger-than-@var{len}  -Wlong-long @gol
223 -Wmain  -Wmissing-braces  -Wmissing-declarations @gol
224 -Wmissing-format-attribute  -Wmissing-noreturn @gol
225 -Wmultichar  -Wno-format-extra-args  -Wno-format-y2k @gol
226 -Wno-import  -Wpacked  -Wpadded @gol
227 -Wparentheses  -Wpointer-arith  -Wredundant-decls @gol
228 -Wreturn-type  -Wsequence-point  -Wshadow @gol
229 -Wsign-compare  -Wswitch  -Wsystem-headers @gol
230 -Wtrigraphs  -Wundef  -Wuninitialized @gol
231 -Wunknown-pragmas  -Wunreachable-code @gol
232 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
233 -Wunused-value  -Wunused-variable  -Wwrite-strings}
234
235 @item C-only Warning Options
236 @gccoptlist{
237 -Wbad-function-cast  -Wmissing-prototypes  -Wnested-externs @gol
238 -Wstrict-prototypes  -Wtraditional}
239
240 @item Debugging Options
241 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
242 @gccoptlist{
243 -a  -ax  -d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
244 -fdump-unnumbered 
245 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
246 -fdump-tree-original@r{[}-@var{n}@r{]} -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
247 -fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
248 -fmem-report  -fpretend-float @gol
249 -fprofile-arcs  -ftest-coverage  -ftime-report @gol
250 -g  -g@var{level}  -gcoff  -gdwarf  -gdwarf-1  -gdwarf-1+  -gdwarf-2 @gol
251 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
252 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
253 -print-multi-directory  -print-multi-lib @gol
254 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
255 -save-temps  -time}
256
257 @item Optimization Options
258 @xref{Optimize Options,,Options that Control Optimization}.
259 @gccoptlist{
260 -falign-functions=@var{n}  -falign-jumps=@var{n} @gol
261 -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
262 -fbranch-probabilities  -fcaller-saves @gol
263 -fcse-follow-jumps  -fcse-skip-blocks  -fdata-sections @gol
264 -fdelayed-branch  -fdelete-null-pointer-checks @gol
265 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
266 -fforce-addr  -fforce-mem  -ffunction-sections @gol
267 -fgcse  -fgcse-lm  -fgcse-sm @gol
268 -finline-functions  -finline-limit=@var{n}  -fkeep-inline-functions @gol
269 -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants @gol
270 -fmove-all-movables  -fno-default-inline  -fno-defer-pop @gol
271 -fno-function-cse  -fno-guess-branch-probability @gol
272 -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 @gol
273 -funsafe-math-optimizations -fno-trapping-math @gol
274 -fomit-frame-pointer  -foptimize-register-move @gol
275 -foptimize-sibling-calls  -freduce-all-givs @gol
276 -fregmove  -frename-registers @gol
277 -frerun-cse-after-loop  -frerun-loop-opt @gol
278 -fschedule-insns  -fschedule-insns2 @gol
279 -fsingle-precision-constant  -fssa -fssa-ccp -fssa-dce @gol
280 -fstrength-reduce  -fstrict-aliasing  -fthread-jumps  -ftrapv @gol
281 -funroll-all-loops  -funroll-loops  @gol
282 --param @var{name}=@var{value}
283 -O  -O0  -O1  -O2  -O3  -Os}
284
285 @item Preprocessor Options
286 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
287 @gccoptlist{
288 -$  -A@var{question}=@var{answer}  -A-@var{question}@r{[}=@var{answer}@r{]} @gol
289 -C  -dD  -dI  -dM  -dN @gol
290 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
291 -idirafter @var{dir} @gol
292 -include @var{file}  -imacros @var{file} @gol
293 -iprefix @var{file}  -iwithprefix @var{dir} @gol
294 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
295 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  -P  -remap @gol
296 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option}}
297
298 @item Assembler Option
299 @xref{Assembler Options,,Passing Options to the Assembler}.
300 @gccoptlist{
301 -Wa,@var{option}}
302
303 @item Linker Options
304 @xref{Link Options,,Options for Linking}.
305 @gccoptlist{
306 @var{object-file-name}  -l@var{library} @gol
307 -nostartfiles  -nodefaultlibs  -nostdlib @gol
308 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
309 -Wl,@var{option}  -Xlinker @var{option} @gol
310 -u @var{symbol}}
311
312 @item Directory Options
313 @xref{Directory Options,,Options for Directory Search}.
314 @gccoptlist{
315 -B@var{prefix}  -I@var{dir}  -I-  -L@var{dir}  -specs=@var{file}}
316
317 @item Target Options
318 @c I wrote this xref this way to avoid overfull hbox. -- rms
319 @xref{Target Options}.
320 @gccoptlist{
321 -b @var{machine}  -V @var{version}}
322
323 @item Machine Dependent Options
324 @xref{Submodel Options,,Hardware Models and Configurations}.
325 @emph{M680x0 Options}
326 @gccoptlist{
327 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
328 -m68060  -mcpu32  -m5200  -m68881  -mbitfield  -mc68000  -mc68020   @gol
329 -mfpa  -mnobitfield  -mrtd  -mshort  -msoft-float  -mpcrel @gol
330 -malign-int  -mstrict-align}
331
332 @emph{M68hc1x Options}
333 @gccoptlist{
334 -m6811  -m6812  -m68hc11  -m68hc12 @gol
335 -mauto-incdec  -mshort  -msoft-reg-count=@var{count}}
336
337 @emph{VAX Options}
338 @gccoptlist{
339 -mg  -mgnu  -munix}
340
341 @emph{SPARC Options}
342 @gccoptlist{
343 -mcpu=@var{cpu-type} @gol
344 -mtune=@var{cpu-type} @gol
345 -mcmodel=@var{code-model} @gol
346 -m32  -m64 @gol
347 -mapp-regs  -mbroken-saverestore  -mcypress @gol
348 -mepilogue  -mfaster-structs  -mflat @gol
349 -mfpu  -mhard-float  -mhard-quad-float @gol
350 -mimpure-text  -mlive-g0  -mno-app-regs @gol
351 -mno-epilogue  -mno-faster-structs  -mno-flat  -mno-fpu @gol
352 -mno-impure-text  -mno-stack-bias  -mno-unaligned-doubles @gol
353 -msoft-float  -msoft-quad-float  -msparclite  -mstack-bias @gol
354 -msupersparc  -munaligned-doubles  -mv8}
355
356 @emph{Convex Options}
357 @gccoptlist{
358 -mc1  -mc2  -mc32  -mc34  -mc38 @gol
359 -margcount  -mnoargcount @gol
360 -mlong32  -mlong64 @gol
361 -mvolatile-cache  -mvolatile-nocache}
362
363 @emph{AMD29K Options}
364 @gccoptlist{
365 -m29000  -m29050  -mbw  -mnbw  -mdw  -mndw @gol
366 -mlarge  -mnormal  -msmall @gol
367 -mkernel-registers  -mno-reuse-arg-regs @gol
368 -mno-stack-check  -mno-storem-bug @gol
369 -mreuse-arg-regs  -msoft-float  -mstack-check @gol
370 -mstorem-bug  -muser-registers}
371
372 @emph{ARM Options}
373 @gccoptlist{
374 -mapcs-frame  -mno-apcs-frame @gol
375 -mapcs-26  -mapcs-32 @gol
376 -mapcs-stack-check  -mno-apcs-stack-check @gol
377 -mapcs-float  -mno-apcs-float @gol
378 -mapcs-reentrant  -mno-apcs-reentrant @gol
379 -msched-prolog  -mno-sched-prolog @gol
380 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
381 -malignment-traps  -mno-alignment-traps @gol
382 -msoft-float  -mhard-float  -mfpe @gol
383 -mthumb-interwork  -mno-thumb-interwork @gol
384 -mcpu=@var{name}  -march=@var{name}  -mfpe=@var{name}  @gol
385 -mstructure-size-boundary=@var{n} @gol
386 -mbsd -mxopen  -mno-symrename @gol
387 -mabort-on-noreturn @gol
388 -mlong-calls  -mno-long-calls @gol
389 -msingle-pic-base  -mno-single-pic-base @gol
390 -mpic-register=@var{reg} @gol
391 -mnop-fun-dllimport @gol
392 -mpoke-function-name @gol
393 -mthumb  -marm @gol
394 -mtpcs-frame  -mtpcs-leaf-frame @gol
395 -mcaller-super-interworking  -mcallee-super-interworking }
396
397 @emph{MN10200 Options}
398 @gccoptlist{
399 -mrelax}
400
401 @emph{MN10300 Options}
402 @gccoptlist{
403 -mmult-bug  -mno-mult-bug @gol
404 -mam33  -mno-am33 @gol
405 -mno-crt0  -mrelax}
406
407 @emph{M32R/D Options}
408 @gccoptlist{
409 -m32rx -m32r -mcode-model=@var{model-type}  -msdata=@var{sdata-type} @gol
410 -G @var{num}}
411
412 @emph{M88K Options}
413 @gccoptlist{
414 -m88000  -m88100  -m88110  -mbig-pic @gol
415 -mcheck-zero-division  -mhandle-large-shift @gol
416 -midentify-revision  -mno-check-zero-division @gol
417 -mno-ocs-debug-info  -mno-ocs-frame-position @gol
418 -mno-optimize-arg-area  -mno-serialize-volatile @gol
419 -mno-underscores  -mocs-debug-info @gol
420 -mocs-frame-position  -moptimize-arg-area @gol
421 -mserialize-volatile  -mshort-data-@var{num}  -msvr3 @gol
422 -msvr4  -mtrap-large-shift  -muse-div-instruction @gol
423 -mversion-03.00  -mwarn-passed-structs}
424
425 @emph{RS/6000 and PowerPC Options}
426 @gccoptlist{
427 -mcpu=@var{cpu-type} @gol
428 -mtune=@var{cpu-type} @gol
429 -mpower  -mno-power  -mpower2  -mno-power2 @gol
430 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
431 -maltivec -mno-altivec @gol
432 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
433 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
434 -mnew-mnemonics  -mold-mnemonics @gol
435 -mfull-toc   -mminimal-toc  -mno-fop-in-toc  -mno-sum-in-toc @gol
436 -m64  -m32  -mxl-call  -mno-xl-call  -mthreads  -mpe @gol
437 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
438 -mstring  -mno-string  -mupdate  -mno-update @gol
439 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
440 -mstrict-align  -mno-strict-align  -mrelocatable @gol
441 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
442 -mtoc  -mno-toc -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
443 -mcall-aix -mcall-sysv -mcall-netbsd @gol
444 -maix-struct-return -msvr4-struct-return
445 -mabi=altivec @gol
446 -mprototype  -mno-prototype @gol
447 -msim  -mmvme  -mads  -myellowknife  -memb -msdata @gol
448 -msdata=@var{opt}  -mvxworks -G @var{num}}
449
450 @emph{RT Options}
451 @gccoptlist{
452 -mcall-lib-mul  -mfp-arg-in-fpregs  -mfp-arg-in-gregs @gol
453 -mfull-fp-blocks  -mhc-struct-return  -min-line-mul @gol
454 -mminimum-fp-blocks  -mnohc-struct-return}
455
456 @emph{MIPS Options}
457 @gccoptlist{
458 -mabicalls -march=@var{cpu-type} -mtune=@var{cpu=type} @gol
459 -mcpu=@var{cpu-type} -membedded-data  -muninit-const-in-rodata @gol
460 -membedded-pic  -mfp32  -mfp64  -mfused-madd  -mno-fused-madd @gol
461 -mgas  -mgp32  -mgp64 @gol
462 -mgpopt  -mhalf-pic  -mhard-float  -mint64  -mips1 @gol
463 -mips2  -mips3  -mips4  -mlong64  -mlong32  -mlong-calls  -mmemcpy @gol
464 -mmips-as  -mmips-tfile  -mno-abicalls @gol
465 -mno-embedded-data  -mno-uninit-const-in-rodata @gol
466 -mno-embedded-pic  -mno-gpopt  -mno-long-calls @gol
467 -mno-memcpy  -mno-mips-tfile  -mno-rnames  -mno-stats @gol
468 -mrnames  -msoft-float @gol
469 -m4650  -msingle-float  -mmad @gol
470 -mstats  -EL  -EB  -G @var{num}  -nocpp @gol
471 -mabi=32  -mabi=n32  -mabi=64  -mabi=eabi @gol
472 -mfix7000  -mno-crt0 -mflush-func=@var{func} -mno-flush-func}
473
474 @emph{i386 and x86-64 Options}
475 @gccoptlist{
476 -mcpu=@var{cpu-type}  -march=@var{cpu-type} @gol
477 -mintel-syntax -mieee-fp  -mno-fancy-math-387 @gol
478 -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib @gol
479 -mno-wide-multiply  -mrtd  -malign-double @gol
480 -mpreferred-stack-boundary=@var{num} @gol
481 -mmmx  -msse  -m3dnow @gol
482 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
483 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
484 -m96bit-long-double  -mregparm=@var{num}  -momit-leaf-frame-pointer @gol
485 -mno-red-zone@gol
486 -m32 -m64}
487
488 @emph{HPPA Options}
489 @gccoptlist{
490 -march=@var{architecture-type} @gol
491 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
492 -mfast-indirect-calls  -mgas  -mjump-in-delay @gol
493 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
494 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
495 -mno-jump-in-delay  -mno-long-load-store @gol
496 -mno-portable-runtime  -mno-soft-float @gol
497 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
498 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
499 -mschedule=@var{cpu-type}  -mspace-regs}
500
501 @emph{Intel 960 Options}
502 @gccoptlist{
503 -m@var{cpu-type}  -masm-compat  -mclean-linkage @gol
504 -mcode-align  -mcomplex-addr  -mleaf-procedures @gol
505 -mic-compat  -mic2.0-compat  -mic3.0-compat @gol
506 -mintel-asm  -mno-clean-linkage  -mno-code-align @gol
507 -mno-complex-addr  -mno-leaf-procedures @gol
508 -mno-old-align  -mno-strict-align  -mno-tail-call @gol
509 -mnumerics  -mold-align  -msoft-float  -mstrict-align @gol
510 -mtail-call}
511
512 @emph{DEC Alpha Options}
513 @gccoptlist{
514 -mfp-regs  -mno-fp-regs  -mno-soft-float  -msoft-float @gol
515 -malpha-as  -mgas @gol
516 -mieee  -mieee-with-inexact  -mieee-conformant @gol
517 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
518 -mtrap-precision=@var{mode}  -mbuild-constants @gol
519 -mcpu=@var{cpu-type} @gol
520 -mbwx  -mno-bwx  -mcix  -mno-cix  -mmax  -mno-max @gol
521 -mmemory-latency=@var{time}}
522
523 @emph{Clipper Options}
524 @gccoptlist{
525 -mc300  -mc400}
526
527 @emph{H8/300 Options}
528 @gccoptlist{
529 -mrelax  -mh  -ms  -mint32  -malign-300}
530
531 @emph{SH Options}
532 @gccoptlist{
533 -m1  -m2  -m3  -m3e @gol
534 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
535 -mb  -ml  -mdalign  -mrelax @gol
536 -mbigtable  -mfmovd  -mhitachi  -mnomacsave @gol
537 -mieee  -misize  -mpadstruct  -mspace @gol
538 -mprefergot  -musermode}
539
540 @emph{System V Options}
541 @gccoptlist{
542 -Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
543
544 @emph{ARC Options}
545 @gccoptlist{
546 -EB  -EL @gol
547 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
548 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
549
550 @emph{TMS320C3x/C4x Options}
551 @gccoptlist{
552 -mcpu=@var{cpu}  -mbig  -msmall  -mregparm  -mmemparm @gol
553 -mfast-fix  -mmpyi  -mbk  -mti  -mdp-isr-reload @gol
554 -mrpts=@var{count}  -mrptb  -mdb  -mloop-unsigned @gol
555 -mparallel-insns  -mparallel-mpy  -mpreserve-float}
556
557 @emph{V850 Options}
558 @gccoptlist{
559 -mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
560 -mprolog-function  -mno-prolog-function  -mspace @gol
561 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
562 -mv850  -mbig-switch}
563
564 @emph{NS32K Options}
565 @gccoptlist{
566 -m32032  -m32332  -m32532  -m32081  -m32381 @gol
567 -mmult-add  -mnomult-add  -msoft-float  -mrtd  -mnortd @gol
568 -mregparam  -mnoregparam  -msb  -mnosb @gol
569 -mbitfield  -mnobitfield  -mhimem  -mnohimem}
570
571 @emph{AVR Options}
572 @gccoptlist{
573 -mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
574 -mcall-prologues  -mno-tablejump  -mtiny-stack}
575
576 @emph{MCore Options}
577 @gccoptlist{
578 -mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
579 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
580 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
581 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
582 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
583
584 @emph{MMIX Options}
585 @gccoptlist{
586 -mlibfuncs -mno-libfuncs -mepsilon -mno-epsilon -mabi=gnu @gol
587 -mabi=mmixware -mzero-extend -mknuthdiv -mtoplevel-symbols @gol
588 -melf}
589
590 @emph{IA-64 Options}
591 @gccoptlist{
592 -mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
593 -mvolatile-asm-stop  -mb-step  -mregister-names  -mno-sdata @gol
594 -mconstant-gp  -mauto-pic  -minline-divide-min-latency @gol
595 -minline-divide-max-throughput  -mno-dwarf2-asm @gol
596 -mfixed-range=@var{register-range}}
597
598 @emph{S/390 and zSeries Options}
599 @gccoptlist{
600 -mhard-float  -msoft-float  -mbackchain  -mno-backchain @gol
601 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
602 -m64 -m31 -mdebug -mno-debug}
603
604 @emph{CRIS Options}
605 @gccoptlist{
606 -mcpu=@var{cpu} -march=@var{cpu} -mtune=@var{cpu} @gol
607 -mmax-stack-frame=@var{n} -melinux-stacksize=@var{n} @gol
608 -metrax4 -metrax100 -mpdebug -mcc-init -mno-side-effects @gol
609 -mstack-align -mdata-align -mconst-align @gol
610 -m32-bit -m16-bit -m8-bit -mno-prologue-epilogue -mno-gotplt @gol
611 -melf -maout -melinux -mlinux -sim -sim2}
612
613 @item Code Generation Options
614 @xref{Code Gen Options,,Options for Code Generation Conventions}.
615 @gccoptlist{
616 -fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
617 -ffixed-@var{reg} -fexceptions @gol
618 -fnon-call-exceptions  -funwind-tables -fasynchronous-unwind-tables @gol
619 -finhibit-size-directive  -finstrument-functions @gol
620 -fcheck-memory-usage  -fprefix-function-name @gol
621 -fno-common  -fno-ident  -fno-gnu-linker @gol
622 -fpcc-struct-return  -fpic  -fPIC @gol
623 -freg-struct-return  -fshared-data  -fshort-enums @gol
624 -fshort-double  -fvolatile @gol
625 -fvolatile-global  -fvolatile-static @gol
626 -fverbose-asm  -fpack-struct  -fstack-check @gol
627 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
628 -fargument-alias  -fargument-noalias @gol
629 -fargument-noalias-global  -fleading-underscore}
630 @end table
631
632 @menu
633 * Overall Options::     Controlling the kind of output:
634                         an executable, object files, assembler files,
635                         or preprocessed source.
636 * C Dialect Options::   Controlling the variant of C language compiled.
637 * C++ Dialect Options:: Variations on C++.
638 * Objective-C Dialect Options:: Variations on Objective-C.
639 * Language Independent Options:: Controlling how diagnostics should be
640                         formatted.
641 * Warning Options::     How picky should the compiler be?
642 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
643 * Optimize Options::    How much optimization?
644 * Preprocessor Options:: Controlling header files and macro definitions.
645                          Also, getting dependency information for Make.
646 * Assembler Options::   Passing options to the assembler.
647 * Link Options::        Specifying libraries and so on.
648 * Directory Options::   Where to find header files and libraries.
649                         Where to find the compiler executable files.
650 * Spec Files::          How to pass switches to sub-processes.
651 * Target Options::      Running a cross-compiler, or an old version of GCC.
652 @end menu
653
654 @node Overall Options
655 @section Options Controlling the Kind of Output
656
657 Compilation can involve up to four stages: preprocessing, compilation
658 proper, assembly and linking, always in that order.  The first three
659 stages apply to an individual source file, and end by producing an
660 object file; linking combines all the object files (those newly
661 compiled, and those specified as input) into an executable file.
662
663 @cindex file name suffix
664 For any given input file, the file name suffix determines what kind of
665 compilation is done:
666
667 @table @gcctabopt
668 @item @var{file}.c
669 C source code which must be preprocessed.
670
671 @item @var{file}.i
672 C source code which should not be preprocessed.
673
674 @item @var{file}.ii
675 C++ source code which should not be preprocessed.
676
677 @item @var{file}.m
678 Objective-C source code.  Note that you must link with the library
679 @file{libobjc.a} to make an Objective-C program work.
680
681 @item @var{file}.mi
682 Objective-C source code which should not be preprocessed.
683
684 @item @var{file}.h
685 C header file (not to be compiled or linked).
686
687 @item @var{file}.cc
688 @itemx @var{file}.cp
689 @itemx @var{file}.cxx
690 @itemx @var{file}.cpp
691 @itemx @var{file}.c++
692 @itemx @var{file}.C
693 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
694 the last two letters must both be literally @samp{x}.  Likewise,
695 @samp{.C} refers to a literal capital C@.
696
697 @item @var{file}.f
698 @itemx @var{file}.for
699 @itemx @var{file}.FOR
700 Fortran source code which should not be preprocessed.
701
702 @item @var{file}.F
703 @itemx @var{file}.fpp
704 @itemx @var{file}.FPP
705 Fortran source code which must be preprocessed (with the traditional
706 preprocessor).
707
708 @item @var{file}.r
709 Fortran source code which must be preprocessed with a RATFOR
710 preprocessor (not included with GCC)@.
711
712 @xref{Overall Options,,Options Controlling the Kind of Output, g77,
713 Using and Porting GNU Fortran}, for more details of the handling of
714 Fortran input files.
715
716 @c FIXME: Descriptions of Java file types.
717 @c @var{file}.java
718 @c @var{file}.class
719 @c @var{file}.zip
720 @c @var{file}.jar
721
722 @item @var{file}.ads
723 Ada source code file which contains a library unit declaration (a
724 declaration of a package, subprogram, or generic, or a generic
725 instantiation), or a library unit renaming declaration (a package,
726 generic, or subprogram renaming declaration).  Such files are also
727 called @dfn{specs}.
728
729 @itemx @var{file}.adb
730 Ada source code file containing a library unit body (a subprogram or
731 package body).  Such files are also called @dfn{bodies}.
732
733 @c GCC also knows about some suffixes for languages not yet included:
734 @c Pascal:
735 @c @var{file}.p
736 @c @var{file}.pas
737
738 @item @var{file}.ch
739 @itemx @var{file}.chi
740 CHILL source code (preprocessed with the traditional preprocessor).
741
742 @item @var{file}.s
743 Assembler code.
744
745 @item @var{file}.S
746 Assembler code which must be preprocessed.
747
748 @item @var{other}
749 An object file to be fed straight into linking.
750 Any file name with no recognized suffix is treated this way.
751 @end table
752
753 @opindex x
754 You can specify the input language explicitly with the @option{-x} option:
755
756 @table @gcctabopt
757 @item -x @var{language}
758 Specify explicitly the @var{language} for the following input files
759 (rather than letting the compiler choose a default based on the file
760 name suffix).  This option applies to all following input files until
761 the next @option{-x} option.  Possible values for @var{language} are:
762 @example
763 c  c-header  cpp-output
764 c++  c++-cpp-output
765 objective-c  objc-cpp-output
766 assembler  assembler-with-cpp
767 ada
768 chill
769 f77  f77-cpp-input  ratfor
770 java
771 @end example
772
773 @item -x none
774 Turn off any specification of a language, so that subsequent files are
775 handled according to their file name suffixes (as they are if @option{-x}
776 has not been used at all).
777
778 @item -pass-exit-codes
779 @opindex pass-exit-codes
780 Normally the @command{gcc} program will exit with the code of 1 if any
781 phase of the compiler returns a non-success return code.  If you specify
782 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
783 numerically highest error produced by any phase that returned an error
784 indication.
785 @end table
786
787 If you only want some of the stages of compilation, you can use
788 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
789 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
790 @command{gcc} is to stop.  Note that some combinations (for example,
791 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
792
793 @table @gcctabopt
794 @item -c
795 @opindex c
796 Compile or assemble the source files, but do not link.  The linking
797 stage simply is not done.  The ultimate output is in the form of an
798 object file for each source file.
799
800 By default, the object file name for a source file is made by replacing
801 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
802
803 Unrecognized input files, not requiring compilation or assembly, are
804 ignored.
805
806 @item -S
807 @opindex S
808 Stop after the stage of compilation proper; do not assemble.  The output
809 is in the form of an assembler code file for each non-assembler input
810 file specified.
811
812 By default, the assembler file name for a source file is made by
813 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
814
815 Input files that don't require compilation are ignored.
816
817 @item -E
818 @opindex E
819 Stop after the preprocessing stage; do not run the compiler proper.  The
820 output is in the form of preprocessed source code, which is sent to the
821 standard output.
822
823 Input files which don't require preprocessing are ignored.
824
825 @cindex output file option
826 @item -o @var{file}
827 @opindex o
828 Place output in file @var{file}.  This applies regardless to whatever
829 sort of output is being produced, whether it be an executable file,
830 an object file, an assembler file or preprocessed C code.
831
832 Since only one output file can be specified, it does not make sense to
833 use @option{-o} when compiling more than one input file, unless you are
834 producing an executable file as output.
835
836 If @option{-o} is not specified, the default is to put an executable file
837 in @file{a.out}, the object file for @file{@var{source}.@var{suffix}} in
838 @file{@var{source}.o}, its assembler file in @file{@var{source}.s}, and
839 all preprocessed C source on standard output.
840
841 @item -v
842 @opindex v
843 Print (on standard error output) the commands executed to run the stages
844 of compilation.  Also print the version number of the compiler driver
845 program and of the preprocessor and the compiler proper.
846
847 @item -pipe
848 @opindex pipe
849 Use pipes rather than temporary files for communication between the
850 various stages of compilation.  This fails to work on some systems where
851 the assembler is unable to read from a pipe; but the GNU assembler has
852 no trouble.
853
854 @item --help
855 @opindex help
856 Print (on the standard output) a description of the command line options
857 understood by @command{gcc}.  If the @option{-v} option is also specified
858 then @option{--help} will also be passed on to the various processes
859 invoked by @command{gcc}, so that they can display the command line options
860 they accept.  If the @option{-W} option is also specified then command
861 line options which have no documentation associated with them will also
862 be displayed.
863
864 @item --target-help
865 @opindex target-help
866 Print (on the standard output) a description of target specific command
867 line options for each tool.
868 @end table
869
870 @node Invoking G++
871 @section Compiling C++ Programs
872
873 @cindex suffixes for C++ source
874 @cindex C++ source file suffixes
875 C++ source files conventionally use one of the suffixes @samp{.C},
876 @samp{.cc}, @samp{.cpp}, @samp{.c++}, @samp{.cp}, or @samp{.cxx};
877 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
878 files with these names and compiles them as C++ programs even if you
879 call the compiler the same way as for compiling C programs (usually with
880 the name @command{gcc}).
881
882 @findex g++
883 @findex c++
884 However, C++ programs often require class libraries as well as a
885 compiler that understands the C++ language---and under some
886 circumstances, you might want to compile programs from standard input,
887 or otherwise without a suffix that flags them as C++ programs.
888 @command{g++} is a program that calls GCC with the default language
889 set to C++, and automatically specifies linking against the C++
890 library.  On many systems, @command{g++} is also
891 installed with the name @command{c++}.
892
893 @cindex invoking @command{g++}
894 When you compile C++ programs, you may specify many of the same
895 command-line options that you use for compiling programs in any
896 language; or command-line options meaningful for C and related
897 languages; or options that are meaningful only for C++ programs.
898 @xref{C Dialect Options,,Options Controlling C Dialect}, for
899 explanations of options for languages related to C@.
900 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
901 explanations of options that are meaningful only for C++ programs.
902
903 @node C Dialect Options
904 @section Options Controlling C Dialect
905 @cindex dialect options
906 @cindex language dialect options
907 @cindex options, dialect
908
909 The following options control the dialect of C (or languages derived
910 from C, such as C++ and Objective-C) that the compiler accepts:
911
912 @table @gcctabopt
913 @cindex ANSI support
914 @cindex ISO support
915 @item -ansi
916 @opindex ansi
917 In C mode, support all ISO C89 programs.  In C++ mode,
918 remove GNU extensions that conflict with ISO C++.
919
920 This turns off certain features of GCC that are incompatible with ISO
921 C89 (when compiling C code), or of standard C++ (when compiling C++ code),
922 such as the @code{asm} and @code{typeof} keywords, and
923 predefined macros such as @code{unix} and @code{vax} that identify the
924 type of system you are using.  It also enables the undesirable and
925 rarely used ISO trigraph feature.  For the C compiler,
926 it disables recognition of C++ style @samp{//} comments as well as
927 the @code{inline} keyword.
928
929 The alternate keywords @code{__asm__}, @code{__extension__},
930 @code{__inline__} and @code{__typeof__} continue to work despite
931 @option{-ansi}.  You would not want to use them in an ISO C program, of
932 course, but it is useful to put them in header files that might be included
933 in compilations done with @option{-ansi}.  Alternate predefined macros
934 such as @code{__unix__} and @code{__vax__} are also available, with or
935 without @option{-ansi}.
936
937 The @option{-ansi} option does not cause non-ISO programs to be
938 rejected gratuitously.  For that, @option{-pedantic} is required in
939 addition to @option{-ansi}.  @xref{Warning Options}.
940
941 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
942 option is used.  Some header files may notice this macro and refrain
943 from declaring certain functions or defining certain macros that the
944 ISO standard doesn't call for; this is to avoid interfering with any
945 programs that might use these names for other things.
946
947 Functions which would normally be built in but do not have semantics
948 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
949 functions with @option{-ansi} is used.  @xref{Other Builtins,,Other
950 built-in functions provided by GCC}, for details of the functions
951 affected.
952
953 @item -std=
954 @opindex std
955 Determine the language standard.  This option is currently only
956 supported when compiling C@.  A value for this option must be provided;
957 possible values are
958
959 @table @samp
960 @item c89
961 @itemx iso9899:1990
962 ISO C89 (same as @option{-ansi}).
963
964 @item iso9899:199409
965 ISO C89 as modified in amendment 1.
966
967 @item c99
968 @itemx c9x
969 @itemx iso9899:1999
970 @itemx iso9899:199x
971 ISO C99.  Note that this standard is not yet fully supported; see
972 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
973 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
974
975 @item gnu89
976 Default, ISO C89 plus GNU extensions (including some C99 features).
977
978 @item gnu99
979 @item gnu9x
980 ISO C99 plus GNU extensions.  When ISO C99 is fully implemented in GCC,
981 this will become the default.  The name @samp{gnu9x} is deprecated.
982
983 @end table
984
985 Even when this option is not specified, you can still use some of the
986 features of newer standards in so far as they do not conflict with
987 previous C standards.  For example, you may use @code{__restrict__} even
988 when @option{-std=c99} is not specified.
989
990 The @option{-std} options specifying some version of ISO C have the same
991 effects as @option{-ansi}, except that features that were not in ISO C89
992 but are in the specified version (for example, @samp{//} comments and
993 the @code{inline} keyword in ISO C99) are not disabled.
994
995 @xref{Standards,,Language Standards Supported by GCC}, for details of
996 these standard versions.
997
998 @item -aux-info @var{filename}
999 @opindex aux-info
1000 Output to the given filename prototyped declarations for all functions
1001 declared and/or defined in a translation unit, including those in header
1002 files.  This option is silently ignored in any language other than C@.
1003
1004 Besides declarations, the file indicates, in comments, the origin of
1005 each declaration (source file and line), whether the declaration was
1006 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1007 @samp{O} for old, respectively, in the first character after the line
1008 number and the colon), and whether it came from a declaration or a
1009 definition (@samp{C} or @samp{F}, respectively, in the following
1010 character).  In the case of function definitions, a K&R-style list of
1011 arguments followed by their declarations is also provided, inside
1012 comments, after the declaration.
1013
1014 @item -fno-asm
1015 @opindex fno-asm
1016 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1017 keyword, so that code can use these words as identifiers.  You can use
1018 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1019 instead.  @option{-ansi} implies @option{-fno-asm}.
1020
1021 In C++, this switch only affects the @code{typeof} keyword, since
1022 @code{asm} and @code{inline} are standard keywords.  You may want to
1023 use the @option{-fno-gnu-keywords} flag instead, which has the same
1024 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1025 switch only affects the @code{asm} and @code{typeof} keywords, since
1026 @code{inline} is a standard keyword in ISO C99.
1027
1028 @item -fno-builtin
1029 @itemx -fno-builtin-@var{function} @r{(C and Objective-C only)}
1030 @opindex fno-builtin
1031 @cindex built-in functions
1032 Don't recognize built-in functions that do not begin with
1033 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1034 functions provided by GCC}, for details of the functions affected,
1035 including those which are not built-in functions when @option{-ansi} or
1036 @option{-std} options for strict ISO C conformance are used because they
1037 do not have an ISO standard meaning.
1038
1039 GCC normally generates special code to handle certain built-in functions
1040 more efficiently; for instance, calls to @code{alloca} may become single
1041 instructions that adjust the stack directly, and calls to @code{memcpy}
1042 may become inline copy loops.  The resulting code is often both smaller
1043 and faster, but since the function calls no longer appear as such, you
1044 cannot set a breakpoint on those calls, nor can you change the behavior
1045 of the functions by linking with a different library.
1046
1047 In C++, @option{-fno-builtin} is always in effect.  The @option{-fbuiltin}
1048 option has no effect.  Therefore, in C++, the only way to get the
1049 optimization benefits of built-in functions is to call the function
1050 using the @samp{__builtin_} prefix.  The GNU C++ Standard Library uses
1051 built-in functions to implement many functions (like
1052 @code{std::strchr}), so that you automatically get efficient code.
1053
1054 With the @option{-fno-builtin-@var{function}} option, not available
1055 when compiling C++, only the built-in function @var{function} is
1056 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1057 function is named this is not built-in in this version of GCC, this
1058 option is ignored.  There is no corresponding
1059 @option{-fbuiltin-@var{function}} option; if you wish to enable
1060 built-in functions selectively when using @option{-fno-builtin} or
1061 @option{-ffreestanding}, you may define macros such as:
1062
1063 @smallexample
1064 #define abs(n)          __builtin_abs ((n))
1065 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1066 @end smallexample
1067
1068 @item -fhosted
1069 @opindex fhosted
1070 @cindex hosted environment
1071
1072 Assert that compilation takes place in a hosted environment.  This implies
1073 @option{-fbuiltin}.  A hosted environment is one in which the
1074 entire standard library is available, and in which @code{main} has a return
1075 type of @code{int}.  Examples are nearly everything except a kernel.
1076 This is equivalent to @option{-fno-freestanding}.
1077
1078 @item -ffreestanding
1079 @opindex ffreestanding
1080 @cindex hosted environment
1081
1082 Assert that compilation takes place in a freestanding environment.  This
1083 implies @option{-fno-builtin}.  A freestanding environment
1084 is one in which the standard library may not exist, and program startup may
1085 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1086 This is equivalent to @option{-fno-hosted}.
1087
1088 @xref{Standards,,Language Standards Supported by GCC}, for details of
1089 freestanding and hosted environments.
1090
1091 @item -trigraphs
1092 @opindex trigraphs
1093 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1094 options for strict ISO C conformance) implies @option{-trigraphs}.
1095
1096 @cindex traditional C language
1097 @cindex C language, traditional
1098 @item -traditional
1099 @opindex traditional
1100 Attempt to support some aspects of traditional C compilers.
1101 Specifically:
1102
1103 @itemize @bullet
1104 @item
1105 All @code{extern} declarations take effect globally even if they
1106 are written inside of a function definition.  This includes implicit
1107 declarations of functions.
1108
1109 @item
1110 The newer keywords @code{typeof}, @code{inline}, @code{signed}, @code{const}
1111 and @code{volatile} are not recognized.  (You can still use the
1112 alternative keywords such as @code{__typeof__}, @code{__inline__}, and
1113 so on.)
1114
1115 @item
1116 Comparisons between pointers and integers are always allowed.
1117
1118 @item
1119 Integer types @code{unsigned short} and @code{unsigned char} promote
1120 to @code{unsigned int}.
1121
1122 @item
1123 Out-of-range floating point literals are not an error.
1124
1125 @item
1126 Certain constructs which ISO regards as a single invalid preprocessing
1127 number, such as @samp{0xe-0xd}, are treated as expressions instead.
1128
1129 @item
1130 String ``constants'' are not necessarily constant; they are stored in
1131 writable space, and identical looking constants are allocated
1132 separately.  (This is the same as the effect of
1133 @option{-fwritable-strings}.)
1134
1135 @cindex @code{longjmp} and automatic variables
1136 @item
1137 All automatic variables not declared @code{register} are preserved by
1138 @code{longjmp}.  Ordinarily, GNU C follows ISO C: automatic variables
1139 not declared @code{volatile} may be clobbered.
1140
1141 @item
1142 @cindex @samp{\x}
1143 @cindex @samp{\a}
1144 @cindex escape sequences, traditional
1145 The character escape sequences @samp{\x} and @samp{\a} evaluate as the
1146 literal characters @samp{x} and @samp{a} respectively.  Without
1147 @w{@option{-traditional}}, @samp{\x} is a prefix for the hexadecimal
1148 representation of a character, and @samp{\a} produces a bell.
1149 @end itemize
1150
1151 This option is deprecated and may be removed.
1152
1153 You may wish to use @option{-fno-builtin} as well as @option{-traditional}
1154 if your program uses names that are normally GNU C built-in functions for
1155 other purposes of its own.
1156
1157 You cannot use @option{-traditional} if you include any header files that
1158 rely on ISO C features.  Some vendors are starting to ship systems with
1159 ISO C header files and you cannot use @option{-traditional} on such
1160 systems to compile files that include any system headers.
1161
1162 The @option{-traditional} option also enables @option{-traditional-cpp}.
1163
1164 @item -traditional-cpp
1165 @opindex traditional-cpp
1166 Attempt to support some aspects of traditional C preprocessors.
1167 See the GNU CPP manual for details.
1168
1169 @item -fcond-mismatch
1170 @opindex fcond-mismatch
1171 Allow conditional expressions with mismatched types in the second and
1172 third arguments.  The value of such an expression is void.  This option
1173 is not supported for C++.
1174
1175 @item -funsigned-char
1176 @opindex funsigned-char
1177 Let the type @code{char} be unsigned, like @code{unsigned char}.
1178
1179 Each kind of machine has a default for what @code{char} should
1180 be.  It is either like @code{unsigned char} by default or like
1181 @code{signed char} by default.
1182
1183 Ideally, a portable program should always use @code{signed char} or
1184 @code{unsigned char} when it depends on the signedness of an object.
1185 But many programs have been written to use plain @code{char} and
1186 expect it to be signed, or expect it to be unsigned, depending on the
1187 machines they were written for.  This option, and its inverse, let you
1188 make such a program work with the opposite default.
1189
1190 The type @code{char} is always a distinct type from each of
1191 @code{signed char} or @code{unsigned char}, even though its behavior
1192 is always just like one of those two.
1193
1194 @item -fsigned-char
1195 @opindex fsigned-char
1196 Let the type @code{char} be signed, like @code{signed char}.
1197
1198 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1199 the negative form of @option{-funsigned-char}.  Likewise, the option
1200 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1201
1202 @item -fsigned-bitfields
1203 @itemx -funsigned-bitfields
1204 @itemx -fno-signed-bitfields
1205 @itemx -fno-unsigned-bitfields
1206 @opindex fsigned-bitfields
1207 @opindex funsigned-bitfields
1208 @opindex fno-signed-bitfields
1209 @opindex fno-unsigned-bitfields
1210 These options control whether a bit-field is signed or unsigned, when the
1211 declaration does not use either @code{signed} or @code{unsigned}.  By
1212 default, such a bit-field is signed, because this is consistent: the
1213 basic integer types such as @code{int} are signed types.
1214
1215 However, when @option{-traditional} is used, bit-fields are all unsigned
1216 no matter what.
1217
1218 @item -fwritable-strings
1219 @opindex fwritable-strings
1220 Store string constants in the writable data segment and don't uniquize
1221 them.  This is for compatibility with old programs which assume they can
1222 write into string constants.  The option @option{-traditional} also has
1223 this effect.
1224
1225 Writing into string constants is a very bad idea; ``constants'' should
1226 be constant.
1227
1228 @item -fallow-single-precision
1229 @opindex fallow-single-precision
1230 Do not promote single precision math operations to double precision,
1231 even when compiling with @option{-traditional}.
1232
1233 Traditional K&R C promotes all floating point operations to double
1234 precision, regardless of the sizes of the operands.   On the
1235 architecture for which you are compiling, single precision may be faster
1236 than double precision.   If you must use @option{-traditional}, but want
1237 to use single precision operations when the operands are single
1238 precision, use this option.   This option has no effect when compiling
1239 with ISO or GNU C conventions (the default).
1240
1241 @item -fshort-wchar
1242 @opindex fshort-wchar
1243 Override the underlying type for @samp{wchar_t} to be @samp{short
1244 unsigned int} instead of the default for the target.  This option is
1245 useful for building programs to run under WINE@.
1246 @end table
1247
1248 @node C++ Dialect Options
1249 @section Options Controlling C++ Dialect
1250
1251 @cindex compiler options, C++
1252 @cindex C++ options, command line
1253 @cindex options, C++
1254 This section describes the command-line options that are only meaningful
1255 for C++ programs; but you can also use most of the GNU compiler options
1256 regardless of what language your program is in.  For example, you
1257 might compile a file @code{firstClass.C} like this:
1258
1259 @example
1260 g++ -g -frepo -O -c firstClass.C
1261 @end example
1262
1263 @noindent
1264 In this example, only @option{-frepo} is an option meant
1265 only for C++ programs; you can use the other options with any
1266 language supported by GCC@.
1267
1268 Here is a list of options that are @emph{only} for compiling C++ programs:
1269
1270 @table @gcctabopt
1271 @item -fno-access-control
1272 @opindex fno-access-control
1273 Turn off all access checking.  This switch is mainly useful for working
1274 around bugs in the access control code.
1275
1276 @item -fcheck-new
1277 @opindex fcheck-new
1278 Check that the pointer returned by @code{operator new} is non-null
1279 before attempting to modify the storage allocated.  The current Working
1280 Paper requires that @code{operator new} never return a null pointer, so
1281 this check is normally unnecessary.
1282
1283 An alternative to using this option is to specify that your
1284 @code{operator new} does not throw any exceptions; if you declare it
1285 @samp{throw()}, G++ will check the return value.  See also @samp{new
1286 (nothrow)}.
1287
1288 @item -fconserve-space
1289 @opindex fconserve-space
1290 Put uninitialized or runtime-initialized global variables into the
1291 common segment, as C does.  This saves space in the executable at the
1292 cost of not diagnosing duplicate definitions.  If you compile with this
1293 flag and your program mysteriously crashes after @code{main()} has
1294 completed, you may have an object that is being destroyed twice because
1295 two definitions were merged.
1296
1297 This option is no longer useful on most targets, now that support has
1298 been added for putting variables into BSS without making them common.
1299
1300 @item -fno-const-strings
1301 @opindex fno-const-strings
1302 Give string constants type @code{char *} instead of type @code{const
1303 char *}.  By default, G++ uses type @code{const char *} as required by
1304 the standard.  Even if you use @option{-fno-const-strings}, you cannot
1305 actually modify the value of a string constant, unless you also use
1306 @option{-fwritable-strings}.
1307
1308 This option might be removed in a future release of G++.  For maximum
1309 portability, you should structure your code so that it works with
1310 string constants that have type @code{const char *}.
1311
1312 @item -fdollars-in-identifiers
1313 @opindex fdollars-in-identifiers
1314 Accept @samp{$} in identifiers.  You can also explicitly prohibit use of
1315 @samp{$} with the option @option{-fno-dollars-in-identifiers}.  (GNU C allows
1316 @samp{$} by default on most target systems, but there are a few exceptions.)
1317 Traditional C allowed the character @samp{$} to form part of
1318 identifiers.  However, ISO C and C++ forbid @samp{$} in identifiers.
1319
1320 @item -fno-elide-constructors
1321 @opindex fno-elide-constructors
1322 The C++ standard allows an implementation to omit creating a temporary
1323 which is only used to initialize another object of the same type.
1324 Specifying this option disables that optimization, and forces G++ to
1325 call the copy constructor in all cases.
1326
1327 @item -fno-enforce-eh-specs
1328 @opindex fno-enforce-eh-specs
1329 Don't check for violation of exception specifications at runtime.  This
1330 option violates the C++ standard, but may be useful for reducing code
1331 size in production builds, much like defining @samp{NDEBUG}.  The compiler
1332 will still optimize based on the exception specifications.
1333
1334 @item -fexternal-templates
1335 @opindex fexternal-templates
1336
1337 Cause @samp{#pragma interface} and @samp{implementation} to apply to
1338 template instantiation; template instances are emitted or not according
1339 to the location of the template definition.  @xref{Template
1340 Instantiation}, for more information.
1341
1342 This option is deprecated.
1343
1344 @item -falt-external-templates
1345 @opindex falt-external-templates
1346 Similar to @option{-fexternal-templates}, but template instances are
1347 emitted or not according to the place where they are first instantiated.
1348 @xref{Template Instantiation}, for more information.
1349
1350 This option is deprecated.
1351
1352 @item -ffor-scope
1353 @itemx -fno-for-scope
1354 @opindex ffor-scope
1355 @opindex fno-for-scope
1356 If @option{-ffor-scope} is specified, the scope of variables declared in
1357 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1358 as specified by the C++ standard.
1359 If @option{-fno-for-scope} is specified, the scope of variables declared in
1360 a @i{for-init-statement} extends to the end of the enclosing scope,
1361 as was the case in old versions of G++, and other (traditional)
1362 implementations of C++.
1363
1364 The default if neither flag is given to follow the standard,
1365 but to allow and give a warning for old-style code that would
1366 otherwise be invalid, or have different behavior.
1367
1368 @item -fno-gnu-keywords
1369 @opindex fno-gnu-keywords
1370 Do not recognize @code{typeof} as a keyword, so that code can use this
1371 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1372 @option{-ansi} implies @option{-fno-gnu-keywords}.
1373
1374 @item -fno-implicit-templates
1375 @opindex fno-implicit-templates
1376 Never emit code for non-inline templates which are instantiated
1377 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1378 @xref{Template Instantiation}, for more information.
1379
1380 @item -fno-implicit-inline-templates
1381 @opindex fno-implicit-inline-templates
1382 Don't emit code for implicit instantiations of inline templates, either.
1383 The default is to handle inlines differently so that compiles with and
1384 without optimization will need the same set of explicit instantiations.
1385
1386 @item -fno-implement-inlines
1387 @opindex fno-implement-inlines
1388 To save space, do not emit out-of-line copies of inline functions
1389 controlled by @samp{#pragma implementation}.  This will cause linker
1390 errors if these functions are not inlined everywhere they are called.
1391
1392 @item -fms-extensions
1393 @opindex fms-extensions
1394 Disable pedantic warnings about constructs used in MFC, such as implicit
1395 int and getting a pointer to member function via non-standard syntax.
1396
1397 @item -fno-nonansi-builtins
1398 @opindex fno-nonansi-builtins
1399 Disable built-in declarations of functions that are not mandated by
1400 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1401 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1402
1403 @item -fno-operator-names
1404 @opindex fno-operator-names
1405 Do not treat the operator name keywords @code{and}, @code{bitand},
1406 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1407 synonyms as keywords.
1408
1409 @item -fno-optional-diags
1410 @opindex fno-optional-diags
1411 Disable diagnostics that the standard says a compiler does not need to
1412 issue.  Currently, the only such diagnostic issued by G++ is the one for
1413 a name having multiple meanings within a class.
1414
1415 @item -fpermissive
1416 @opindex fpermissive
1417 Downgrade messages about nonconformant code from errors to warnings.  By
1418 default, G++ effectively sets @option{-pedantic-errors} without
1419 @option{-pedantic}; this option reverses that.  This behavior and this
1420 option are superseded by @option{-pedantic}, which works as it does for GNU C@.
1421
1422 @item -frepo
1423 @opindex frepo
1424 Enable automatic template instantiation at link time.  This option also
1425 implies @option{-fno-implicit-templates}.  @xref{Template
1426 Instantiation}, for more information.
1427
1428 @item -fno-rtti
1429 @opindex fno-rtti
1430 Disable generation of information about every class with virtual
1431 functions for use by the C++ runtime type identification features
1432 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1433 of the language, you can save some space by using this flag.  Note that
1434 exception handling uses the same information, but it will generate it as
1435 needed.
1436
1437 @item -fstats
1438 @opindex fstats
1439 Emit statistics about front-end processing at the end of the compilation.
1440 This information is generally only useful to the G++ development team.
1441
1442 @item -ftemplate-depth-@var{n}
1443 @opindex ftemplate-depth
1444 Set the maximum instantiation depth for template classes to @var{n}.
1445 A limit on the template instantiation depth is needed to detect
1446 endless recursions during template class instantiation.  ANSI/ISO C++
1447 conforming programs must not rely on a maximum depth greater than 17.
1448
1449 @item -fuse-cxa-atexit
1450 @opindex fuse-cxa-atexit
1451 Register destructors for objects with static storage duration with the
1452 @code{__cxa_atexit} function rather than the @code{atexit} function.
1453 This option is required for fully standards-compliant handling of static
1454 destructors, but will only work if your C library supports
1455 @code{__cxa_atexit}.
1456
1457 @item -fvtable-gc
1458 @opindex fvtable-gc
1459 Emit special relocations for vtables and virtual function references
1460 so that the linker can identify unused virtual functions and zero out
1461 vtable slots that refer to them.  This is most useful with
1462 @option{-ffunction-sections} and @option{-Wl,--gc-sections}, in order to
1463 also discard the functions themselves.
1464
1465 This optimization requires GNU as and GNU ld.  Not all systems support
1466 this option.  @option{-Wl,--gc-sections} is ignored without @option{-static}.
1467
1468 @item -fno-weak
1469 @opindex fno-weak
1470 Do not use weak symbol support, even if it is provided by the linker.
1471 By default, G++ will use weak symbols if they are available.  This
1472 option exists only for testing, and should not be used by end-users;
1473 it will result in inferior code and has no benefits.  This option may
1474 be removed in a future release of G++.
1475
1476 @item -nostdinc++
1477 @opindex nostdinc++
1478 Do not search for header files in the standard directories specific to
1479 C++, but do still search the other standard directories.  (This option
1480 is used when building the C++ library.)
1481 @end table
1482
1483 In addition, these optimization, warning, and code generation options
1484 have meanings only for C++ programs:
1485
1486 @table @gcctabopt
1487 @item -fno-default-inline
1488 @opindex fno-default-inline
1489 Do not assume @samp{inline} for functions defined inside a class scope.
1490 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1491 functions will have linkage like inline functions; they just won't be
1492 inlined by default.
1493
1494 @item -Wctor-dtor-privacy @r{(C++ only)}
1495 @opindex Wctor-dtor-privacy
1496 Warn when a class seems unusable, because all the constructors or
1497 destructors in a class are private and the class has no friends or
1498 public static member functions.
1499
1500 @item -Wnon-virtual-dtor @r{(C++ only)}
1501 @opindex Wnon-virtual-dtor
1502 Warn when a class declares a non-virtual destructor that should probably
1503 be virtual, because it looks like the class will be used polymorphically.
1504
1505 @item -Wreorder @r{(C++ only)}
1506 @opindex Wreorder
1507 @cindex reordering, warning
1508 @cindex warning for reordering of member initializers
1509 Warn when the order of member initializers given in the code does not
1510 match the order in which they must be executed.  For instance:
1511
1512 @smallexample
1513 struct A @{
1514   int i;
1515   int j;
1516   A(): j (0), i (1) @{ @}
1517 @};
1518 @end smallexample
1519
1520 Here the compiler will warn that the member initializers for @samp{i}
1521 and @samp{j} will be rearranged to match the declaration order of the
1522 members.
1523 @end table
1524
1525 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
1526
1527 @table @gcctabopt
1528 @item -Weffc++ @r{(C++ only)}
1529 @opindex Weffc++
1530 Warn about violations of various style guidelines from Scott Meyers'
1531 @cite{Effective C++} books.  If you use this option, you should be aware
1532 that the standard library headers do not obey all of these guidelines;
1533 you can use @samp{grep -v} to filter out those warnings.
1534
1535 @item -Wno-deprecated @r{(C++ only)}
1536 @opindex Wno-deprecated
1537 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
1538
1539 @item -Wno-non-template-friend @r{(C++ only)}
1540 @opindex Wno-non-template-friend
1541 Disable warnings when non-templatized friend functions are declared
1542 within a template.  With the advent of explicit template specification
1543 support in G++, if the name of the friend is an unqualified-id (i.e.,
1544 @samp{friend foo(int)}), the C++ language specification demands that the
1545 friend declare or define an ordinary, nontemplate function.  (Section
1546 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
1547 could be interpreted as a particular specialization of a templatized
1548 function.  Because this non-conforming behavior is no longer the default
1549 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
1550 check existing code for potential trouble spots, and is on by default.
1551 This new compiler behavior can be turned off with
1552 @option{-Wno-non-template-friend} which keeps the conformant compiler code
1553 but disables the helpful warning.
1554
1555 @item -Wold-style-cast @r{(C++ only)}
1556 @opindex Wold-style-cast
1557 Warn if an old-style (C-style) cast is used within a C++ program.  The
1558 new-style casts (@samp{static_cast}, @samp{reinterpret_cast}, and
1559 @samp{const_cast}) are less vulnerable to unintended effects, and much
1560 easier to grep for.
1561
1562 @item -Woverloaded-virtual @r{(C++ only)}
1563 @opindex Woverloaded-virtual
1564 @cindex overloaded virtual fn, warning
1565 @cindex warning for overloaded virtual fn
1566 Warn when a function declaration hides virtual functions from a
1567 base class.  For example, in:
1568
1569 @smallexample
1570 struct A @{
1571   virtual void f();
1572 @};
1573
1574 struct B: public A @{
1575   void f(int);
1576 @};
1577 @end smallexample
1578
1579 the @code{A} class version of @code{f} is hidden in @code{B}, and code
1580 like this:
1581
1582 @smallexample
1583 B* b;
1584 b->f();
1585 @end smallexample
1586
1587 will fail to compile.
1588
1589 @item -Wno-pmf-conversions @r{(C++ only)}
1590 @opindex Wno-pmf-conversions
1591 Disable the diagnostic for converting a bound pointer to member function
1592 to a plain pointer.
1593
1594 @item -Wsign-promo @r{(C++ only)}
1595 @opindex Wsign-promo
1596 Warn when overload resolution chooses a promotion from unsigned or
1597 enumeral type to a signed type over a conversion to an unsigned type of
1598 the same size.  Previous versions of G++ would try to preserve
1599 unsignedness, but the standard mandates the current behavior.
1600
1601 @item -Wsynth @r{(C++ only)}
1602 @opindex Wsynth
1603 @cindex warning for synthesized methods
1604 @cindex synthesized methods, warning
1605 Warn when G++'s synthesis behavior does not match that of cfront.  For
1606 instance:
1607
1608 @smallexample
1609 struct A @{
1610   operator int ();
1611   A& operator = (int);
1612 @};
1613
1614 main ()
1615 @{
1616   A a,b;
1617   a = b;
1618 @}
1619 @end smallexample
1620
1621 In this example, G++ will synthesize a default @samp{A& operator =
1622 (const A&);}, while cfront will use the user-defined @samp{operator =}.
1623 @end table
1624
1625 @node Objective-C Dialect Options
1626 @section Options Controlling Objective-C Dialect
1627
1628 @cindex compiler options, Objective-C
1629 @cindex Objective-C options, command line
1630 @cindex options, Objective-C
1631 This section describes the command-line options that are only meaningful
1632 for Objective-C programs; but you can also use most of the GNU compiler
1633 options regardless of what language your program is in.  For example,
1634 you might compile a file @code{some_class.m} like this:
1635
1636 @example
1637 gcc -g -fgnu-runtime -O -c some_class.m
1638 @end example
1639
1640 @noindent
1641 In this example, only @option{-fgnu-runtime} is an option meant only for
1642 Objective-C programs; you can use the other options with any language
1643 supported by GCC@.
1644
1645 Here is a list of options that are @emph{only} for compiling Objective-C
1646 programs:
1647
1648 @table @gcctabopt
1649 @item -fconstant-string-class=@var{class-name}
1650 @opindex fconstant-string-class
1651 Use @var{class-name} as the name of the class to instantiate for each
1652 literal string specified with the syntax @code{@@"@dots{}"}.  The default
1653 class name is @code{NXConstantString}.
1654
1655 @item -fgnu-runtime
1656 @opindex fgnu-runtime
1657 Generate object code compatible with the standard GNU Objective-C
1658 runtime.  This is the default for most types of systems.
1659
1660 @item -fnext-runtime
1661 @opindex fnext-runtime
1662 Generate output compatible with the NeXT runtime.  This is the default
1663 for NeXT-based systems, including Darwin and Mac OS X@.
1664
1665 @item -gen-decls
1666 @opindex gen-decls
1667 Dump interface declarations for all classes seen in the source file to a
1668 file named @file{@var{sourcename}.decl}.
1669
1670 @item -Wno-protocol
1671 @opindex Wno-protocol
1672 Do not warn if methods required by a protocol are not implemented
1673 in the class adopting it.
1674
1675 @item -Wselector
1676 @opindex Wselector
1677 Warn if a selector has multiple methods of different types defined.
1678
1679 @c not documented because only avail via -Wp
1680 @c @item -print-objc-runtime-info
1681
1682 @end table
1683
1684 @node Language Independent Options
1685 @section Options to Control Diagnostic Messages Formatting
1686 @cindex options to control diagnostics formatting
1687 @cindex diagnostic messages
1688 @cindex message formatting
1689
1690 Traditionally, diagnostic messages have been formatted irrespective of
1691 the output device's aspect (e.g.@: its width, @dots{}).  The options described
1692 below can be used to control the diagnostic messages formatting
1693 algorithm, e.g.@: how many characters per line, how often source location
1694 information should be reported.  Right now, only the C++ front end can
1695 honor these options.  However it is expected, in the near future, that
1696 the remaining front ends would be able to digest them correctly.
1697
1698 @table @gcctabopt
1699 @item -fmessage-length=@var{n}
1700 @opindex fmessage-length
1701 Try to format error messages so that they fit on lines of about @var{n}
1702 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
1703 the front ends supported by GCC@.  If @var{n} is zero, then no
1704 line-wrapping will be done; each error message will appear on a single
1705 line.
1706
1707 @opindex fdiagnostics-show-location
1708 @item -fdiagnostics-show-location=once
1709 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
1710 reporter to emit @emph{once} source location information; that is, in
1711 case the message is too long to fit on a single physical line and has to
1712 be wrapped, the source location won't be emitted (as prefix) again,
1713 over and over, in subsequent continuation lines.  This is the default
1714 behaviour.
1715
1716 @item -fdiagnostics-show-location=every-line
1717 Only meaningful in line-wrapping mode.  Instructs the diagnostic
1718 messages reporter to emit the same source location information (as
1719 prefix) for physical lines that result from the process of breaking
1720 a message which is too long to fit on a single line.
1721
1722 @end table
1723
1724 @node Warning Options
1725 @section Options to Request or Suppress Warnings
1726 @cindex options to control warnings
1727 @cindex warning messages
1728 @cindex messages, warning
1729 @cindex suppressing warnings
1730
1731 Warnings are diagnostic messages that report constructions which
1732 are not inherently erroneous but which are risky or suggest there
1733 may have been an error.
1734
1735 You can request many specific warnings with options beginning @samp{-W},
1736 for example @option{-Wimplicit} to request warnings on implicit
1737 declarations.  Each of these specific warning options also has a
1738 negative form beginning @samp{-Wno-} to turn off warnings;
1739 for example, @option{-Wno-implicit}.  This manual lists only one of the
1740 two forms, whichever is not the default.
1741
1742 These options control the amount and kinds of warnings produced by GCC:
1743
1744 @table @gcctabopt
1745 @cindex syntax checking
1746 @item -fsyntax-only
1747 @opindex fsyntax-only
1748 Check the code for syntax errors, but don't do anything beyond that.
1749
1750 @item -pedantic
1751 @opindex pedantic
1752 Issue all the warnings demanded by strict ISO C and ISO C++;
1753 reject all programs that use forbidden extensions, and some other
1754 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
1755 version of the ISO C standard specified by any @option{-std} option used.
1756
1757 Valid ISO C and ISO C++ programs should compile properly with or without
1758 this option (though a rare few will require @option{-ansi} or a
1759 @option{-std} option specifying the required version of ISO C)@.  However,
1760 without this option, certain GNU extensions and traditional C and C++
1761 features are supported as well.  With this option, they are rejected.
1762
1763 @option{-pedantic} does not cause warning messages for use of the
1764 alternate keywords whose names begin and end with @samp{__}.  Pedantic
1765 warnings are also disabled in the expression that follows
1766 @code{__extension__}.  However, only system header files should use
1767 these escape routes; application programs should avoid them.
1768 @xref{Alternate Keywords}.
1769
1770 Some users try to use @option{-pedantic} to check programs for strict ISO
1771 C conformance.  They soon find that it does not do quite what they want:
1772 it finds some non-ISO practices, but not all---only those for which
1773 ISO C @emph{requires} a diagnostic, and some others for which
1774 diagnostics have been added.
1775
1776 A feature to report any failure to conform to ISO C might be useful in
1777 some instances, but would require considerable additional work and would
1778 be quite different from @option{-pedantic}.  We don't have plans to
1779 support such a feature in the near future.
1780
1781 Where the standard specified with @option{-std} represents a GNU
1782 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
1783 corresponding @dfn{base standard}, the version of ISO C on which the GNU
1784 extended dialect is based.  Warnings from @option{-pedantic} are given
1785 where they are required by the base standard.  (It would not make sense
1786 for such warnings to be given only for features not in the specified GNU
1787 C dialect, since by definition the GNU dialects of C include all
1788 features the compiler supports with the given option, and there would be
1789 nothing to warn about.)
1790
1791 @item -pedantic-errors
1792 @opindex pedantic-errors
1793 Like @option{-pedantic}, except that errors are produced rather than
1794 warnings.
1795
1796 @item -w
1797 @opindex w
1798 Inhibit all warning messages.
1799
1800 @item -Wno-import
1801 @opindex Wno-import
1802 Inhibit warning messages about the use of @samp{#import}.
1803
1804 @item -Wchar-subscripts
1805 @opindex Wchar-subscripts
1806 Warn if an array subscript has type @code{char}.  This is a common cause
1807 of error, as programmers often forget that this type is signed on some
1808 machines.
1809
1810 @item -Wcomment
1811 @opindex Wcomment
1812 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
1813 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
1814
1815 @item -Wformat
1816 @opindex Wformat
1817 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
1818 the arguments supplied have types appropriate to the format string
1819 specified, and that the conversions specified in the format string make
1820 sense.  This includes standard functions, and others specified by format
1821 attributes (@pxref{Function Attributes}), in the @code{printf},
1822 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
1823 not in the C standard) families.
1824
1825 The formats are checked against the format features supported by GNU
1826 libc version 2.2.  These include all ISO C89 and C99 features, as well
1827 as features from the Single Unix Specification and some BSD and GNU
1828 extensions.  Other library implementations may not support all these
1829 features; GCC does not support warning about features that go beyond a
1830 particular library's limitations.  However, if @option{-pedantic} is used
1831 with @option{-Wformat}, warnings will be given about format features not
1832 in the selected standard version (but not for @code{strfmon} formats,
1833 since those are not in any version of the C standard).  @xref{C Dialect
1834 Options,,Options Controlling C Dialect}.
1835
1836 @option{-Wformat} is included in @option{-Wall}.  For more control over some
1837 aspects of format checking, the options @option{-Wno-format-y2k},
1838 @option{-Wno-format-extra-args}, @option{-Wformat-nonliteral},
1839 @option{-Wformat-security} and @option{-Wformat=2} are available, but are
1840 not included in @option{-Wall}.
1841
1842 @item -Wno-format-y2k
1843 @opindex Wno-format-y2k
1844 If @option{-Wformat} is specified, do not warn about @code{strftime}
1845 formats which may yield only a two-digit year.
1846
1847 @item -Wno-format-extra-args
1848 @opindex Wno-format-extra-args
1849 If @option{-Wformat} is specified, do not warn about excess arguments to a
1850 @code{printf} or @code{scanf} format function.  The C standard specifies
1851 that such arguments are ignored.
1852
1853 Where the unused arguments lie between used arguments that are
1854 specified with @samp{$} operand number specifications, normally
1855 warnings are still given, since the implementation could not know what
1856 type to pass to @code{va_arg} to skip the unused arguments.  However,
1857 in the case of @code{scanf} formats, this option will suppress the
1858 warning if the unused arguments are all pointers, since the Single
1859 Unix Specification says that such unused arguments are allowed.
1860
1861 @item -Wformat-nonliteral
1862 @opindex Wformat-nonliteral
1863 If @option{-Wformat} is specified, also warn if the format string is not a
1864 string literal and so cannot be checked, unless the format function
1865 takes its format arguments as a @code{va_list}.
1866
1867 @item -Wformat-security
1868 @opindex Wformat-security
1869 If @option{-Wformat} is specified, also warn about uses of format
1870 functions that represent possible security problems.  At present, this
1871 warns about calls to @code{printf} and @code{scanf} functions where the
1872 format string is not a string literal and there are no format arguments,
1873 as in @code{printf (foo);}.  This may be a security hole if the format
1874 string came from untrusted input and contains @samp{%n}.  (This is
1875 currently a subset of what @option{-Wformat-nonliteral} warns about, but
1876 in future warnings may be added to @option{-Wformat-security} that are not
1877 included in @option{-Wformat-nonliteral}.)
1878
1879 @item -Wformat=2
1880 @opindex Wformat=2
1881 Enable @option{-Wformat} plus format checks not included in
1882 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
1883 -Wformat-nonliteral -Wformat-security}.
1884
1885 @item -Wimplicit-int
1886 @opindex Wimplicit-int
1887 Warn when a declaration does not specify a type.
1888
1889 @item -Wimplicit-function-declaration
1890 @itemx -Werror-implicit-function-declaration
1891 @opindex Wimplicit-function-declaration
1892 @opindex Werror-implicit-function-declaration
1893 Give a warning (or error) whenever a function is used before being
1894 declared.
1895
1896 @item -Wimplicit
1897 @opindex Wimplicit
1898 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
1899
1900 @item -Wmain
1901 @opindex Wmain
1902 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
1903 function with external linkage, returning int, taking either zero
1904 arguments, two, or three arguments of appropriate types.
1905
1906 @item -Wmissing-braces
1907 @opindex Wmissing-braces
1908 Warn if an aggregate or union initializer is not fully bracketed.  In
1909 the following example, the initializer for @samp{a} is not fully
1910 bracketed, but that for @samp{b} is fully bracketed.
1911
1912 @smallexample
1913 int a[2][2] = @{ 0, 1, 2, 3 @};
1914 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
1915 @end smallexample
1916
1917 @item -Wparentheses
1918 @opindex Wparentheses
1919 Warn if parentheses are omitted in certain contexts, such
1920 as when there is an assignment in a context where a truth value
1921 is expected, or when operators are nested whose precedence people
1922 often get confused about.
1923
1924 Also warn about constructions where there may be confusion to which
1925 @code{if} statement an @code{else} branch belongs.  Here is an example of
1926 such a case:
1927
1928 @smallexample
1929 @group
1930 @{
1931   if (a)
1932     if (b)
1933       foo ();
1934   else
1935     bar ();
1936 @}
1937 @end group
1938 @end smallexample
1939
1940 In C, every @code{else} branch belongs to the innermost possible @code{if}
1941 statement, which in this example is @code{if (b)}.  This is often not
1942 what the programmer expected, as illustrated in the above example by
1943 indentation the programmer chose.  When there is the potential for this
1944 confusion, GCC will issue a warning when this flag is specified.
1945 To eliminate the warning, add explicit braces around the innermost
1946 @code{if} statement so there is no way the @code{else} could belong to
1947 the enclosing @code{if}.  The resulting code would look like this:
1948
1949 @smallexample
1950 @group
1951 @{
1952   if (a)
1953     @{
1954       if (b)
1955         foo ();
1956       else
1957         bar ();
1958     @}
1959 @}
1960 @end group
1961 @end smallexample
1962
1963 @item -Wsequence-point
1964 @opindex Wsequence-point
1965 Warn about code that may have undefined semantics because of violations
1966 of sequence point rules in the C standard.
1967
1968 The C standard defines the order in which expressions in a C program are
1969 evaluated in terms of @dfn{sequence points}, which represent a partial
1970 ordering between the execution of parts of the program: those executed
1971 before the sequence point, and those executed after it.  These occur
1972 after the evaluation of a full expression (one which is not part of a
1973 larger expression), after the evaluation of the first operand of a
1974 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
1975 function is called (but after the evaluation of its arguments and the
1976 expression denoting the called function), and in certain other places.
1977 Other than as expressed by the sequence point rules, the order of
1978 evaluation of subexpressions of an expression is not specified.  All
1979 these rules describe only a partial order rather than a total order,
1980 since, for example, if two functions are called within one expression
1981 with no sequence point between them, the order in which the functions
1982 are called is not specified.  However, the standards committee have
1983 ruled that function calls do not overlap.
1984
1985 It is not specified when between sequence points modifications to the
1986 values of objects take effect.  Programs whose behavior depends on this
1987 have undefined behavior; the C standard specifies that ``Between the
1988 previous and next sequence point an object shall have its stored value
1989 modified at most once by the evaluation of an expression.  Furthermore,
1990 the prior value shall be read only to determine the value to be
1991 stored.''.  If a program breaks these rules, the results on any
1992 particular implementation are entirely unpredictable.
1993
1994 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
1995 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
1996 diagnosed by this option, and it may give an occasional false positive
1997 result, but in general it has been found fairly effective at detecting
1998 this sort of problem in programs.
1999
2000 The present implementation of this option only works for C programs.  A
2001 future implementation may also work for C++ programs.
2002
2003 The C standard is worded confusingly, therefore there is some debate
2004 over the precise meaning of the sequence point rules in subtle cases.
2005 Links to discussions of the problem, including proposed formal
2006 definitions, may be found on our readings page, at
2007 @w{@uref{http://gcc.gnu.org/readings.html}}.
2008
2009 @item -Wreturn-type
2010 @opindex Wreturn-type
2011 Warn whenever a function is defined with a return-type that defaults to
2012 @code{int}.  Also warn about any @code{return} statement with no
2013 return-value in a function whose return-type is not @code{void}.
2014
2015 For C++, a function without return type always produces a diagnostic
2016 message, even when @option{-Wno-return-type} is specified.  The only
2017 exceptions are @samp{main} and functions defined in system headers.
2018
2019 @item -Wswitch
2020 @opindex Wswitch
2021 Warn whenever a @code{switch} statement has an index of enumeral type
2022 and lacks a @code{case} for one or more of the named codes of that
2023 enumeration.  (The presence of a @code{default} label prevents this
2024 warning.)  @code{case} labels outside the enumeration range also
2025 provoke warnings when this option is used.
2026
2027 @item -Wtrigraphs
2028 @opindex Wtrigraphs
2029 Warn if any trigraphs are encountered that might change the meaning of
2030 the program (trigraphs within comments are not warned about).
2031
2032 @item -Wunused-function
2033 @opindex Wunused-function
2034 Warn whenever a static function is declared but not defined or a
2035 non\-inline static function is unused.
2036
2037 @item -Wunused-label
2038 @opindex Wunused-label
2039 Warn whenever a label is declared but not used.
2040
2041 To suppress this warning use the @samp{unused} attribute
2042 (@pxref{Variable Attributes}).
2043
2044 @item -Wunused-parameter
2045 @opindex Wunused-parameter
2046 Warn whenever a function parameter is unused aside from its declaration.
2047
2048 To suppress this warning use the @samp{unused} attribute
2049 (@pxref{Variable Attributes}).
2050
2051 @item -Wunused-variable
2052 @opindex Wunused-variable
2053 Warn whenever a local variable or non-constant static variable is unused
2054 aside from its declaration
2055
2056 To suppress this warning use the @samp{unused} attribute
2057 (@pxref{Variable Attributes}).
2058
2059 @item -Wunused-value
2060 @opindex Wunused-value
2061 Warn whenever a statement computes a result that is explicitly not used.
2062
2063 To suppress this warning cast the expression to @samp{void}.
2064
2065 @item -Wunused
2066 @opindex Wunused
2067 All all the above @option{-Wunused} options combined.
2068
2069 In order to get a warning about an unused function parameter, you must
2070 either specify @samp{-W -Wunused} or separately specify
2071 @option{-Wunused-parameter}.
2072
2073 @item -Wuninitialized
2074 @opindex Wuninitialized
2075 Warn if an automatic variable is used without first being initialized or
2076 if a variable may be clobbered by a @code{setjmp} call.
2077
2078 These warnings are possible only in optimizing compilation,
2079 because they require data flow information that is computed only
2080 when optimizing.  If you don't specify @option{-O}, you simply won't
2081 get these warnings.
2082
2083 These warnings occur only for variables that are candidates for
2084 register allocation.  Therefore, they do not occur for a variable that
2085 is declared @code{volatile}, or whose address is taken, or whose size
2086 is other than 1, 2, 4 or 8 bytes.  Also, they do not occur for
2087 structures, unions or arrays, even when they are in registers.
2088
2089 Note that there may be no warning about a variable that is used only
2090 to compute a value that itself is never used, because such
2091 computations may be deleted by data flow analysis before the warnings
2092 are printed.
2093
2094 These warnings are made optional because GCC is not smart
2095 enough to see all the reasons why the code might be correct
2096 despite appearing to have an error.  Here is one example of how
2097 this can happen:
2098
2099 @smallexample
2100 @group
2101 @{
2102   int x;
2103   switch (y)
2104     @{
2105     case 1: x = 1;
2106       break;
2107     case 2: x = 4;
2108       break;
2109     case 3: x = 5;
2110     @}
2111   foo (x);
2112 @}
2113 @end group
2114 @end smallexample
2115
2116 @noindent
2117 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
2118 always initialized, but GCC doesn't know this.  Here is
2119 another common case:
2120
2121 @smallexample
2122 @{
2123   int save_y;
2124   if (change_y) save_y = y, y = new_y;
2125   @dots{}
2126   if (change_y) y = save_y;
2127 @}
2128 @end smallexample
2129
2130 @noindent
2131 This has no bug because @code{save_y} is used only if it is set.
2132
2133 @cindex @code{longjmp} warnings
2134 This option also warns when a non-volatile automatic variable might be
2135 changed by a call to @code{longjmp}.  These warnings as well are possible
2136 only in optimizing compilation.
2137
2138 The compiler sees only the calls to @code{setjmp}.  It cannot know
2139 where @code{longjmp} will be called; in fact, a signal handler could
2140 call it at any point in the code.  As a result, you may get a warning
2141 even when there is in fact no problem because @code{longjmp} cannot
2142 in fact be called at the place which would cause a problem.
2143
2144 Some spurious warnings can be avoided if you declare all the functions
2145 you use that never return as @code{noreturn}.  @xref{Function
2146 Attributes}.
2147
2148 @item -Wreorder @r{(C++ only)}
2149 @opindex Wreorder
2150 @cindex reordering, warning
2151 @cindex warning for reordering of member initializers
2152 Warn when the order of member initializers given in the code does not
2153 match the order in which they must be executed.  For instance:
2154
2155 @item -Wunknown-pragmas
2156 @opindex Wunknown-pragmas
2157 @cindex warning for unknown pragmas
2158 @cindex unknown pragmas, warning
2159 @cindex pragmas, warning of unknown
2160 Warn when a #pragma directive is encountered which is not understood by
2161 GCC@.  If this command line option is used, warnings will even be issued
2162 for unknown pragmas in system header files.  This is not the case if
2163 the warnings were only enabled by the @option{-Wall} command line option.
2164
2165 @item -Wall
2166 @opindex Wall
2167 All of the above @samp{-W} options combined.  This enables all the
2168 warnings about constructions that some users consider questionable, and
2169 that are easy to avoid (or modify to prevent the warning), even in
2170 conjunction with macros.
2171
2172 @item -Wdiv-by-zero
2173 @opindex Wno-div-by-zero
2174 @opindex Wdiv-by-zero
2175 Warn about compile-time integer division by zero.  This is default.  To
2176 inhibit the warning messages, use @option{-Wno-div-by-zero}.  Floating
2177 point division by zero is not warned about, as it can be a legitimate
2178 way of obtaining infinities and NaNs.
2179
2180 @item -Wmultichar
2181 @opindex Wno-multichar
2182 @opindex Wmultichar
2183 Warn if a multicharacter constant (@samp{'FOOF'}) is used.  This is
2184 default.  To inhibit the warning messages, use @option{-Wno-multichar}.
2185 Usually they indicate a typo in the user's code, as they have
2186 implementation-defined values, and should not be used in portable code.
2187
2188 @item -Wsystem-headers
2189 @opindex Wsystem-headers
2190 @cindex warnings from system headers
2191 @cindex system headers, warnings from
2192 Print warning messages for constructs found in system header files.
2193 Warnings from system headers are normally suppressed, on the assumption
2194 that they usually do not indicate real problems and would only make the
2195 compiler output harder to read.  Using this command line option tells
2196 GCC to emit warnings from system headers as if they occurred in user
2197 code.  However, note that using @option{-Wall} in conjunction with this
2198 option will @emph{not} warn about unknown pragmas in system
2199 headers---for that, @option{-Wunknown-pragmas} must also be used.
2200 @end table
2201
2202 The following @option{-W@dots{}} options are not implied by @option{-Wall}.
2203 Some of them warn about constructions that users generally do not
2204 consider questionable, but which occasionally you might wish to check
2205 for; others warn about constructions that are necessary or hard to avoid
2206 in some cases, and there is no simple way to modify the code to suppress
2207 the warning.
2208
2209 @table @gcctabopt
2210 @item -W
2211 @opindex W
2212 Print extra warning messages for these events:
2213
2214 @itemize @bullet
2215 @item
2216 A function can return either with or without a value.  (Falling
2217 off the end of the function body is considered returning without
2218 a value.)  For example, this function would evoke such a
2219 warning:
2220
2221 @smallexample
2222 @group
2223 foo (a)
2224 @{
2225   if (a > 0)
2226     return a;
2227 @}
2228 @end group
2229 @end smallexample
2230
2231 @item
2232 An expression-statement or the left-hand side of a comma expression
2233 contains no side effects.
2234 To suppress the warning, cast the unused expression to void.
2235 For example, an expression such as @samp{x[i,j]} will cause a warning,
2236 but @samp{x[(void)i,j]} will not.
2237
2238 @item
2239 An unsigned value is compared against zero with @samp{<} or @samp{<=}.
2240
2241 @item
2242 A comparison like @samp{x<=y<=z} appears; this is equivalent to
2243 @samp{(x<=y ? 1 : 0) <= z}, which is a different interpretation from
2244 that of ordinary mathematical notation.
2245
2246 @item
2247 Storage-class specifiers like @code{static} are not the first things in
2248 a declaration.  According to the C Standard, this usage is obsolescent.
2249
2250 @item
2251 The return type of a function has a type qualifier such as @code{const}.
2252 Such a type qualifier has no effect, since the value returned by a
2253 function is not an lvalue.  (But don't warn about the GNU extension of
2254 @code{volatile void} return types.  That extension will be warned about
2255 if @option{-pedantic} is specified.)
2256
2257 @item
2258 If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
2259 arguments.
2260
2261 @item
2262 A comparison between signed and unsigned values could produce an
2263 incorrect result when the signed value is converted to unsigned.
2264 (But don't warn if @option{-Wno-sign-compare} is also specified.)
2265
2266 @item
2267 An aggregate has a partly bracketed initializer.
2268 For example, the following code would evoke such a warning,
2269 because braces are missing around the initializer for @code{x.h}:
2270
2271 @smallexample
2272 struct s @{ int f, g; @};
2273 struct t @{ struct s h; int i; @};
2274 struct t x = @{ 1, 2, 3 @};
2275 @end smallexample
2276
2277 @item
2278 An aggregate has an initializer which does not initialize all members.
2279 For example, the following code would cause such a warning, because
2280 @code{x.h} would be implicitly initialized to zero:
2281
2282 @smallexample
2283 struct s @{ int f, g, h; @};
2284 struct s x = @{ 3, 4 @};
2285 @end smallexample
2286 @end itemize
2287
2288 @item -Wfloat-equal
2289 @opindex Wfloat-equal
2290 Warn if floating point values are used in equality comparisons.
2291
2292 The idea behind this is that sometimes it is convenient (for the
2293 programmer) to consider floating-point values as approximations to
2294 infinitely precise real numbers.  If you are doing this, then you need
2295 to compute (by analysing the code, or in some other way) the maximum or
2296 likely maximum error that the computation introduces, and allow for it
2297 when performing comparisons (and when producing output, but that's a
2298 different problem).  In particular, instead of testing for equality, you
2299 would check to see whether the two values have ranges that overlap; and
2300 this is done with the relational operators, so equality comparisons are
2301 probably mistaken.
2302
2303 @item -Wtraditional @r{(C only)}
2304 @opindex Wtraditional
2305 Warn about certain constructs that behave differently in traditional and
2306 ISO C@.  Also warn about ISO C constructs that have no traditional C
2307 equivalent, and/or problematic constructs which should be avoided.
2308
2309 @itemize @bullet
2310 @item
2311 Macro parameters that appear within string literals in the macro body.
2312 In traditional C macro replacement takes place within string literals,
2313 but does not in ISO C@.
2314
2315 @item
2316 In traditional C, some preprocessor directives did not exist.
2317 Traditional preprocessors would only consider a line to be a directive
2318 if the @samp{#} appeared in column 1 on the line.  Therefore
2319 @option{-Wtraditional} warns about directives that traditional C
2320 understands but would ignore because the @samp{#} does not appear as the
2321 first character on the line.  It also suggests you hide directives like
2322 @samp{#pragma} not understood by traditional C by indenting them.  Some
2323 traditional implementations would not recognise @samp{#elif}, so it
2324 suggests avoiding it altogether.
2325
2326 @item
2327 A function-like macro that appears without arguments.
2328
2329 @item
2330 The unary plus operator.
2331
2332 @item
2333 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
2334 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
2335 constants.)  Note, these suffixes appear in macros defined in the system
2336 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
2337 Use of these macros in user code might normally lead to spurious
2338 warnings, however gcc's integrated preprocessor has enough context to
2339 avoid warning in these cases.
2340
2341 @item
2342 A function declared external in one block and then used after the end of
2343 the block.
2344
2345 @item
2346 A @code{switch} statement has an operand of type @code{long}.
2347
2348 @item
2349 A non-@code{static} function declaration follows a @code{static} one.
2350 This construct is not accepted by some traditional C compilers.
2351
2352 @item
2353 The ISO type of an integer constant has a different width or
2354 signedness from its traditional type.  This warning is only issued if
2355 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
2356 typically represent bit patterns, are not warned about.
2357
2358 @item
2359 Usage of ISO string concatenation is detected.
2360
2361 @item
2362 Initialization of automatic aggregates.
2363
2364 @item
2365 Identifier conflicts with labels.  Traditional C lacks a separate
2366 namespace for labels.
2367
2368 @item
2369 Initialization of unions.  If the initializer is zero, the warning is
2370 omitted.  This is done under the assumption that the zero initializer in
2371 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
2372 initializer warnings and relies on default initialization to zero in the
2373 traditional C case.
2374
2375 @item
2376 Conversions by prototypes between fixed/floating point values and vice
2377 versa.  The absence of these prototypes when compiling with traditional
2378 C would cause serious problems.  This is a subset of the possible
2379 conversion warnings, for the full set use @option{-Wconversion}.
2380 @end itemize
2381
2382 @item -Wundef
2383 @opindex Wundef
2384 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
2385
2386 @item -Wshadow
2387 @opindex Wshadow
2388 Warn whenever a local variable shadows another local variable, parameter or
2389 global variable or whenever a built-in function is shadowed.
2390
2391 @item -Wlarger-than-@var{len}
2392 @opindex Wlarger-than
2393 Warn whenever an object of larger than @var{len} bytes is defined.
2394
2395 @item -Wpointer-arith
2396 @opindex Wpointer-arith
2397 Warn about anything that depends on the ``size of'' a function type or
2398 of @code{void}.  GNU C assigns these types a size of 1, for
2399 convenience in calculations with @code{void *} pointers and pointers
2400 to functions.
2401
2402 @item -Wbad-function-cast @r{(C only)}
2403 @opindex Wbad-function-cast
2404 Warn whenever a function call is cast to a non-matching type.
2405 For example, warn if @code{int malloc()} is cast to @code{anything *}.
2406
2407 @item -Wcast-qual
2408 @opindex Wcast-qual
2409 Warn whenever a pointer is cast so as to remove a type qualifier from
2410 the target type.  For example, warn if a @code{const char *} is cast
2411 to an ordinary @code{char *}.
2412
2413 @item -Wcast-align
2414 @opindex Wcast-align
2415 Warn whenever a pointer is cast such that the required alignment of the
2416 target is increased.  For example, warn if a @code{char *} is cast to
2417 an @code{int *} on machines where integers can only be accessed at
2418 two- or four-byte boundaries.
2419
2420 @item -Wwrite-strings
2421 @opindex Wwrite-strings
2422 When compiling C, give string constants the type @code{const
2423 char[@var{length}]} so that
2424 copying the address of one into a non-@code{const} @code{char *}
2425 pointer will get a warning; when compiling C++, warn about the
2426 deprecated conversion from string constants to @code{char *}.
2427 These warnings will help you find at
2428 compile time code that can try to write into a string constant, but
2429 only if you have been very careful about using @code{const} in
2430 declarations and prototypes.  Otherwise, it will just be a nuisance;
2431 this is why we did not make @option{-Wall} request these warnings.
2432
2433 @item -Wconversion
2434 @opindex Wconversion
2435 Warn if a prototype causes a type conversion that is different from what
2436 would happen to the same argument in the absence of a prototype.  This
2437 includes conversions of fixed point to floating and vice versa, and
2438 conversions changing the width or signedness of a fixed point argument
2439 except when the same as the default promotion.
2440
2441 Also, warn if a negative integer constant expression is implicitly
2442 converted to an unsigned type.  For example, warn about the assignment
2443 @code{x = -1} if @code{x} is unsigned.  But do not warn about explicit
2444 casts like @code{(unsigned) -1}.
2445
2446 @item -Wsign-compare
2447 @opindex Wsign-compare
2448 @cindex warning for comparison of signed and unsigned values
2449 @cindex comparison of signed and unsigned values, warning
2450 @cindex signed and unsigned values, comparison warning
2451 Warn when a comparison between signed and unsigned values could produce
2452 an incorrect result when the signed value is converted to unsigned.
2453 This warning is also enabled by @option{-W}; to get the other warnings
2454 of @option{-W} without this warning, use @samp{-W -Wno-sign-compare}.
2455
2456 @item -Waggregate-return
2457 @opindex Waggregate-return
2458 Warn if any functions that return structures or unions are defined or
2459 called.  (In languages where you can return an array, this also elicits
2460 a warning.)
2461
2462 @item -Wstrict-prototypes @r{(C only)}
2463 @opindex Wstrict-prototypes
2464 Warn if a function is declared or defined without specifying the
2465 argument types.  (An old-style function definition is permitted without
2466 a warning if preceded by a declaration which specifies the argument
2467 types.)
2468
2469 @item -Wmissing-prototypes @r{(C only)}
2470 @opindex Wmissing-prototypes
2471 Warn if a global function is defined without a previous prototype
2472 declaration.  This warning is issued even if the definition itself
2473 provides a prototype.  The aim is to detect global functions that fail
2474 to be declared in header files.
2475
2476 @item -Wmissing-declarations
2477 @opindex Wmissing-declarations
2478 Warn if a global function is defined without a previous declaration.
2479 Do so even if the definition itself provides a prototype.
2480 Use this option to detect global functions that are not declared in
2481 header files.
2482
2483 @item -Wmissing-noreturn
2484 @opindex Wmissing-noreturn
2485 Warn about functions which might be candidates for attribute @code{noreturn}.
2486 Note these are only possible candidates, not absolute ones.  Care should
2487 be taken to manually verify functions actually do not ever return before
2488 adding the @code{noreturn} attribute, otherwise subtle code generation
2489 bugs could be introduced.  You will not get a warning for @code{main} in
2490 hosted C environments.
2491
2492 @item -Wmissing-format-attribute
2493 @opindex Wmissing-format-attribute
2494 @opindex Wformat
2495 If @option{-Wformat} is enabled, also warn about functions which might be
2496 candidates for @code{format} attributes.  Note these are only possible
2497 candidates, not absolute ones.  GCC will guess that @code{format}
2498 attributes might be appropriate for any function that calls a function
2499 like @code{vprintf} or @code{vscanf}, but this might not always be the
2500 case, and some functions for which @code{format} attributes are
2501 appropriate may not be detected.  This option has no effect unless
2502 @option{-Wformat} is enabled (possibly by @option{-Wall}).
2503
2504 @item -Wpacked
2505 @opindex Wpacked
2506 Warn if a structure is given the packed attribute, but the packed
2507 attribute has no effect on the layout or size of the structure.
2508 Such structures may be mis-aligned for little benefit.  For
2509 instance, in this code, the variable @code{f.x} in @code{struct bar}
2510 will be misaligned even though @code{struct bar} does not itself
2511 have the packed attribute:
2512
2513 @smallexample
2514 @group
2515 struct foo @{
2516   int x;
2517   char a, b, c, d;
2518 @} __attribute__((packed));
2519 struct bar @{
2520   char z;
2521   struct foo f;
2522 @};
2523 @end group
2524 @end smallexample
2525
2526 @item -Wpadded
2527 @opindex Wpadded
2528 Warn if padding is included in a structure, either to align an element
2529 of the structure or to align the whole structure.  Sometimes when this
2530 happens it is possible to rearrange the fields of the structure to
2531 reduce the padding and so make the structure smaller.
2532
2533 @item -Wredundant-decls
2534 @opindex Wredundant-decls
2535 Warn if anything is declared more than once in the same scope, even in
2536 cases where multiple declaration is valid and changes nothing.
2537
2538 @item -Wnested-externs @r{(C only)}
2539 @opindex Wnested-externs
2540 Warn if an @code{extern} declaration is encountered within a function.
2541
2542 @item -Wunreachable-code
2543 @opindex Wunreachable-code
2544 Warn if the compiler detects that code will never be executed.
2545
2546 This option is intended to warn when the compiler detects that at
2547 least a whole line of source code will never be executed, because
2548 some condition is never satisfied or because it is after a
2549 procedure that never returns.
2550
2551 It is possible for this option to produce a warning even though there
2552 are circumstances under which part of the affected line can be executed,
2553 so care should be taken when removing apparently-unreachable code.
2554
2555 For instance, when a function is inlined, a warning may mean that the
2556 line is unreachable in only one inlined copy of the function.
2557
2558 This option is not made part of @option{-Wall} because in a debugging
2559 version of a program there is often substantial code which checks
2560 correct functioning of the program and is, hopefully, unreachable
2561 because the program does work.  Another common use of unreachable
2562 code is to provide behaviour which is selectable at compile-time.
2563
2564 @item -Winline
2565 @opindex Winline
2566 Warn if a function can not be inlined and it was declared as inline.
2567
2568 @item -Wlong-long
2569 @opindex Wlong-long
2570 @opindex Wno-long-long
2571 Warn if @samp{long long} type is used.  This is default.  To inhibit
2572 the warning messages, use @option{-Wno-long-long}.  Flags
2573 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
2574 only when @option{-pedantic} flag is used.
2575
2576 @item -Wdisabled-optimization
2577 @opindex Wdisabled-optimization
2578 Warn if a requested optimization pass is disabled.  This warning does
2579 not generally indicate that there is anything wrong with your code; it
2580 merely indicates that GCC's optimizers were unable to handle the code
2581 effectively.  Often, the problem is that your code is too big or too
2582 complex; GCC will refuse to optimize programs when the optimization
2583 itself is likely to take inordinate amounts of time.
2584
2585 @item -Werror
2586 @opindex Werror
2587 Make all warnings into errors.
2588 @end table
2589
2590 @node Debugging Options
2591 @section Options for Debugging Your Program or GCC
2592 @cindex options, debugging
2593 @cindex debugging information options
2594
2595 GCC has various special options that are used for debugging
2596 either your program or GCC:
2597
2598 @table @gcctabopt
2599 @item -g
2600 @opindex g
2601 Produce debugging information in the operating system's native format
2602 (stabs, COFF, XCOFF, or DWARF)@.  GDB can work with this debugging
2603 information.
2604
2605 On most systems that use stabs format, @option{-g} enables use of extra
2606 debugging information that only GDB can use; this extra information
2607 makes debugging work better in GDB but will probably make other debuggers
2608 crash or
2609 refuse to read the program.  If you want to control for certain whether
2610 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
2611 @option{-gxcoff+}, @option{-gxcoff}, @option{-gdwarf-1+}, @option{-gdwarf-1},
2612 or @option{-gvms} (see below).
2613
2614 Unlike most other C compilers, GCC allows you to use @option{-g} with
2615 @option{-O}.  The shortcuts taken by optimized code may occasionally
2616 produce surprising results: some variables you declared may not exist
2617 at all; flow of control may briefly move where you did not expect it;
2618 some statements may not be executed because they compute constant
2619 results or their values were already at hand; some statements may
2620 execute in different places because they were moved out of loops.
2621
2622 Nevertheless it proves possible to debug optimized output.  This makes
2623 it reasonable to use the optimizer for programs that might have bugs.
2624
2625 The following options are useful when GCC is generated with the
2626 capability for more than one debugging format.
2627
2628 @item -ggdb
2629 @opindex ggdb
2630 Produce debugging information for use by GDB@.  This means to use the
2631 most expressive format available (DWARF 2, stabs, or the native format
2632 if neither of those are supported), including GDB extensions if at all
2633 possible.
2634
2635 @item -gstabs
2636 @opindex gstabs
2637 Produce debugging information in stabs format (if that is supported),
2638 without GDB extensions.  This is the format used by DBX on most BSD
2639 systems.  On MIPS, Alpha and System V Release 4 systems this option
2640 produces stabs debugging output which is not understood by DBX or SDB@.
2641 On System V Release 4 systems this option requires the GNU assembler.
2642
2643 @item -gstabs+
2644 @opindex gstabs+
2645 Produce debugging information in stabs format (if that is supported),
2646 using GNU extensions understood only by the GNU debugger (GDB)@.  The
2647 use of these extensions is likely to make other debuggers crash or
2648 refuse to read the program.
2649
2650 @item -gcoff
2651 @opindex gcoff
2652 Produce debugging information in COFF format (if that is supported).
2653 This is the format used by SDB on most System V systems prior to
2654 System V Release 4.
2655
2656 @item -gxcoff
2657 @opindex gxcoff
2658 Produce debugging information in XCOFF format (if that is supported).
2659 This is the format used by the DBX debugger on IBM RS/6000 systems.
2660
2661 @item -gxcoff+
2662 @opindex gxcoff+
2663 Produce debugging information in XCOFF format (if that is supported),
2664 using GNU extensions understood only by the GNU debugger (GDB)@.  The
2665 use of these extensions is likely to make other debuggers crash or
2666 refuse to read the program, and may cause assemblers other than the GNU
2667 assembler (GAS) to fail with an error.
2668
2669 @item -gdwarf
2670 @opindex gdwarf
2671 Produce debugging information in DWARF version 1 format (if that is
2672 supported).  This is the format used by SDB on most System V Release 4
2673 systems.
2674
2675 @item -gdwarf+
2676 @opindex gdwarf+
2677 Produce debugging information in DWARF version 1 format (if that is
2678 supported), using GNU extensions understood only by the GNU debugger
2679 (GDB)@.  The use of these extensions is likely to make other debuggers
2680 crash or refuse to read the program.
2681
2682 @item -gdwarf-2
2683 @opindex gdwarf-2
2684 Produce debugging information in DWARF version 2 format (if that is
2685 supported).  This is the format used by DBX on IRIX 6.
2686
2687 @item -gvms
2688 @opindex gvms
2689 Produce debugging information in VMS debug format (if that is
2690 supported).  This is the format used by DEBUG on VMS systems.
2691
2692 @item -g@var{level}
2693 @itemx -ggdb@var{level}
2694 @itemx -gstabs@var{level}
2695 @itemx -gcoff@var{level}
2696 @itemx -gxcoff@var{level}
2697 @itemx -gdwarf@var{level}
2698 @itemx -gdwarf-2@var{level}
2699 @itemx -gvms@var{level}
2700 Request debugging information and also use @var{level} to specify how
2701 much information.  The default level is 2.
2702
2703 Level 1 produces minimal information, enough for making backtraces in
2704 parts of the program that you don't plan to debug.  This includes
2705 descriptions of functions and external variables, but no information
2706 about local variables and no line numbers.
2707
2708 Level 3 includes extra information, such as all the macro definitions
2709 present in the program.  Some debuggers support macro expansion when
2710 you use @option{-g3}.
2711
2712 @cindex @code{prof}
2713 @item -p
2714 @opindex p
2715 Generate extra code to write profile information suitable for the
2716 analysis program @code{prof}.  You must use this option when compiling
2717 the source files you want data about, and you must also use it when
2718 linking.
2719
2720 @cindex @code{gprof}
2721 @item -pg
2722 @opindex pg
2723 Generate extra code to write profile information suitable for the
2724 analysis program @code{gprof}.  You must use this option when compiling
2725 the source files you want data about, and you must also use it when
2726 linking.
2727
2728 @cindex @code{tcov}
2729 @item -a
2730 @opindex a
2731 Generate extra code to write profile information for basic blocks, which will
2732 record the number of times each basic block is executed, the basic block start
2733 address, and the function name containing the basic block.  If @option{-g} is
2734 used, the line number and filename of the start of the basic block will also be
2735 recorded.  If not overridden by the machine description, the default action is
2736 to append to the text file @file{bb.out}.
2737
2738 This data could be analyzed by a program like @code{tcov}.  Note,
2739 however, that the format of the data is not what @code{tcov} expects.
2740 Eventually GNU @code{gprof} should be extended to process this data.
2741
2742 @item -Q
2743 @opindex Q
2744 Makes the compiler print out each function name as it is compiled, and
2745 print some statistics about each pass when it finishes.
2746
2747 @item -ftime-report
2748 @opindex ftime-report
2749 Makes the compiler print some statistics about the time consumed by each
2750 pass when it finishes.
2751
2752 @item -fmem-report
2753 @opindex fmem-report
2754 Makes the compiler print some statistics about permanent memory
2755 allocation when it finishes.
2756
2757 @item -ax
2758 @opindex ax
2759 Generate extra code to profile basic blocks.  Your executable will
2760 produce output that is a superset of that produced when @option{-a} is
2761 used.  Additional output is the source and target address of the basic
2762 blocks where a jump takes place, the number of times a jump is executed,
2763 and (optionally) the complete sequence of basic blocks being executed.
2764 The output is appended to file @file{bb.out}.
2765
2766 You can examine different profiling aspects without recompilation.  Your
2767 executable will read a list of function names from file @file{bb.in}.
2768 Profiling starts when a function on the list is entered and stops when
2769 that invocation is exited.  To exclude a function from profiling, prefix
2770 its name with @samp{-}.  If a function name is not unique, you can
2771 disambiguate it by writing it in the form
2772 @samp{/path/filename.d:functionname}.  Your executable will write the
2773 available paths and filenames in file @file{bb.out}.
2774
2775 Several function names have a special meaning:
2776 @table @code
2777 @item __bb_jumps__
2778 Write source, target and frequency of jumps to file @file{bb.out}.
2779 @item __bb_hidecall__
2780 Exclude function calls from frequency count.
2781 @item __bb_showret__
2782 Include function returns in frequency count.
2783 @item __bb_trace__
2784 Write the sequence of basic blocks executed to file @file{bbtrace.gz}.
2785 The file will be compressed using the program @samp{gzip}, which must
2786 exist in your @env{PATH}.  On systems without the @samp{popen}
2787 function, the file will be named @file{bbtrace} and will not be
2788 compressed.  @strong{Profiling for even a few seconds on these systems
2789 will produce a very large file.}  Note: @code{__bb_hidecall__} and
2790 @code{__bb_showret__} will not affect the sequence written to
2791 @file{bbtrace.gz}.
2792 @end table
2793
2794 Here's a short example using different profiling parameters
2795 in file @file{bb.in}.  Assume function @code{foo} consists of basic blocks
2796 1 and 2 and is called twice from block 3 of function @code{main}.  After
2797 the calls, block 3 transfers control to block 4 of @code{main}.
2798
2799 With @code{__bb_trace__} and @code{main} contained in file @file{bb.in},
2800 the following sequence of blocks is written to file @file{bbtrace.gz}:
2801 0 3 1 2 1 2 4.  The return from block 2 to block 3 is not shown, because
2802 the return is to a point inside the block and not to the top.  The
2803 block address 0 always indicates, that control is transferred
2804 to the trace from somewhere outside the observed functions.  With
2805 @samp{-foo} added to @file{bb.in}, the blocks of function
2806 @code{foo} are removed from the trace, so only 0 3 4 remains.
2807
2808 With @code{__bb_jumps__} and @code{main} contained in file @file{bb.in},
2809 jump frequencies will be written to file @file{bb.out}.  The
2810 frequencies are obtained by constructing a trace of blocks
2811 and incrementing a counter for every neighbouring pair of blocks
2812 in the trace.  The trace 0 3 1 2 1 2 4 displays the following
2813 frequencies:
2814
2815 @example
2816 Jump from block 0x0 to block 0x3 executed 1 time(s)
2817 Jump from block 0x3 to block 0x1 executed 1 time(s)
2818 Jump from block 0x1 to block 0x2 executed 2 time(s)
2819 Jump from block 0x2 to block 0x1 executed 1 time(s)
2820 Jump from block 0x2 to block 0x4 executed 1 time(s)
2821 @end example
2822
2823 With @code{__bb_hidecall__}, control transfer due to call instructions
2824 is removed from the trace, that is the trace is cut into three parts: 0
2825 3 4, 0 1 2 and 0 1 2.  With @code{__bb_showret__}, control transfer due
2826 to return instructions is added to the trace.  The trace becomes: 0 3 1
2827 2 3 1 2 3 4.  Note, that this trace is not the same, as the sequence
2828 written to @file{bbtrace.gz}.  It is solely used for counting jump
2829 frequencies.
2830
2831 @item -fprofile-arcs
2832 @opindex fprofile-arcs
2833 Instrument @dfn{arcs} during compilation to generate coverage data
2834 or for profile-directed block ordering.  During execution the program
2835 records how many times each branch is executed and how many times it is
2836 taken.  When the compiled program exits it saves this data to a file
2837 called @file{@var{sourcename}.da} for each source file.
2838
2839 For profile-directed block ordering, compile the program with
2840 @option{-fprofile-arcs} plus optimization and code generation options,
2841 generate the arc profile information by running the program on a
2842 selected workload, and then compile the program again with the same
2843 optimization and code generation options plus
2844 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
2845 Control Optimization}).
2846
2847 The other use of @option{-fprofile-arcs} is for use with @code{gcov},
2848 when it is used with the @option{-ftest-coverage} option.  GCC
2849 supports two methods of determining code coverage: the options that
2850 support @code{gcov}, and options @option{-a} and @option{-ax}, which
2851 write information to text files.  The options that support @code{gcov}
2852 do not need to instrument every arc in the program, so a program compiled
2853 with them runs faster than a program compiled with @option{-a}, which
2854 adds instrumentation code to every basic block in the program.  The
2855 tradeoff: since @code{gcov} does not have execution counts for all
2856 branches, it must start with the execution counts for the instrumented
2857 branches, and then iterate over the program flow graph until the entire
2858 graph has been solved.  Hence, @code{gcov} runs a little more slowly than
2859 a program which uses information from @option{-a} and @option{-ax}.
2860
2861 With @option{-fprofile-arcs}, for each function of your program GCC
2862 creates a program flow graph, then finds a spanning tree for the graph.
2863 Only arcs that are not on the spanning tree have to be instrumented: the
2864 compiler adds code to count the number of times that these arcs are
2865 executed.  When an arc is the only exit or only entrance to a block, the
2866 instrumentation code can be added to the block; otherwise, a new basic
2867 block must be created to hold the instrumentation code.
2868
2869 This option makes it possible to estimate branch probabilities and to
2870 calculate basic block execution counts.  In general, basic block
2871 execution counts as provided by @option{-a} do not give enough
2872 information to estimate all branch probabilities.
2873
2874 @need 2000
2875 @item -ftest-coverage
2876 @opindex ftest-coverage
2877 Create data files for the @code{gcov} code-coverage utility
2878 (@pxref{Gcov,, @code{gcov}: a GCC Test Coverage Program}).
2879 The data file names begin with the name of your source file:
2880
2881 @table @gcctabopt
2882 @item @var{sourcename}.bb
2883 A mapping from basic blocks to line numbers, which @code{gcov} uses to
2884 associate basic block execution counts with line numbers.
2885
2886 @item @var{sourcename}.bbg
2887 A list of all arcs in the program flow graph.  This allows @code{gcov}
2888 to reconstruct the program flow graph, so that it can compute all basic
2889 block and arc execution counts from the information in the
2890 @code{@var{sourcename}.da} file.
2891 @end table
2892
2893 Use @option{-ftest-coverage} with @option{-fprofile-arcs}; the latter
2894 option adds instrumentation to the program, which then writes
2895 execution counts to another data file:
2896
2897 @table @gcctabopt
2898 @item @var{sourcename}.da
2899 Runtime arc execution counts, used in conjunction with the arc
2900 information in the file @code{@var{sourcename}.bbg}.
2901 @end table
2902
2903 Coverage data will map better to the source files if
2904 @option{-ftest-coverage} is used without optimization.
2905
2906 @item -d@var{letters}
2907 @opindex d
2908 Says to make debugging dumps during compilation at times specified by
2909 @var{letters}.  This is used for debugging the compiler.  The file names
2910 for most of the dumps are made by appending a pass number and a word to
2911 the source file name (e.g.  @file{foo.c.00.rtl} or @file{foo.c.01.sibling}).
2912 Here are the possible letters for use in @var{letters}, and their meanings:
2913
2914 @table @samp
2915 @item A
2916 @opindex dA
2917 Annotate the assembler output with miscellaneous debugging information.
2918 @item b
2919 @opindex db
2920 Dump after computing branch probabilities, to @file{@var{file}.14.bp}.
2921 @item B
2922 @opindex dB
2923 Dump after block reordering, to @file{@var{file}.28.bbro}.
2924 @item c
2925 @opindex dc
2926 Dump after instruction combination, to the file @file{@var{file}.16.combine}.
2927 @item C
2928 @opindex dC
2929 Dump after the first if conversion, to the file @file{@var{file}.17.ce}.
2930 @item d
2931 @opindex dd
2932 Dump after delayed branch scheduling, to @file{@var{file}.31.dbr}.
2933 @item D
2934 @opindex dD
2935 Dump all macro definitions, at the end of preprocessing, in addition to
2936 normal output.
2937 @item e
2938 @opindex de
2939 Dump after SSA optimizations, to @file{@var{file}.04.ssa} and
2940 @file{@var{file}.07.ussa}.
2941 @item E
2942 @opindex dE
2943 Dump after the second if conversion, to @file{@var{file}.26.ce2}.
2944 @item f
2945 @opindex df
2946 Dump after life analysis, to @file{@var{file}.15.life}.
2947 @item F
2948 @opindex dF
2949 Dump after purging @code{ADDRESSOF} codes, to @file{@var{file}.09.addressof}.
2950 @item g
2951 @opindex dg
2952 Dump after global register allocation, to @file{@var{file}.21.greg}.
2953 @item h
2954 @opindex dh
2955 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
2956 @item o
2957 @opindex do
2958 Dump after post-reload optimizations, to @file{@var{file}.22.postreload}.
2959 @item G
2960 @opindex dG
2961 Dump after GCSE, to @file{@var{file}.10.gcse}.
2962 @item i
2963 @opindex di
2964 Dump after sibling call optimizations, to @file{@var{file}.01.sibling}.
2965 @item j
2966 @opindex dj
2967 Dump after the first jump optimization, to @file{@var{file}.03.jump}.
2968 @item k
2969 @opindex dk
2970 Dump after conversion from registers to stack, to @file{@var{file}.32.stack}.
2971 @item l
2972 @opindex dl
2973 Dump after local register allocation, to @file{@var{file}.20.lreg}.
2974 @item L
2975 @opindex dL
2976 Dump after loop optimization, to @file{@var{file}.11.loop}.
2977 @item M
2978 @opindex dM
2979 Dump after performing the machine dependent reorganisation pass, to
2980 @file{@var{file}.30.mach}.
2981 @item n
2982 @opindex dn
2983 Dump after register renumbering, to @file{@var{file}.25.rnreg}.
2984 @item N
2985 @opindex dN
2986 Dump after the register move pass, to @file{@var{file}.18.regmove}.
2987 @item r
2988 @opindex dr
2989 Dump after RTL generation, to @file{@var{file}.00.rtl}.
2990 @item R
2991 @opindex dR
2992 Dump after the second scheduling pass, to @file{@var{file}.27.sched2}.
2993 @item s
2994 @opindex ds
2995 Dump after CSE (including the jump optimization that sometimes follows
2996 CSE), to @file{@var{file}.08.cse}.
2997 @item S
2998 @opindex dS
2999 Dump after the first scheduling pass, to @file{@var{file}.19.sched}.
3000 @item t
3001 @opindex dt
3002 Dump after the second CSE pass (including the jump optimization that
3003 sometimes follows CSE), to @file{@var{file}.12.cse2}.
3004 @item w
3005 @opindex dw
3006 Dump after the second flow pass, to @file{@var{file}.23.flow2}.
3007 @item X
3008 @opindex dX
3009 Dump after SSA dead code elimination, to @file{@var{file}.06.ssadce}.
3010 @item z
3011 @opindex dz
3012 Dump after the peephole pass, to @file{@var{file}.24.peephole2}.
3013 @item a
3014 @opindex da
3015 Produce all the dumps listed above.
3016 @item m
3017 @opindex dm
3018 Print statistics on memory usage, at the end of the run, to
3019 standard error.
3020 @item p
3021 @opindex dp
3022 Annotate the assembler output with a comment indicating which
3023 pattern and alternative was used.  The length of each instruction is
3024 also printed.
3025 @item P
3026 @opindex dP
3027 Dump the RTL in the assembler output as a comment before each instruction.
3028 Also turns on @option{-dp} annotation.
3029 @item v
3030 @opindex dv
3031 For each of the other indicated dump files (except for
3032 @file{@var{file}.00.rtl}), dump a representation of the control flow graph
3033 suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
3034 @item x
3035 @opindex dx
3036 Just generate RTL for a function instead of compiling it.  Usually used
3037 with @samp{r}.
3038 @item y
3039 @opindex dy
3040 Dump debugging information during parsing, to standard error.
3041 @end table
3042
3043 @item -fdump-unnumbered
3044 @opindex fdump-unnumbered
3045 When doing debugging dumps (see @option{-d} option above), suppress instruction
3046 numbers and line number note output.  This makes it more feasible to
3047 use diff on debugging dumps for compiler invocations with different
3048 options, in particular with and without @option{-g}.
3049
3050 @item -fdump-class-hierarchy @r{(C++ only)}
3051 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
3052 @opindex fdump-class-hierarchy
3053 Dump a representation of each class's hierarchy and virtual function
3054 table layout to a file.  The file name is made by appending @file{.class}
3055 to the source file name.  If the @samp{-@var{options}} form is used,
3056 @var{options} controls the details of the dump as described for the
3057 @option{-fdump-tree} options.
3058
3059 @item -fdump-tree-@var{switch} @r{(C++ only)}
3060 @itemx -fdump-tree-@var{switch}-@var{options} @r{(C++ only)}
3061 @opindex fdump-tree
3062 Control the dumping at various stages of processing the intermediate
3063 language tree to a file.  The file name is generated by appending a switch
3064 specific suffix to the source file name.  If the @samp{-@var{options}}
3065 form is used, @var{options} is a list of @samp{-} separated options that
3066 control the details of the dump. Not all options are applicable to all
3067 dumps, those which are not meaningful will be ignored. The following
3068 options are available
3069
3070 @table @samp
3071 @item address
3072 Print the address of each node.  Usually this is not meaningful as it
3073 changes according to the environment and source file. Its primary use
3074 is for tying up a dump file with a debug environment.
3075 @item slim
3076 Inhibit dumping of members of a scope or body of a function merely
3077 because that scope has been reached. Only dump such items when they
3078 are directly reachable by some other path.
3079 @item all
3080 Turn on all options.
3081 @end table
3082
3083 The following tree dumps are possible:
3084 @table @samp
3085 @item original
3086 Dump before any tree based optimization, to @file{@var{file}.original}.
3087 @item optimized
3088 Dump after all tree based optimization, to @file{@var{file}.optimized}.
3089 @item inlined
3090 Dump after function inlining, to @file{@var{file}.inlined}.
3091 @end table
3092
3093 @item -fpretend-float
3094 @opindex fpretend-float
3095 When running a cross-compiler, pretend that the target machine uses the
3096 same floating point format as the host machine.  This causes incorrect
3097 output of the actual floating constants, but the actual instruction
3098 sequence will probably be the same as GCC would make when running on
3099 the target machine.
3100
3101 @item -save-temps
3102 @opindex save-temps
3103 Store the usual ``temporary'' intermediate files permanently; place them
3104 in the current directory and name them based on the source file.  Thus,
3105 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
3106 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
3107 preprocessed @file{foo.i} output file even though the compiler now
3108 normally uses an integrated preprocessor.
3109
3110 @item -time
3111 @opindex time
3112 Report the CPU time taken by each subprocess in the compilation
3113 sequence.  For C source files, this is the compiler proper and assembler
3114 (plus the linker if linking is done).  The output looks like this:
3115
3116 @smallexample
3117 # cc1 0.12 0.01
3118 # as 0.00 0.01
3119 @end smallexample
3120
3121 The first number on each line is the ``user time,'' that is time spent
3122 executing the program itself.  The second number is ``system time,''
3123 time spent executing operating system routines on behalf of the program.
3124 Both numbers are in seconds.
3125
3126 @item -print-file-name=@var{library}
3127 @opindex print-file-name
3128 Print the full absolute name of the library file @var{library} that
3129 would be used when linking---and don't do anything else.  With this
3130 option, GCC does not compile or link anything; it just prints the
3131 file name.
3132
3133 @item -print-multi-directory
3134 @opindex print-multi-directory
3135 Print the directory name corresponding to the multilib selected by any
3136 other switches present in the command line.  This directory is supposed
3137 to exist in @env{GCC_EXEC_PREFIX}.
3138
3139 @item -print-multi-lib
3140 @opindex print-multi-lib
3141 Print the mapping from multilib directory names to compiler switches
3142 that enable them.  The directory name is separated from the switches by
3143 @samp{;}, and each switch starts with an @samp{@@} instead of the
3144 @samp{-}, without spaces between multiple switches.  This is supposed to
3145 ease shell-processing.
3146
3147 @item -print-prog-name=@var{program}
3148 @opindex print-prog-name
3149 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
3150
3151 @item -print-libgcc-file-name
3152 @opindex print-libgcc-file-name
3153 Same as @option{-print-file-name=libgcc.a}.
3154
3155 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
3156 but you do want to link with @file{libgcc.a}.  You can do
3157
3158 @example
3159 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
3160 @end example
3161
3162 @item -print-search-dirs
3163 @opindex print-search-dirs
3164 Print the name of the configured installation directory and a list of
3165 program and library directories gcc will search---and don't do anything else.
3166
3167 This is useful when gcc prints the error message
3168 @samp{installation problem, cannot exec cpp0: No such file or directory}.
3169 To resolve this you either need to put @file{cpp0} and the other compiler
3170 components where gcc expects to find them, or you can set the environment
3171 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
3172 Don't forget the trailing '/'.
3173 @xref{Environment Variables}.
3174
3175 @item -dumpmachine
3176 @opindex dumpmachine
3177 Print the compiler's target machine (for example,
3178 @samp{i686-pc-linux-gnu})---and don't do anything else.
3179
3180 @item -dumpversion
3181 @opindex dumpversion
3182 Print the compiler version (for example, @samp{3.0})---and don't do
3183 anything else.
3184
3185 @item -dumpspecs
3186 @opindex dumpspecs
3187 Print the compiler's built-in specs---and don't do anything else.  (This
3188 is used when GCC itself is being built.)  @xref{Spec Files}.
3189 @end table
3190
3191 @node Optimize Options
3192 @section Options That Control Optimization
3193 @cindex optimize options
3194 @cindex options, optimization
3195
3196 These options control various sorts of optimizations:
3197
3198 @table @gcctabopt
3199 @item -O
3200 @itemx -O1
3201 @opindex O
3202 @opindex O1
3203 Optimize.  Optimizing compilation takes somewhat more time, and a lot
3204 more memory for a large function.
3205
3206 Without @option{-O}, the compiler's goal is to reduce the cost of
3207 compilation and to make debugging produce the expected results.
3208 Statements are independent: if you stop the program with a breakpoint
3209 between statements, you can then assign a new value to any variable or
3210 change the program counter to any other statement in the function and
3211 get exactly the results you would expect from the source code.
3212
3213 With @option{-O}, the compiler tries to reduce code size and execution
3214 time, without performing any optimizations that take a great deal of
3215 compilation time.
3216
3217 @item -O2
3218 @opindex O2
3219 Optimize even more.  GCC performs nearly all supported optimizations
3220 that do not involve a space-speed tradeoff.  The compiler does not
3221 perform loop unrolling or function inlining when you specify @option{-O2}.
3222 As compared to @option{-O}, this option increases both compilation time
3223 and the performance of the generated code.
3224
3225 @option{-O2} turns on all optional optimizations except for loop unrolling,
3226 function inlining, and register renaming.  It also turns on the
3227 @option{-fforce-mem} option on all machines and frame pointer elimination
3228 on machines where doing so does not interfere with debugging.
3229
3230 Please note the warning under @option{-fgcse} about
3231 invoking @option{-O2} on programs that use computed gotos.
3232
3233 @item -O3
3234 @opindex O3
3235 Optimize yet more.  @option{-O3} turns on all optimizations specified by
3236 @option{-O2} and also turns on the @option{-finline-functions} and
3237 @option{-frename-registers} options.
3238
3239 @item -O0
3240 @opindex O0
3241 Do not optimize.
3242
3243 @item -Os
3244 @opindex Os
3245 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
3246 do not typically increase code size.  It also performs further
3247 optimizations designed to reduce code size.
3248
3249 If you use multiple @option{-O} options, with or without level numbers,
3250 the last such option is the one that is effective.
3251 @end table
3252
3253 Options of the form @option{-f@var{flag}} specify machine-independent
3254 flags.  Most flags have both positive and negative forms; the negative
3255 form of @option{-ffoo} would be @option{-fno-foo}.  In the table below,
3256 only one of the forms is listed---the one which is not the default.
3257 You can figure out the other form by either removing @samp{no-} or
3258 adding it.
3259
3260 @table @gcctabopt
3261 @item -ffloat-store
3262 @opindex ffloat-store
3263 Do not store floating point variables in registers, and inhibit other
3264 options that might change whether a floating point value is taken from a
3265 register or memory.
3266
3267 @cindex floating point precision
3268 This option prevents undesirable excess precision on machines such as
3269 the 68000 where the floating registers (of the 68881) keep more
3270 precision than a @code{double} is supposed to have.  Similarly for the
3271 x86 architecture.  For most programs, the excess precision does only
3272 good, but a few programs rely on the precise definition of IEEE floating
3273 point.  Use @option{-ffloat-store} for such programs, after modifying
3274 them to store all pertinent intermediate computations into variables.
3275
3276 @item -fno-default-inline
3277 @opindex fno-default-inline
3278 Do not make member functions inline by default merely because they are
3279 defined inside the class scope (C++ only).  Otherwise, when you specify
3280 @w{@option{-O}}, member functions defined inside class scope are compiled
3281 inline by default; i.e., you don't need to add @samp{inline} in front of
3282 the member function name.
3283
3284 @item -fno-defer-pop
3285 @opindex fno-defer-pop
3286 Always pop the arguments to each function call as soon as that function
3287 returns.  For machines which must pop arguments after a function call,
3288 the compiler normally lets arguments accumulate on the stack for several
3289 function calls and pops them all at once.
3290
3291 @item -fforce-mem
3292 @opindex fforce-mem
3293 Force memory operands to be copied into registers before doing
3294 arithmetic on them.  This produces better code by making all memory
3295 references potential common subexpressions.  When they are not common
3296 subexpressions, instruction combination should eliminate the separate
3297 register-load.  The @option{-O2} option turns on this option.
3298
3299 @item -fforce-addr
3300 @opindex fforce-addr
3301 Force memory address constants to be copied into registers before
3302 doing arithmetic on them.  This may produce better code just as
3303 @option{-fforce-mem} may.
3304
3305 @item -fomit-frame-pointer
3306 @opindex fomit-frame-pointer
3307 Don't keep the frame pointer in a register for functions that
3308 don't need one.  This avoids the instructions to save, set up and
3309 restore frame pointers; it also makes an extra register available
3310 in many functions.  @strong{It also makes debugging impossible on
3311 some machines.}
3312
3313 @ifset INTERNALS
3314 On some machines, such as the VAX, this flag has no effect, because
3315 the standard calling sequence automatically handles the frame pointer
3316 and nothing is saved by pretending it doesn't exist.  The
3317 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
3318 whether a target machine supports this flag.  @xref{Registers}.
3319 @end ifset
3320 @ifclear INTERNALS
3321 On some machines, such as the VAX, this flag has no effect, because
3322 the standard calling sequence automatically handles the frame pointer
3323 and nothing is saved by pretending it doesn't exist.  The
3324 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
3325 whether a target machine supports this flag.  @xref{Registers,,Register
3326 Usage, gcc.info, Using and Porting GCC}.
3327 @end ifclear
3328
3329 @item -foptimize-sibling-calls
3330 @opindex foptimize-sibling-calls
3331 Optimize sibling and tail recursive calls.
3332
3333 @item -ftrapv
3334 @opindex ftrapv
3335 This option generates traps for signed overflow on addition, subtraction,
3336 multiplication operations.
3337
3338 @item -fno-inline
3339 @opindex fno-inline
3340 Don't pay attention to the @code{inline} keyword.  Normally this option
3341 is used to keep the compiler from expanding any functions inline.
3342 Note that if you are not optimizing, no functions can be expanded inline.
3343
3344 @item -finline-functions
3345 @opindex finline-functions
3346 Integrate all simple functions into their callers.  The compiler
3347 heuristically decides which functions are simple enough to be worth
3348 integrating in this way.
3349
3350 If all calls to a given function are integrated, and the function is
3351 declared @code{static}, then the function is normally not output as
3352 assembler code in its own right.
3353
3354 @item -finline-limit=@var{n}
3355 @opindex finline-limit
3356 By default, gcc limits the size of functions that can be inlined.  This flag
3357 allows the control of this limit for functions that are explicitly marked as
3358 inline (ie marked with the inline keyword or defined within the class
3359 definition in c++).  @var{n} is the size of functions that can be inlined in
3360 number of pseudo instructions (not counting parameter handling).  The default
3361 value of @var{n} is 600.
3362 Increasing this value can result in more inlined code at
3363 the cost of compilation time and memory consumption.  Decreasing usually makes
3364 the compilation faster and less code will be inlined (which presumably
3365 means slower programs).  This option is particularly useful for programs that
3366 use inlining heavily such as those based on recursive templates with C++.
3367
3368 @emph{Note:} pseudo instruction represents, in this particular context, an
3369 abstract measurement of function's size.  In no way, it represents a count
3370 of assembly instructions and as such its exact meaning might change from one
3371 release to an another.
3372
3373 @item -fkeep-inline-functions
3374 @opindex fkeep-inline-functions
3375 Even if all calls to a given function are integrated, and the function
3376 is declared @code{static}, nevertheless output a separate run-time
3377 callable version of the function.  This switch does not affect
3378 @code{extern inline} functions.
3379
3380 @item -fkeep-static-consts
3381 @opindex fkeep-static-consts
3382 Emit variables declared @code{static const} when optimization isn't turned
3383 on, even if the variables aren't referenced.
3384
3385 GCC enables this option by default.  If you want to force the compiler to
3386 check if the variable was referenced, regardless of whether or not
3387 optimization is turned on, use the @option{-fno-keep-static-consts} option.
3388
3389 @item -fmerge-constants
3390 Attempt to merge identical constants (string constants and floating point
3391 constants) accross compilation units.
3392
3393 This option is default for optimized compilation if assembler and linker
3394 support it.  Use @option{-fno-merge-constants} to inhibit this behaviour.
3395
3396 @item -fmerge-all-constants
3397 Attempt to merge identical constants and identical variables.
3398
3399 This option implies @option{-fmerge-constants}.  In addition to
3400 @option{-fmerge-constants} this considers e.g. even constant initialized
3401 arrays or initialized constant variables with integral or floating point
3402 types.  Languages like C or C++ require each non-automatic variable to
3403 have distinct location, so using this option will result in non-conforming
3404 behaviour.
3405
3406 @item -fno-function-cse
3407 @opindex fno-function-cse
3408 Do not put function addresses in registers; make each instruction that
3409 calls a constant function contain the function's address explicitly.
3410
3411 This option results in less efficient code, but some strange hacks
3412 that alter the assembler output may be confused by the optimizations
3413 performed when this option is not used.
3414
3415 @item -ffast-math
3416 @opindex ffast-math
3417 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, and @*
3418 @option{-fno-trapping-math}.
3419
3420 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
3421
3422 This option should never be turned on by any @option{-O} option since
3423 it can result in incorrect output for programs which depend on
3424 an exact implementation of IEEE or ISO rules/specifications for
3425 math functions.
3426
3427 @item -fno-math-errno
3428 @opindex fno-math-errno
3429 Do not set ERRNO after calling math functions that are executed
3430 with a single instruction, e.g., sqrt.  A program that relies on
3431 IEEE exceptions for math error handling may want to use this flag
3432 for speed while maintaining IEEE arithmetic compatibility.
3433
3434 This option should never be turned on by any @option{-O} option since
3435 it can result in incorrect output for programs which depend on
3436 an exact implementation of IEEE or ISO rules/specifications for
3437 math functions.
3438
3439 The default is @option{-fmath-errno}.
3440
3441 @item -funsafe-math-optimizations
3442 @opindex funsafe-math-optimizations
3443 Allow optimizations for floating-point arithmetic that (a) assume
3444 that arguments and results are valid and (b) may violate IEEE or
3445 ANSI standards.  When used at link-time, it may include libraries
3446 or startup files that change the default FPU control word or other
3447 similar optimizations.
3448
3449 This option should never be turned on by any @option{-O} option since
3450 it can result in incorrect output for programs which depend on
3451 an exact implementation of IEEE or ISO rules/specifications for
3452 math functions.
3453
3454 The default is @option{-fno-unsafe-math-optimizations}.
3455
3456 @item -fno-trapping-math
3457 @opindex fno-trapping-math
3458 Compile code assuming that floating-point operations cannot generate
3459 user-visible traps.  Setting this option may allow faster code
3460 if one relies on ``non-stop'' IEEE arithmetic, for example.
3461
3462 This option should never be turned on by any @option{-O} option since
3463 it can result in incorrect output for programs which depend on
3464 an exact implementation of IEEE or ISO rules/specifications for
3465 math functions.
3466
3467 The default is @option{-ftrapping-math}.
3468 @end table
3469
3470 The following options control specific optimizations.  The @option{-O2}
3471 option turns on all of these optimizations except @option{-funroll-loops}
3472 and @option{-funroll-all-loops}.  On most machines, the @option{-O} option
3473 turns on the @option{-fthread-jumps} and @option{-fdelayed-branch} options,
3474 but specific machines may handle it differently.
3475
3476 You can use the following flags in the rare cases when ``fine-tuning''
3477 of optimizations to be performed is desired.
3478
3479 Not all of the optimizations performed by GCC have @option{-f} options
3480 to control them.
3481
3482 @table @gcctabopt
3483 @item -fstrength-reduce
3484 @opindex fstrength-reduce
3485 Perform the optimizations of loop strength reduction and
3486 elimination of iteration variables.
3487
3488 @item -fthread-jumps
3489 @opindex fthread-jumps
3490 Perform optimizations where we check to see if a jump branches to a
3491 location where another comparison subsumed by the first is found.  If
3492 so, the first branch is redirected to either the destination of the
3493 second branch or a point immediately following it, depending on whether
3494 the condition is known to be true or false.
3495
3496 @item -fcse-follow-jumps
3497 @opindex fcse-follow-jumps
3498 In common subexpression elimination, scan through jump instructions
3499 when the target of the jump is not reached by any other path.  For
3500 example, when CSE encounters an @code{if} statement with an
3501 @code{else} clause, CSE will follow the jump when the condition
3502 tested is false.
3503
3504 @item -fcse-skip-blocks
3505 @opindex fcse-skip-blocks
3506 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
3507 follow jumps which conditionally skip over blocks.  When CSE
3508 encounters a simple @code{if} statement with no else clause,
3509 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
3510 body of the @code{if}.
3511
3512 @item -frerun-cse-after-loop
3513 @opindex frerun-cse-after-loop
3514 Re-run common subexpression elimination after loop optimizations has been
3515 performed.
3516
3517 @item -frerun-loop-opt
3518 @opindex frerun-loop-opt
3519 Run the loop optimizer twice.
3520
3521 @item -fgcse
3522 @opindex fgcse
3523 Perform a global common subexpression elimination pass.
3524 This pass also performs global constant and copy propagation.
3525
3526 @emph{Note:} When compiling a program using computed gotos, a GCC
3527 extension, you may get better runtime performance if you disable
3528 the global common subexpression elmination pass by adding
3529 @option{-fno-gcse} to the command line.
3530
3531 @item -fgcse-lm
3532 @opindex fgcse-lm
3533 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
3534 attempt to move loads which are only killed by stores into themselves.  This
3535 allows a loop containing a load/store sequence to be changed to a load outside
3536 the loop, and a copy/store within the loop.
3537
3538 @item -fgcse-sm
3539 @opindex fgcse-sm
3540 When @option{-fgcse-sm} is enabled, A store motion pass is run after global common
3541 subexpression elimination.  This pass will attempt to move stores out of loops.
3542 When used in conjunction with @option{-fgcse-lm}, loops containing a load/store sequence
3543 can be changed to a load before the loop and a store after the loop.
3544
3545 @item -fdelete-null-pointer-checks
3546 @opindex fdelete-null-pointer-checks
3547 Use global dataflow analysis to identify and eliminate useless checks
3548 for null pointers.  The compiler assumes that dereferencing a null
3549 pointer would have halted the program.  If a pointer is checked after
3550 it has already been dereferenced, it cannot be null.
3551
3552 In some environments, this assumption is not true, and programs can
3553 safely dereference null pointers.  Use
3554 @option{-fno-delete-null-pointer-checks} to disable this optimization
3555 for programs which depend on that behavior.
3556
3557 @item -fexpensive-optimizations
3558 @opindex fexpensive-optimizations
3559 Perform a number of minor optimizations that are relatively expensive.
3560
3561 @item -foptimize-register-move
3562 @itemx -fregmove
3563 @opindex foptimize-register-move
3564 @opindex fregmove
3565 Attempt to reassign register numbers in move instructions and as
3566 operands of other simple instructions in order to maximize the amount of
3567 register tying.  This is especially helpful on machines with two-operand
3568 instructions.  GCC enables this optimization by default with @option{-O2}
3569 or higher.
3570
3571 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
3572 optimization.
3573
3574 @item -fdelayed-branch
3575 @opindex fdelayed-branch
3576 If supported for the target machine, attempt to reorder instructions
3577 to exploit instruction slots available after delayed branch
3578 instructions.
3579
3580 @item -fschedule-insns
3581 @opindex fschedule-insns
3582 If supported for the target machine, attempt to reorder instructions to
3583 eliminate execution stalls due to required data being unavailable.  This
3584 helps machines that have slow floating point or memory load instructions
3585 by allowing other instructions to be issued until the result of the load
3586 or floating point instruction is required.
3587
3588 @item -fschedule-insns2
3589 @opindex fschedule-insns2
3590 Similar to @option{-fschedule-insns}, but requests an additional pass of
3591 instruction scheduling after register allocation has been done.  This is
3592 especially useful on machines with a relatively small number of
3593 registers and where memory load instructions take more than one cycle.
3594
3595 @item -ffunction-sections
3596 @itemx -fdata-sections
3597 @opindex ffunction-sections
3598 @opindex fdata-sections
3599 Place each function or data item into its own section in the output
3600 file if the target supports arbitrary sections.  The name of the
3601 function or the name of the data item determines the section's name
3602 in the output file.
3603
3604 Use these options on systems where the linker can perform optimizations
3605 to improve locality of reference in the instruction space.  HPPA
3606 processors running HP-UX and Sparc processors running Solaris 2 have
3607 linkers with such optimizations.  Other systems using the ELF object format
3608 as well as AIX may have these optimizations in the future.
3609
3610 Only use these options when there are significant benefits from doing
3611 so.  When you specify these options, the assembler and linker will
3612 create larger object and executable files and will also be slower.
3613 You will not be able to use @code{gprof} on all systems if you
3614 specify this option and you may have problems with debugging if
3615 you specify both this option and @option{-g}.
3616
3617 @item -fcaller-saves
3618 @opindex fcaller-saves
3619 Enable values to be allocated in registers that will be clobbered by
3620 function calls, by emitting extra instructions to save and restore the
3621 registers around such calls.  Such allocation is done only when it
3622 seems to result in better code than would otherwise be produced.
3623
3624 This option is always enabled by default on certain machines, usually
3625 those which have no call-preserved registers to use instead.
3626
3627 For all machines, optimization level 2 and higher enables this flag by
3628 default.
3629
3630 @item -funroll-loops
3631 @opindex funroll-loops
3632 Unroll loops whose number of iterations can be determined at compile
3633 time or upon entry to the loop.  @option{-funroll-loops} implies both
3634 @option{-fstrength-reduce} and @option{-frerun-cse-after-loop}.  This
3635 option makes code larger, and may or may not make it run faster.
3636
3637 @item -funroll-all-loops
3638 @opindex funroll-all-loops
3639 Unroll all loops, even if their number of iterations is uncertain when
3640 the loop is entered.  This usually makes programs run more slowly.
3641 @option{-funroll-all-loops} implies the same options as
3642 @option{-funroll-loops},
3643
3644
3645 @item -fmove-all-movables
3646 @opindex fmove-all-movables
3647 Forces all invariant computations in loops to be moved
3648 outside the loop.
3649
3650 @item -freduce-all-givs
3651 @opindex freduce-all-givs
3652 Forces all general-induction variables in loops to be
3653 strength-reduced.
3654
3655 @emph{Note:} When compiling programs written in Fortran,
3656 @option{-fmove-all-movables} and @option{-freduce-all-givs} are enabled
3657 by default when you use the optimizer.
3658
3659 These options may generate better or worse code; results are highly
3660 dependent on the structure of loops within the source code.
3661
3662 These two options are intended to be removed someday, once
3663 they have helped determine the efficacy of various
3664 approaches to improving loop optimizations.
3665
3666 Please let us (@w{@email{gcc@@gcc.gnu.org}} and @w{@email{fortran@@gnu.org}})
3667 know how use of these options affects
3668 the performance of your production code.
3669 We're very interested in code that runs @emph{slower}
3670 when these options are @emph{enabled}.
3671
3672 @item -fno-peephole
3673 @itemx -fno-peephole2
3674 @opindex fno-peephole
3675 @opindex fno-peephole2
3676 Disable any machine-specific peephole optimizations.  The difference
3677 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
3678 are implemented in the compiler; some targets use one, some use the
3679 other, a few use both.
3680
3681 @item -fbranch-probabilities
3682 @opindex fbranch-probabilities
3683 After running a program compiled with @option{-fprofile-arcs}
3684 (@pxref{Debugging Options,, Options for Debugging Your Program or
3685 @command{gcc}}), you can compile it a second time using
3686 @option{-fbranch-probabilities}, to improve optimizations based on
3687 the number of times each branch was taken.  When the program
3688 compiled with @option{-fprofile-arcs} exits it saves arc execution
3689 counts to a file called @file{@var{sourcename}.da} for each source
3690 file  The information in this data file is very dependent on the
3691 structure of the generated code, so you must use the same source code
3692 and the same optimization options for both compilations.
3693
3694 @ifset INTERNALS
3695 With @option{-fbranch-probabilities}, GCC puts a @samp{REG_EXEC_COUNT}
3696 note on the first instruction of each basic block, and a
3697 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
3698 These can be used to improve optimization.  Currently, they are only
3699 used in one place: in @file{reorg.c}, instead of guessing which path a
3700 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
3701 exactly determine which path is taken more often.
3702 @end ifset
3703
3704 @item -fno-guess-branch-probability
3705 @opindex fno-guess-branch-probability
3706 Do not guess branch probabilities using a randomized model.
3707
3708 Sometimes gcc will opt to use a randomized model to guess branch
3709 probabilities, when none are available from either profiling feedback
3710 (@option{-fprofile-arcs}) or @samp{__builtin_expect}.  This means that
3711 different runs of the compiler on the same program may produce different
3712 object code.
3713
3714 In a hard real-time system, people don't want different runs of the
3715 compiler to produce code that has different behavior; minimizing
3716 non-determinism is of paramount import.  This switch allows users to
3717 reduce non-determinism, possibly at the expense of inferior
3718 optimization.
3719
3720 @item -fstrict-aliasing
3721 @opindex fstrict-aliasing
3722 Allows the compiler to assume the strictest aliasing rules applicable to
3723 the language being compiled.  For C (and C++), this activates
3724 optimizations based on the type of expressions.  In particular, an
3725 object of one type is assumed never to reside at the same address as an
3726 object of a different type, unless the types are almost the same.  For
3727 example, an @code{unsigned int} can alias an @code{int}, but not a
3728 @code{void*} or a @code{double}.  A character type may alias any other
3729 type.
3730
3731 Pay special attention to code like this:
3732 @example
3733 union a_union @{
3734   int i;
3735   double d;
3736 @};
3737
3738 int f() @{
3739   a_union t;
3740   t.d = 3.0;
3741   return t.i;
3742 @}
3743 @end example
3744 The practice of reading from a different union member than the one most
3745 recently written to (called ``type-punning'') is common.  Even with
3746 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
3747 is accessed through the union type.  So, the code above will work as
3748 expected.  However, this code might not:
3749 @example
3750 int f() @{
3751   a_union t;
3752   int* ip;
3753   t.d = 3.0;
3754   ip = &t.i;
3755   return *ip;
3756 @}
3757 @end example
3758
3759 @ifset INTERNALS
3760 Every language that wishes to perform language-specific alias analysis
3761 should define a function that computes, given an @code{tree}
3762 node, an alias set for the node.  Nodes in different alias sets are not
3763 allowed to alias.  For an example, see the C front-end function
3764 @code{c_get_alias_set}.
3765 @end ifset
3766
3767 @item -falign-functions
3768 @itemx -falign-functions=@var{n}
3769 @opindex falign-functions
3770 Align the start of functions to the next power-of-two greater than
3771 @var{n}, skipping up to @var{n} bytes.  For instance,
3772 @option{-falign-functions=32} aligns functions to the next 32-byte
3773 boundary, but @option{-falign-functions=24} would align to the next
3774 32-byte boundary only if this can be done by skipping 23 bytes or less.
3775
3776 @option{-fno-align-functions} and @option{-falign-functions=1} are
3777 equivalent and mean that functions will not be aligned.
3778
3779 Some assemblers only support this flag when @var{n} is a power of two;
3780 in that case, it is rounded up.
3781
3782 If @var{n} is not specified, use a machine-dependent default.
3783
3784 @item -falign-labels
3785 @itemx -falign-labels=@var{n}
3786 @opindex falign-labels
3787 Align all branch targets to a power-of-two boundary, skipping up to
3788 @var{n} bytes like @option{-falign-functions}.  This option can easily
3789 make code slower, because it must insert dummy operations for when the
3790 branch target is reached in the usual flow of the code.
3791
3792 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
3793 are greater than this value, then their values are used instead.
3794
3795 If @var{n} is not specified, use a machine-dependent default which is
3796 very likely to be @samp{1}, meaning no alignment.
3797
3798 @item -falign-loops
3799 @itemx -falign-loops=@var{n}
3800 @opindex falign-loops
3801 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
3802 like @option{-falign-functions}.  The hope is that the loop will be
3803 executed many times, which will make up for any execution of the dummy
3804 operations.
3805
3806 If @var{n} is not specified, use a machine-dependent default.
3807
3808 @item -falign-jumps
3809 @itemx -falign-jumps=@var{n}
3810 @opindex falign-jumps
3811 Align branch targets to a power-of-two boundary, for branch targets
3812 where the targets can only be reached by jumping, skipping up to @var{n}
3813 bytes like @option{-falign-functions}.  In this case, no dummy operations
3814 need be executed.
3815
3816 If @var{n} is not specified, use a machine-dependent default.
3817
3818 @item -fssa
3819 @opindex fssa
3820 Perform optimizations in static single assignment form.  Each function's
3821 flow graph is translated into SSA form, optimizations are performed, and
3822 the flow graph is translated back from SSA form.  Users should not
3823 specify this option, since it is not yet ready for production use.
3824
3825 @item -fssa-ccp
3826 @opindex fssa-ccp
3827 Perform Sparse Conditional Constant Propagation in SSA form.  Requires
3828 @option{-fssa}.  Like @option{-fssa}, this is an experimental feature.
3829
3830 @item -fssa-dce
3831 @opindex fssa-dce
3832 Perform aggressive dead-code elimination in SSA form.  Requires @option{-fssa}.
3833 Like @option{-fssa}, this is an experimental feature.
3834
3835 @item -fsingle-precision-constant
3836 @opindex fsingle-precision-constant
3837 Treat floating point constant as single precision constant instead of
3838 implicitly converting it to double precision constant.
3839
3840 @item -frename-registers
3841 @opindex frename-registers
3842 Attempt to avoid false dependencies in scheduled code by making use
3843 of registers left over after register allocation.  This optimization
3844 will most benefit processors with lots of registers.  It can, however,
3845 make debugging impossible, since variables will no longer stay in
3846 a ``home register''.
3847
3848 @item --param @var{name}=@var{value}
3849 @opindex param
3850 In some places, GCC uses various constants to control the amount of
3851 optimization that is done.  For example, GCC will not inline functions
3852 that contain more that a certain number of instructions.  You can
3853 control some of these constants on the command-line using the
3854 @option{--param} option.
3855
3856 In each case, the @var{value} is an integer.  The allowable choices for
3857 @var{name} are given in the following table:
3858
3859 @table @gcctabopt
3860 @item max-delay-slot-insn-search
3861 The maximum number of instructions to consider when looking for an
3862 instruction to fill a delay slot.  If more than this arbitrary number of
3863 instructions is searched, the time savings from filling the delay slot
3864 will be minimal so stop searching.  Increasing values mean more
3865 aggressive optimization, making the compile time increase with probably
3866 small improvement in executable run time.
3867
3868 @item max-delay-slot-live-search
3869 When trying to fill delay slots, the maximum number of instructions to
3870 consider when searching for a block with valid live register
3871 information.  Increasing this arbitrarily chosen value means more
3872 aggressive optimization, increasing the compile time.  This parameter
3873 should be removed when the delay slot code is rewritten to maintain the
3874 control-flow graph.
3875
3876 @item max-gcse-memory
3877 The approximate maximum amount of memory that will be allocated in
3878 order to perform the global common subexpression elimination
3879 optimization.  If more memory than specified is required, the
3880 optimization will not be done.
3881
3882 @item max-gcse-passes
3883 The maximum number of passes of GCSE to run.
3884
3885 @item max-pending-list-length
3886 The maximum number of pending dependencies scheduling will allow
3887 before flushing the current state and starting over.  Large functions
3888 with few branches or calls can create excessively large lists which
3889 needlessly consume memory and resources.
3890
3891 @item max-inline-insns
3892 If an function contains more than this many instructions, it
3893 will not be inlined.  This option is precisely equivalent to
3894 @option{-finline-limit}.
3895
3896 @end table
3897 @end table
3898
3899 @node Preprocessor Options
3900 @section Options Controlling the Preprocessor
3901 @cindex preprocessor options
3902 @cindex options, preprocessor
3903
3904 These options control the C preprocessor, which is run on each C source
3905 file before actual compilation.
3906
3907 If you use the @option{-E} option, nothing is done except preprocessing.
3908 Some of these options make sense only together with @option{-E} because
3909 they cause the preprocessor output to be unsuitable for actual
3910 compilation.
3911
3912 @table @gcctabopt
3913 @item -include @var{file}
3914 @opindex include
3915 Process @var{file} as input before processing the regular input file.
3916 In effect, the contents of @var{file} are compiled first.  Any @option{-D}
3917 and @option{-U} options on the command line are always processed before
3918 @option{-include @var{file}}, regardless of the order in which they are
3919 written.  All the @option{-include} and @option{-imacros} options are
3920 processed in the order in which they are written.
3921
3922 @item -imacros @var{file}
3923 @opindex imacros
3924 Process @var{file} as input, discarding the resulting output, before
3925 processing the regular input file.  Because the output generated from
3926 @var{file} is discarded, the only effect of @option{-imacros @var{file}}
3927 is to make the macros defined in @var{file} available for use in the
3928 main input.  All the @option{-include} and @option{-imacros} options are
3929 processed in the order in which they are written.
3930
3931 @item -idirafter @var{dir}
3932 @opindex idirafter
3933 @cindex second include path
3934 Add the directory @var{dir} to the second include path.  The directories
3935 on the second include path are searched when a header file is not found
3936 in any of the directories in the main include path (the one that
3937 @option{-I} adds to).
3938
3939 @item -iprefix @var{prefix}
3940 @opindex iprefix
3941 Specify @var{prefix} as the prefix for subsequent @option{-iwithprefix}
3942 options.
3943
3944 @item -iwithprefix @var{dir}
3945 @opindex iwithprefix
3946 Add a directory to the second include path.  The directory's name is
3947 made by concatenating @var{prefix} and @var{dir}, where @var{prefix} was
3948 specified previously with @option{-iprefix}.  If you have not specified a
3949 prefix yet, the directory containing the installed passes of the
3950 compiler is used as the default.
3951
3952 @item -iwithprefixbefore @var{dir}
3953 @opindex iwithprefixbefore
3954 Add a directory to the main include path.  The directory's name is made
3955 by concatenating @var{prefix} and @var{dir}, as in the case of
3956 @option{-iwithprefix}.
3957
3958 @item -isystem @var{dir}
3959 @opindex isystem
3960 Add a directory to the beginning of the second include path, marking it
3961 as a system directory, so that it gets the same special treatment as
3962 is applied to the standard system directories.
3963
3964 @item -nostdinc
3965 @opindex nostdinc
3966 Do not search the standard system directories for header files.  Only
3967 the directories you have specified with @option{-I} options (and the
3968 current directory, if appropriate) are searched.  @xref{Directory
3969 Options}, for information on @option{-I}.
3970
3971 By using both @option{-nostdinc} and @option{-I-}, you can limit the include-file
3972 search path to only those directories you specify explicitly.
3973
3974 @item -remap
3975 @opindex remap
3976 When searching for a header file in a directory, remap file names if a
3977 file named @file{header.gcc} exists in that directory.  This can be used
3978 to work around limitations of file systems with file name restrictions.
3979 The @file{header.gcc} file should contain a series of lines with two
3980 tokens on each line: the first token is the name to map, and the second
3981 token is the actual name to use.
3982
3983 @item -undef
3984 @opindex undef
3985 Do not predefine any nonstandard macros.  (Including architecture flags).
3986
3987 @item -E
3988 @opindex E
3989 Run only the C preprocessor.  Preprocess all the C source files
3990 specified and output the results to standard output or to the
3991 specified output file.
3992
3993 @item -C
3994 @opindex C
3995 Tell the preprocessor not to discard comments.  Used with the
3996 @option{-E} option.
3997
3998 @item -P
3999 @opindex P
4000 Tell the preprocessor not to generate @samp{#line} directives.
4001 Used with the @option{-E} option.
4002
4003 @cindex make
4004 @cindex dependencies, make
4005 @item -M
4006 @opindex M
4007 Instead of outputting the result of preprocessing, output a rule
4008 suitable for @code{make} describing the dependencies of the main source
4009 file.  The preprocessor outputs one @code{make} rule containing the
4010 object file name for that source file, a colon, and the names of all the
4011 included files.  Unless overridden explicitly, the object file name
4012 consists of the basename of the source file with any suffix replaced with
4013 object file suffix.  If there are many included files then the
4014 rule is split into several lines using @samp{\}-newline.
4015
4016 @option{-M} implies @option{-E}.
4017
4018 @item -MM
4019 @opindex MM
4020 Like @option{-M}, but mention only the files included with @samp{#include
4021 "@var{file}"}.  System header files included with @samp{#include
4022 <@var{file}>} are omitted.
4023
4024 @item -MD
4025 @opindex MD
4026 Like @option{-M} but the dependency information is written to a file
4027 rather than stdout.  @code{gcc} will use the same file name and
4028 directory as the object file, but with the suffix @file{.d} instead.
4029
4030 This is in addition to compiling the main file as specified---@option{-MD}
4031 does not inhibit ordinary compilation the way @option{-M} does,
4032 unless you also specify @option{-MG}.
4033
4034 With Mach, you can use the utility @code{md} to merge multiple
4035 dependency files into a single dependency file suitable for using with
4036 the @samp{make} command.
4037
4038 @item -MMD
4039 @opindex MMD
4040 Like @option{-MD} except mention only user header files, not system
4041 -header files.
4042
4043 @item -MF @var{file}
4044 @opindex MF
4045 When used with @option{-M} or @option{-MM}, specifies a file to write the
4046 dependencies to.  This allows the preprocessor to write the preprocessed
4047 file to stdout normally.  If no @option{-MF} switch is given, CPP sends
4048 the rules to stdout and suppresses normal preprocessed output.
4049
4050 Another way to specify output of a @code{make} rule is by setting
4051 the environment variable @env{DEPENDENCIES_OUTPUT} (@pxref{Environment
4052 Variables}).
4053
4054 @item -MG
4055 @opindex MG
4056 When used with @option{-M} or @option{-MM}, @option{-MG} says to treat missing
4057 header files as generated files and assume they live in the same
4058 directory as the source file.  It suppresses preprocessed output, as a
4059 missing header file is ordinarily an error.
4060
4061 This feature is used in automatic updating of makefiles.
4062
4063 @item -MP
4064 @opindex MP
4065 This option instructs CPP to add a phony target for each dependency
4066 other than the main file, causing each to depend on nothing.  These
4067 dummy rules work around errors @code{make} gives if you remove header
4068 files without updating the @code{Makefile} to match.
4069
4070 This is typical output:-
4071
4072 @smallexample
4073 /tmp/test.o: /tmp/test.c /tmp/test.h
4074
4075 /tmp/test.h:
4076 @end smallexample
4077
4078 @item -MQ @var{target}
4079 @item -MT @var{target}
4080 @opindex MQ
4081 @opindex MT
4082 By default CPP uses the main file name, including any path, and appends
4083 the object suffix, normally ``.o'', to it to obtain the name of the
4084 target for dependency generation.  With @option{-MT} you can specify a
4085 target yourself, overriding the default one.
4086
4087 If you want multiple targets, you can specify them as a single argument
4088 to @option{-MT}, or use multiple @option{-MT} options.
4089
4090 The targets you specify are output in the order they appear on the
4091 command line.  @option{-MQ} is identical to @option{-MT}, except that the
4092 target name is quoted for Make, but with @option{-MT} it isn't.  For
4093 example, @option{-MT '$(objpfx)foo.o'} gives
4094
4095 @smallexample
4096 $(objpfx)foo.o: /tmp/foo.c
4097 @end smallexample
4098
4099 but @option{-MQ '$(objpfx)foo.o'} gives
4100
4101 @smallexample
4102 $$(objpfx)foo.o: /tmp/foo.c
4103 @end smallexample
4104
4105 The default target is automatically quoted, as if it were given with
4106 @option{-MQ}.
4107
4108 @item -H
4109 @opindex H
4110 Print the name of each header file used, in addition to other normal
4111 activities.
4112
4113 @item -A@var{question}(@var{answer})
4114 @opindex A
4115 Assert the answer @var{answer} for @var{question}, in case it is tested
4116 with a preprocessing conditional such as @samp{#if
4117 #@var{question}(@var{answer})}.  @option{-A-} disables the standard
4118 assertions that normally describe the target machine.
4119
4120 @item -D@var{macro}
4121 @opindex D
4122 Define macro @var{macro} with the string @samp{1} as its definition.
4123
4124 @item -D@var{macro}=@var{defn}
4125 Define macro @var{macro} as @var{defn}.  All instances of @option{-D} on
4126 the command line are processed before any @option{-U} options.
4127
4128 Any @option{-D} and @option{-U} options on the command line are processed in
4129 order, and always before @option{-imacros @var{file}}, regardless of the
4130 order in which they are written.
4131
4132 @item -U@var{macro}
4133 @opindex U
4134 Undefine macro @var{macro}.  @option{-U} options are evaluated after all
4135 @option{-D} options, but before any @option{-include} and @option{-imacros}
4136 options.
4137
4138 Any @option{-D} and @option{-U} options on the command line are processed in
4139 order, and always before @option{-imacros @var{file}}, regardless of the
4140 order in which they are written.
4141
4142 @item -dM
4143 @opindex dM
4144 Tell the preprocessor to output only a list of the macro definitions
4145 that are in effect at the end of preprocessing.  Used with the @option{-E}
4146 option.
4147
4148 @item -dD
4149 @opindex dD
4150 Tell the preprocessing to pass all macro definitions into the output, in
4151 their proper sequence in the rest of the output.
4152
4153 @item -dN
4154 @opindex dN
4155 Like @option{-dD} except that the macro arguments and contents are omitted.
4156 Only @samp{#define @var{name}} is included in the output.
4157
4158 @item -dI
4159 @opindex dI
4160 Output @samp{#include} directives in addition to the result of
4161 preprocessing.
4162
4163 @item -fpreprocessed
4164 @opindex fpreprocessed
4165 Indicate to the preprocessor that the input file has already been
4166 preprocessed.  This suppresses things like macro expansion, trigraph
4167 conversion, escaped newline splicing, and processing of most directives.
4168 The preprocessor still recognizes and removes comments, so that you can
4169 pass a file preprocessed with @option{-C} to the compiler without
4170 problems.  In this mode the integrated preprocessor is little more than
4171 a tokenizer for the front ends.
4172
4173 @option{-fpreprocessed} is implicit if the input file has one of the
4174 extensions @samp{i}, @samp{ii} or @samp{mi}.  These are the extensions
4175 that GCC uses for preprocessed files created by @option{-save-temps}.
4176
4177 @item -trigraphs
4178 @opindex trigraphs
4179 Process ISO standard trigraph sequences.  These are three-character
4180 sequences, all starting with @samp{??}, that are defined by ISO C to
4181 stand for single characters.  For example, @samp{??/} stands for
4182 @samp{\}, so @samp{'??/n'} is a character constant for a newline.  By
4183 default, GCC ignores trigraphs, but in standard-conforming modes it
4184 converts them.  See the @option{-std} and @option{-ansi} options.
4185
4186 The nine trigraph sequences are
4187 @table @samp
4188 @item ??(
4189 @expansion{} @samp{[}
4190
4191 @item ??)
4192 @expansion{} @samp{]}
4193
4194 @item ??<
4195 @expansion{} @samp{@{}
4196
4197 @item ??>
4198 @expansion{} @samp{@}}
4199
4200 @item ??=
4201 @expansion{} @samp{#}
4202
4203 @item ??/
4204 @expansion{} @samp{\}
4205
4206 @item ??'
4207 @expansion{} @samp{^}
4208
4209 @item ??!
4210 @expansion{} @samp{|}
4211
4212 @item ??-
4213 @expansion{} @samp{~}
4214
4215 @end table
4216
4217 Trigraph support is not popular, so many compilers do not implement it
4218 properly.  Portable code should not rely on trigraphs being either
4219 converted or ignored.
4220
4221 @item -Wp,@var{option}
4222 @opindex Wp
4223 Pass @var{option} as an option to the preprocessor.  If @var{option}
4224 contains commas, it is split into multiple options at the commas.
4225 @end table
4226
4227 @node Assembler Options
4228 @section Passing Options to the Assembler
4229
4230 @c prevent bad page break with this line
4231 You can pass options to the assembler.
4232
4233 @table @gcctabopt
4234 @item -Wa,@var{option}
4235 @opindex Wa
4236 Pass @var{option} as an option to the assembler.  If @var{option}
4237 contains commas, it is split into multiple options at the commas.
4238 @end table
4239
4240 @node Link Options
4241 @section Options for Linking
4242 @cindex link options
4243 @cindex options, linking
4244
4245 These options come into play when the compiler links object files into
4246 an executable output file.  They are meaningless if the compiler is
4247 not doing a link step.
4248
4249 @table @gcctabopt
4250 @cindex file names
4251 @item @var{object-file-name}
4252 A file name that does not end in a special recognized suffix is
4253 considered to name an object file or library.  (Object files are
4254 distinguished from libraries by the linker according to the file
4255 contents.)  If linking is done, these object files are used as input
4256 to the linker.
4257
4258 @item -c
4259 @itemx -S
4260 @itemx -E
4261 @opindex c
4262 @opindex S
4263 @opindex E
4264 If any of these options is used, then the linker is not run, and
4265 object file names should not be used as arguments.  @xref{Overall
4266 Options}.
4267
4268 @cindex Libraries
4269 @item -l@var{library}
4270 @itemx -l @var{library}
4271 @opindex l
4272 Search the library named @var{library} when linking.  (The second
4273 alternative with the library as a separate argument is only for
4274 POSIX compliance and is not recommended.)
4275
4276 It makes a difference where in the command you write this option; the
4277 linker searches and processes libraries and object files in the order they
4278 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
4279 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
4280 to functions in @samp{z}, those functions may not be loaded.
4281
4282 The linker searches a standard list of directories for the library,
4283 which is actually a file named @file{lib@var{library}.a}.  The linker
4284 then uses this file as if it had been specified precisely by name.
4285
4286 The directories searched include several standard system directories
4287 plus any that you specify with @option{-L}.
4288
4289 Normally the files found this way are library files---archive files
4290 whose members are object files.  The linker handles an archive file by
4291 scanning through it for members which define symbols that have so far
4292 been referenced but not defined.  But if the file that is found is an
4293 ordinary object file, it is linked in the usual fashion.  The only
4294 difference between using an @option{-l} option and specifying a file name
4295 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
4296 and searches several directories.
4297
4298 @item -lobjc
4299 @opindex lobjc
4300 You need this special case of the @option{-l} option in order to
4301 link an Objective-C program.
4302
4303 @item -nostartfiles
4304 @opindex nostartfiles
4305 Do not use the standard system startup files when linking.
4306 The standard system libraries are used normally, unless @option{-nostdlib}
4307 or @option{-nodefaultlibs} is used.
4308
4309 @item -nodefaultlibs
4310 @opindex nodefaultlibs
4311 Do not use the standard system libraries when linking.
4312 Only the libraries you specify will be passed to the linker.
4313 The standard startup files are used normally, unless @option{-nostartfiles}
4314 is used.  The compiler may generate calls to memcmp, memset, and memcpy
4315 for System V (and ISO C) environments or to bcopy and bzero for
4316 BSD environments.  These entries are usually resolved by entries in
4317 libc.  These entry points should be supplied through some other
4318 mechanism when this option is specified.
4319
4320 @item -nostdlib
4321 @opindex nostdlib
4322 Do not use the standard system startup files or libraries when linking.
4323 No startup files and only the libraries you specify will be passed to
4324 the linker.  The compiler may generate calls to memcmp, memset, and memcpy
4325 for System V (and ISO C) environments or to bcopy and bzero for
4326 BSD environments.  These entries are usually resolved by entries in
4327 libc.  These entry points should be supplied through some other
4328 mechanism when this option is specified.
4329
4330 @cindex @option{-lgcc}, use with @option{-nostdlib}
4331 @cindex @option{-nostdlib} and unresolved references
4332 @cindex unresolved references and @option{-nostdlib}
4333 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
4334 @cindex @option{-nodefaultlibs} and unresolved references
4335 @cindex unresolved references and @option{-nodefaultlibs}
4336 One of the standard libraries bypassed by @option{-nostdlib} and
4337 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
4338 that GCC uses to overcome shortcomings of particular machines, or special
4339 needs for some languages.
4340 @ifset INTERNALS
4341 (@xref{Interface,,Interfacing to GCC Output}, for more discussion of
4342 @file{libgcc.a}.)
4343 @end ifset
4344 @ifclear INTERNALS
4345 (@xref{Interface,,Interfacing to GCC Output,gcc.info,Porting GCC},
4346 for more discussion of @file{libgcc.a}.)
4347 @end ifclear
4348 In most cases, you need @file{libgcc.a} even when you want to avoid
4349 other standard libraries.  In other words, when you specify @option{-nostdlib}
4350 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
4351 This ensures that you have no unresolved references to internal GCC
4352 library subroutines.  (For example, @samp{__main}, used to ensure C++
4353 constructors will be called; @pxref{Collect2,,@command{collect2}}.)
4354
4355 @item -s
4356 @opindex s
4357 Remove all symbol table and relocation information from the executable.
4358
4359 @item -static
4360 @opindex static
4361 On systems that support dynamic linking, this prevents linking with the shared
4362 libraries.  On other systems, this option has no effect.
4363
4364 @item -shared
4365 @opindex shared
4366 Produce a shared object which can then be linked with other objects to
4367 form an executable.  Not all systems support this option.  For predictable
4368 results, you must also specify the same set of options that were used to
4369 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
4370 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
4371 needs to build supplementary stub code for constructors to work.  On
4372 multi-libbed systems, @samp{gcc -shared} must select the correct support
4373 libraries to link against.  Failing to supply the correct flags may lead
4374 to subtle defects.  Supplying them in cases where they are not necessary
4375 is innocuous.}
4376
4377 @item -shared-libgcc
4378 @itemx -static-libgcc
4379 @opindex shared-libgcc
4380 @opindex static-libgcc
4381 On systems that provide @file{libgcc} as a shared library, these options
4382 force the use of either the shared or static version respectively.
4383 If no shared version of @file{libgcc} was built when the compiler was
4384 configured, these options have no effect.
4385
4386 There are several situations in which an application should use the
4387 shared @file{libgcc} instead of the static version.  The most common
4388 of these is when the application wishes to throw and catch exceptions
4389 across different shared libraries.  In that case, each of the libraries
4390 as well as the application itself should use the shared @file{libgcc}.
4391
4392 Therefore, whenever you specify the @option{-shared} option, the GCC
4393 driver automatically adds @option{-shared-libgcc}, unless you explicitly
4394 specify @option{-static-libgcc}.  The G++ driver automatically adds
4395 @option{-shared-libgcc} when you build a main executable as well because
4396 for C++ programs that is typically the right thing to do.
4397 (Exception-handling will not work reliably otherwise.)
4398
4399 However, when linking a main executable written in C, you must
4400 explicitly say @option{-shared-libgcc} if you want to use the shared
4401 @file{libgcc}.
4402
4403 @item -symbolic
4404 @opindex symbolic
4405 Bind references to global symbols when building a shared object.  Warn
4406 about any unresolved references (unless overridden by the link editor
4407 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
4408 this option.
4409
4410 @item -Xlinker @var{option}
4411 @opindex Xlinker
4412 Pass @var{option} as an option to the linker.  You can use this to
4413 supply system-specific linker options which GCC does not know how to
4414 recognize.
4415
4416 If you want to pass an option that takes an argument, you must use
4417 @option{-Xlinker} twice, once for the option and once for the argument.
4418 For example, to pass @option{-assert definitions}, you must write
4419 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
4420 @option{-Xlinker "-assert definitions"}, because this passes the entire
4421 string as a single argument, which is not what the linker expects.
4422
4423 @item -Wl,@var{option}
4424 @opindex Wl
4425 Pass @var{option} as an option to the linker.  If @var{option} contains
4426 commas, it is split into multiple options at the commas.
4427
4428 @item -u @var{symbol}
4429 @opindex u
4430 Pretend the symbol @var{symbol} is undefined, to force linking of
4431 library modules to define it.  You can use @option{-u} multiple times with
4432 different symbols to force loading of additional library modules.
4433 @end table
4434
4435 @node Directory Options
4436 @section Options for Directory Search
4437 @cindex directory options
4438 @cindex options, directory search
4439 @cindex search path
4440
4441 These options specify directories to search for header files, for
4442 libraries and for parts of the compiler:
4443
4444 @table @gcctabopt
4445 @item -I@var{dir}
4446 @opindex I
4447 Add the directory @var{dir} to the head of the list of directories to be
4448 searched for header files.  This can be used to override a system header
4449 file, substituting your own version, since these directories are
4450 searched before the system header file directories.  However, you should
4451 not use this option to add directories that contain vendor-supplied
4452 system header files (use @option{-isystem} for that).  If you use more than
4453 one @option{-I} option, the directories are scanned in left-to-right
4454 order; the standard system directories come after.
4455
4456 If a standard system include directory, or a directory specified with
4457 @option{-isystem}, is also specified with @option{-I}, it will be
4458 searched only in the position requested by @option{-I}.  Also, it will
4459 not be considered a system include directory.  If that directory really
4460 does contain system headers, there is a good chance that they will
4461 break.  For instance, if GCC's installation procedure edited the headers
4462 in @file{/usr/include} to fix bugs, @samp{-I/usr/include} will cause the
4463 original, buggy headers to be found instead of the corrected ones.  GCC
4464 will issue a warning when a system include directory is hidden in this
4465 way.
4466
4467 @item -I-
4468 @opindex I-
4469 Any directories you specify with @option{-I} options before the @option{-I-}
4470 option are searched only for the case of @samp{#include "@var{file}"};
4471 they are not searched for @samp{#include <@var{file}>}.
4472
4473 If additional directories are specified with @option{-I} options after
4474 the @option{-I-}, these directories are searched for all @samp{#include}
4475 directives.  (Ordinarily @emph{all} @option{-I} directories are used
4476 this way.)
4477
4478 In addition, the @option{-I-} option inhibits the use of the current
4479 directory (where the current input file came from) as the first search
4480 directory for @samp{#include "@var{file}"}.  There is no way to
4481 override this effect of @option{-I-}.  With @option{-I.} you can specify
4482 searching the directory which was current when the compiler was
4483 invoked.  That is not exactly the same as what the preprocessor does
4484 by default, but it is often satisfactory.
4485
4486 @option{-I-} does not inhibit the use of the standard system directories
4487 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
4488 independent.
4489
4490 @item -L@var{dir}
4491 @opindex L
4492 Add directory @var{dir} to the list of directories to be searched
4493 for @option{-l}.
4494
4495 @item -B@var{prefix}
4496 @opindex B
4497 This option specifies where to find the executables, libraries,
4498 include files, and data files of the compiler itself.
4499
4500 The compiler driver program runs one or more of the subprograms
4501 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
4502 @var{prefix} as a prefix for each program it tries to run, both with and
4503 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
4504
4505 For each subprogram to be run, the compiler driver first tries the
4506 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
4507 was not specified, the driver tries two standard prefixes, which are
4508 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc-lib/}.  If neither of
4509 those results in a file name that is found, the unmodified program
4510 name is searched for using the directories specified in your
4511 @env{PATH} environment variable.
4512
4513 The compiler will check to see if the path provided by the @option{-B}
4514 refers to a directory, and if necessary it will add a directory
4515 separator character at the end of the path.
4516
4517 @option{-B} prefixes that effectively specify directory names also apply
4518 to libraries in the linker, because the compiler translates these
4519 options into @option{-L} options for the linker.  They also apply to
4520 includes files in the preprocessor, because the compiler translates these
4521 options into @option{-isystem} options for the preprocessor.  In this case,
4522 the compiler appends @samp{include} to the prefix.
4523
4524 The run-time support file @file{libgcc.a} can also be searched for using
4525 the @option{-B} prefix, if needed.  If it is not found there, the two
4526 standard prefixes above are tried, and that is all.  The file is left
4527 out of the link if it is not found by those means.
4528
4529 Another way to specify a prefix much like the @option{-B} prefix is to use
4530 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
4531 Variables}.
4532
4533 As a special kludge, if the path provided by @option{-B} is
4534 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
4535 9, then it will be replaced by @file{[dir/]include}.  This is to help
4536 with boot-strapping the compiler.
4537
4538 @item -specs=@var{file}
4539 @opindex specs
4540 Process @var{file} after the compiler reads in the standard @file{specs}
4541 file, in order to override the defaults that the @file{gcc} driver
4542 program uses when determining what switches to pass to @file{cc1},
4543 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
4544 @option{-specs=@var{file}} can be specified on the command line, and they
4545 are processed in order, from left to right.
4546 @end table
4547
4548 @c man end
4549
4550 @node Spec Files
4551 @section Specifying subprocesses and the switches to pass to them
4552 @cindex Spec Files
4553 @command{gcc} is a driver program.  It performs its job by invoking a
4554 sequence of other programs to do the work of compiling, assembling and
4555 linking.  GCC interprets its command-line parameters and uses these to
4556 deduce which programs it should invoke, and which command-line options
4557 it ought to place on their command lines.  This behaviour is controlled
4558 by @dfn{spec strings}.  In most cases there is one spec string for each
4559 program that GCC can invoke, but a few programs have multiple spec
4560 strings to control their behaviour.  The spec strings built into GCC can
4561 be overridden by using the @option{-specs=} command-line switch to specify
4562 a spec file.
4563
4564 @dfn{Spec files} are plaintext files that are used to construct spec
4565 strings.  They consist of a sequence of directives separated by blank
4566 lines.  The type of directive is determined by the first non-whitespace
4567 character on the line and it can be one of the following:
4568
4569 @table @code
4570 @item %@var{command}
4571 Issues a @var{command} to the spec file processor.  The commands that can
4572 appear here are:
4573
4574 @table @code
4575 @item %include <@var{file}>
4576 @cindex %include
4577 Search for @var{file} and insert its text at the current point in the
4578 specs file.
4579
4580 @item %include_noerr <@var{file}>
4581 @cindex %include_noerr
4582 Just like @samp{%include}, but do not generate an error message if the include
4583 file cannot be found.
4584
4585 @item %rename @var{old_name} @var{new_name}
4586 @cindex %rename
4587 Rename the spec string @var{old_name} to @var{new_name}.
4588
4589 @end table
4590
4591 @item *[@var{spec_name}]:
4592 This tells the compiler to create, override or delete the named spec
4593 string.  All lines after this directive up to the next directive or
4594 blank line are considered to be the text for the spec string.  If this
4595 results in an empty string then the spec will be deleted.  (Or, if the
4596 spec did not exist, then nothing will happened.)  Otherwise, if the spec
4597 does not currently exist a new spec will be created.  If the spec does
4598 exist then its contents will be overridden by the text of this
4599 directive, unless the first character of that text is the @samp{+}
4600 character, in which case the text will be appended to the spec.
4601
4602 @item [@var{suffix}]:
4603 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
4604 and up to the next directive or blank line are considered to make up the
4605 spec string for the indicated suffix.  When the compiler encounters an
4606 input file with the named suffix, it will processes the spec string in
4607 order to work out how to compile that file.  For example:
4608
4609 @smallexample
4610 .ZZ:
4611 z-compile -input %i
4612 @end smallexample
4613
4614 This says that any input file whose name ends in @samp{.ZZ} should be
4615 passed to the program @samp{z-compile}, which should be invoked with the
4616 command-line switch @option{-input} and with the result of performing the
4617 @samp{%i} substitution.  (See below.)
4618
4619 As an alternative to providing a spec string, the text that follows a
4620 suffix directive can be one of the following:
4621
4622 @table @code
4623 @item @@@var{language}
4624 This says that the suffix is an alias for a known @var{language}.  This is
4625 similar to using the @option{-x} command-line switch to GCC to specify a
4626 language explicitly.  For example:
4627
4628 @smallexample
4629 .ZZ:
4630 @@c++
4631 @end smallexample
4632
4633 Says that .ZZ files are, in fact, C++ source files.
4634
4635 @item #@var{name}
4636 This causes an error messages saying:
4637
4638 @smallexample
4639 @var{name} compiler not installed on this system.
4640 @end smallexample
4641 @end table
4642
4643 GCC already has an extensive list of suffixes built into it.
4644 This directive will add an entry to the end of the list of suffixes, but
4645 since the list is searched from the end backwards, it is effectively
4646 possible to override earlier entries using this technique.
4647
4648 @end table
4649
4650 GCC has the following spec strings built into it.  Spec files can
4651 override these strings or create their own.  Note that individual
4652 targets can also add their own spec strings to this list.
4653
4654 @smallexample
4655 asm          Options to pass to the assembler
4656 asm_final    Options to pass to the assembler post-processor
4657 cpp          Options to pass to the C preprocessor
4658 cc1          Options to pass to the C compiler
4659 cc1plus      Options to pass to the C++ compiler
4660 endfile      Object files to include at the end of the link
4661 link         Options to pass to the linker
4662 lib          Libraries to include on the command line to the linker
4663 libgcc       Decides which GCC support library to pass to the linker
4664 linker       Sets the name of the linker
4665 predefines   Defines to be passed to the C preprocessor
4666 signed_char  Defines to pass to CPP to say whether @code{char} is signed
4667              by default
4668 startfile    Object files to include at the start of the link
4669 @end smallexample
4670
4671 Here is a small example of a spec file:
4672
4673 @smallexample
4674 %rename lib                 old_lib
4675
4676 *lib:
4677 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
4678 @end smallexample
4679
4680 This example renames the spec called @samp{lib} to @samp{old_lib} and
4681 then overrides the previous definition of @samp{lib} with a new one.
4682 The new definition adds in some extra command-line options before
4683 including the text of the old definition.
4684
4685 @dfn{Spec strings} are a list of command-line options to be passed to their
4686 corresponding program.  In addition, the spec strings can contain
4687 @samp{%}-prefixed sequences to substitute variable text or to
4688 conditionally insert text into the command line.  Using these constructs
4689 it is possible to generate quite complex command lines.
4690
4691 Here is a table of all defined @samp{%}-sequences for spec
4692 strings.  Note that spaces are not generated automatically around the
4693 results of expanding these sequences.  Therefore you can concatenate them
4694 together or combine them with constant text in a single argument.
4695
4696 @table @code
4697 @item %%
4698 Substitute one @samp{%} into the program name or argument.
4699
4700 @item %i
4701 Substitute the name of the input file being processed.
4702
4703 @item %b
4704 Substitute the basename of the input file being processed.
4705 This is the substring up to (and not including) the last period
4706 and not including the directory.
4707
4708 @item %B
4709 This is the same as @samp{%b}, but include the file suffix (text after
4710 the last period).
4711
4712 @item %d
4713 Marks the argument containing or following the @samp{%d} as a
4714 temporary file name, so that that file will be deleted if GCC exits
4715 successfully.  Unlike @samp{%g}, this contributes no text to the
4716 argument.
4717
4718 @item %g@var{suffix}
4719 Substitute a file name that has suffix @var{suffix} and is chosen
4720 once per compilation, and mark the argument in the same way as
4721 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
4722 name is now chosen in a way that is hard to predict even when previously
4723 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
4724 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
4725 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
4726 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
4727 was simply substituted with a file name chosen once per compilation,
4728 without regard to any appended suffix (which was therefore treated
4729 just like ordinary text), making such attacks more likely to succeed.
4730
4731 @item %u@var{suffix}
4732 Like @samp{%g}, but generates a new temporary file name even if
4733 @samp{%u@var{suffix}} was already seen.
4734
4735 @item %U@var{suffix}
4736 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
4737 new one if there is no such last file name.  In the absence of any
4738 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
4739 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
4740 would involve the generation of two distinct file names, one
4741 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
4742 simply substituted with a file name chosen for the previous @samp{%u},
4743 without regard to any appended suffix.
4744
4745 @item %j@var{SUFFIX}
4746 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
4747 writable, and if save-temps is off; otherwise, substitute the name
4748 of a temporary file, just like @samp{%u}.  This temporary file is not
4749 meant for communication between processes, but rather as a junk
4750 disposal mechanism.
4751
4752 @item %.@var{SUFFIX}
4753 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
4754 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
4755 terminated by the next space or %.
4756
4757 @item %w
4758 Marks the argument containing or following the @samp{%w} as the
4759 designated output file of this compilation.  This puts the argument
4760 into the sequence of arguments that @samp{%o} will substitute later.
4761
4762 @item %o
4763 Substitutes the names of all the output files, with spaces
4764 automatically placed around them.  You should write spaces
4765 around the @samp{%o} as well or the results are undefined.
4766 @samp{%o} is for use in the specs for running the linker.
4767 Input files whose names have no recognized suffix are not compiled
4768 at all, but they are included among the output files, so they will
4769 be linked.
4770
4771 @item %O
4772 Substitutes the suffix for object files.  Note that this is
4773 handled specially when it immediately follows @samp{%g, %u, or %U},
4774 because of the need for those to form complete file names.  The
4775 handling is such that @samp{%O} is treated exactly as if it had already
4776 been substituted, except that @samp{%g, %u, and %U} do not currently
4777 support additional @var{suffix} characters following @samp{%O} as they would
4778 following, for example, @samp{.o}.
4779
4780 @item %p
4781 Substitutes the standard macro predefinitions for the
4782 current target machine.  Use this when running @code{cpp}.
4783
4784 @item %P
4785 Like @samp{%p}, but puts @samp{__} before and after the name of each
4786 predefined macro, except for macros that start with @samp{__} or with
4787 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
4788 C@.
4789
4790 @item %I
4791 Substitute a @option{-iprefix} option made from @env{GCC_EXEC_PREFIX}.
4792
4793 @item %s
4794 Current argument is the name of a library or startup file of some sort.
4795 Search for that file in a standard list of directories and substitute
4796 the full name found.
4797
4798 @item %e@var{str}
4799 Print @var{str} as an error message.  @var{str} is terminated by a newline.
4800 Use this when inconsistent options are detected.
4801
4802 @item %|
4803 Output @samp{-} if the input for the current command is coming from a pipe.
4804
4805 @item %(@var{name})
4806 Substitute the contents of spec string @var{name} at this point.
4807
4808 @item %[@var{name}]
4809 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
4810
4811 @item %x@{@var{option}@}
4812 Accumulate an option for @samp{%X}.
4813
4814 @item %X
4815 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
4816 spec string.
4817
4818 @item %Y
4819 Output the accumulated assembler options specified by @option{-Wa}.
4820
4821 @item %Z
4822 Output the accumulated preprocessor options specified by @option{-Wp}.
4823
4824 @item %v1
4825 Substitute the major version number of GCC@.
4826 (For version 2.9.5, this is 2.)
4827
4828 @item %v2
4829 Substitute the minor version number of GCC@.
4830 (For version 2.9.5, this is 9.)
4831
4832 @item %v3
4833 Substitute the patch level number of GCC@.
4834 (For version 2.9.5, this is 5.)
4835
4836 @item %a
4837 Process the @code{asm} spec.  This is used to compute the
4838 switches to be passed to the assembler.
4839
4840 @item %A
4841 Process the @code{asm_final} spec.  This is a spec string for
4842 passing switches to an assembler post-processor, if such a program is
4843 needed.
4844
4845 @item %l
4846 Process the @code{link} spec.  This is the spec for computing the
4847 command line passed to the linker.  Typically it will make use of the
4848 @samp{%L %G %S %D and %E} sequences.
4849
4850 @item %D
4851 Dump out a @option{-L} option for each directory that GCC believes might
4852 contain startup files.  If the target supports multilibs then the
4853 current multilib directory will be prepended to each of these paths.
4854
4855 @item %M
4856 Output the multilib directory with directory separators replaced with
4857 @samp{_}.  If multilib directories are not set, or the multilib directory is
4858 @file{.} then this option emits nothing.
4859
4860 @item %L
4861 Process the @code{lib} spec.  This is a spec string for deciding which
4862 libraries should be included on the command line to the linker.
4863
4864 @item %G
4865 Process the @code{libgcc} spec.  This is a spec string for deciding
4866 which GCC support library should be included on the command line to the linker.
4867
4868 @item %S
4869 Process the @code{startfile} spec.  This is a spec for deciding which
4870 object files should be the first ones passed to the linker.  Typically
4871 this might be a file named @file{crt0.o}.
4872
4873 @item %E
4874 Process the @code{endfile} spec.  This is a spec string that specifies
4875 the last object files that will be passed to the linker.
4876
4877 @item %C
4878 Process the @code{cpp} spec.  This is used to construct the arguments
4879 to be passed to the C preprocessor.
4880
4881 @item %c
4882 Process the @code{signed_char} spec.  This is intended to be used
4883 to tell cpp whether a char is signed.  It typically has the definition:
4884 @smallexample
4885 %@{funsigned-char:-D__CHAR_UNSIGNED__@}
4886 @end smallexample
4887
4888 @item %1
4889 Process the @code{cc1} spec.  This is used to construct the options to be
4890 passed to the actual C compiler (@samp{cc1}).
4891
4892 @item %2
4893 Process the @code{cc1plus} spec.  This is used to construct the options to be
4894 passed to the actual C++ compiler (@samp{cc1plus}).
4895
4896 @item %*
4897 Substitute the variable part of a matched option.  See below.
4898 Note that each comma in the substituted string is replaced by
4899 a single space.
4900
4901 @item %@{@code{S}@}
4902 Substitutes the @code{-S} switch, if that switch was given to GCC@.
4903 If that switch was not specified, this substitutes nothing.  Note that
4904 the leading dash is omitted when specifying this option, and it is
4905 automatically inserted if the substitution is performed.  Thus the spec
4906 string @samp{%@{foo@}} would match the command-line option @option{-foo}
4907 and would output the command line option @option{-foo}.
4908
4909 @item %W@{@code{S}@}
4910 Like %@{@code{S}@} but mark last argument supplied within as a file to be
4911 deleted on failure.
4912
4913 @item %@{@code{S}*@}
4914 Substitutes all the switches specified to GCC whose names start
4915 with @code{-S}, but which also take an argument.  This is used for
4916 switches like @option{-o}, @option{-D}, @option{-I}, etc.
4917 GCC considers @option{-o foo} as being
4918 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
4919 text, including the space.  Thus two arguments would be generated.
4920
4921 @item %@{^@code{S}*@}
4922 Like %@{@code{S}*@}, but don't put a blank between a switch and its
4923 argument.  Thus %@{^o*@} would only generate one argument, not two.
4924
4925 @item %@{@code{S}*&@code{T}*@}
4926 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
4927 (the order of @code{S} and @code{T} in the spec is not significant).
4928 There can be any number of ampersand-separated variables; for each the
4929 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
4930
4931 @item %@{<@code{S}@}
4932 Remove all occurrences of @code{-S} from the command line.  Note---this
4933 command is position dependent.  @samp{%} commands in the spec string
4934 before this option will see @code{-S}, @samp{%} commands in the spec
4935 string after this option will not.
4936
4937 @item %@{@code{S}*:@code{X}@}
4938 Substitutes @code{X} if one or more switches whose names start with
4939 @code{-S} are specified to GCC@.  Note that the tail part of the
4940 @code{-S} option (i.e.@: the part matched by the @samp{*}) will be substituted
4941 for each occurrence of @samp{%*} within @code{X}.
4942
4943 @item %@{@code{S}:@code{X}@}
4944 Substitutes @code{X}, but only if the @samp{-S} switch was given to GCC@.
4945
4946 @item %@{!@code{S}:@code{X}@}
4947 Substitutes @code{X}, but only if the @samp{-S} switch was @emph{not} given to GCC@.
4948
4949 @item %@{|@code{S}:@code{X}@}
4950 Like %@{@code{S}:@code{X}@}, but if no @code{S} switch, substitute @samp{-}.
4951
4952 @item %@{|!@code{S}:@code{X}@}
4953 Like %@{!@code{S}:@code{X}@}, but if there is an @code{S} switch, substitute @samp{-}.
4954
4955 @item %@{.@code{S}:@code{X}@}
4956 Substitutes @code{X}, but only if processing a file with suffix @code{S}.
4957
4958 @item %@{!.@code{S}:@code{X}@}
4959 Substitutes @code{X}, but only if @emph{not} processing a file with suffix @code{S}.
4960
4961 @item %@{@code{S}|@code{P}:@code{X}@}
4962 Substitutes @code{X} if either @code{-S} or @code{-P} was given to GCC@.  This may be
4963 combined with @samp{!} and @samp{.} sequences as well, although they
4964 have a stronger binding than the @samp{|}.  For example a spec string
4965 like this:
4966
4967 @smallexample
4968 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
4969 @end smallexample
4970
4971 will output the following command-line options from the following input
4972 command-line options:
4973
4974 @smallexample
4975 fred.c        -foo -baz
4976 jim.d         -bar -boggle
4977 -d fred.c     -foo -baz -boggle
4978 -d jim.d      -bar -baz -boggle
4979 @end smallexample
4980
4981 @end table
4982
4983 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or
4984 %@{!@code{S}:@code{X}@} construct may contain other nested @samp{%} constructs
4985 or spaces, or even newlines.  They are processed as usual, as described
4986 above.
4987
4988 The @option{-O}, @option{-f}, @option{-m}, and @option{-W}
4989 switches are handled specifically in these
4990 constructs.  If another value of @option{-O} or the negated form of a @option{-f}, @option{-m}, or
4991 @option{-W} switch is found later in the command line, the earlier switch
4992 value is ignored, except with @{@code{S}*@} where @code{S} is just one
4993 letter, which passes all matching options.
4994
4995 The character @samp{|} at the beginning of the predicate text is used to indicate
4996 that a command should be piped to the following command, but only if @option{-pipe}
4997 is specified.
4998
4999 It is built into GCC which switches take arguments and which do not.
5000 (You might think it would be useful to generalize this to allow each
5001 compiler's spec to say which switches take arguments.  But this cannot
5002 be done in a consistent fashion.  GCC cannot even decide which input
5003 files have been specified without knowing which switches take arguments,
5004 and it must know which input files to compile in order to tell which
5005 compilers to run).
5006
5007 GCC also knows implicitly that arguments starting in @option{-l} are to be
5008 treated as compiler output files, and passed to the linker in their
5009 proper position among the other output files.
5010
5011 @c man begin OPTIONS
5012
5013 @node Target Options
5014 @section Specifying Target Machine and Compiler Version
5015 @cindex target options
5016 @cindex cross compiling
5017 @cindex specifying machine version
5018 @cindex specifying compiler version and target machine
5019 @cindex compiler version, specifying
5020 @cindex target machine, specifying
5021
5022 By default, GCC compiles code for the same type of machine that you
5023 are using.  However, it can also be installed as a cross-compiler, to
5024 compile for some other type of machine.  In fact, several different
5025 configurations of GCC, for different target machines, can be
5026 installed side by side.  Then you specify which one to use with the
5027 @option{-b} option.
5028
5029 In addition, older and newer versions of GCC can be installed side
5030 by side.  One of them (probably the newest) will be the default, but
5031 you may sometimes wish to use another.
5032
5033 @table @gcctabopt
5034 @item -b @var{machine}
5035 @opindex b
5036 The argument @var{machine} specifies the target machine for compilation.
5037 This is useful when you have installed GCC as a cross-compiler.
5038
5039 The value to use for @var{machine} is the same as was specified as the
5040 machine type when configuring GCC as a cross-compiler.  For
5041 example, if a cross-compiler was configured with @samp{configure
5042 i386v}, meaning to compile for an 80386 running System V, then you
5043 would specify @option{-b i386v} to run that cross compiler.
5044
5045 When you do not specify @option{-b}, it normally means to compile for
5046 the same type of machine that you are using.
5047
5048 @item -V @var{version}
5049 @opindex V
5050 The argument @var{version} specifies which version of GCC to run.
5051 This is useful when multiple versions are installed.  For example,
5052 @var{version} might be @samp{2.0}, meaning to run GCC version 2.0.
5053
5054 The default version, when you do not specify @option{-V}, is the last
5055 version of GCC that you installed.
5056 @end table
5057
5058 The @option{-b} and @option{-V} options actually work by controlling part of
5059 the file name used for the executable files and libraries used for
5060 compilation.  A given version of GCC, for a given target machine, is
5061 normally kept in the directory @file{/usr/local/lib/gcc-lib/@var{machine}/@var{version}}.
5062
5063 Thus, sites can customize the effect of @option{-b} or @option{-V} either by
5064 changing the names of these directories or adding alternate names (or
5065 symbolic links).  If in directory @file{/usr/local/lib/gcc-lib/} the
5066 file @file{80386} is a link to the file @file{i386v}, then @option{-b
5067 80386} becomes an alias for @option{-b i386v}.
5068
5069 In one respect, the @option{-b} or @option{-V} do not completely change
5070 to a different compiler: the top-level driver program @command{gcc}
5071 that you originally invoked continues to run and invoke the other
5072 executables (preprocessor, compiler per se, assembler and linker)
5073 that do the real work.  However, since no real work is done in the
5074 driver program, it usually does not matter that the driver program
5075 in use is not the one for the specified target.  It is common for the
5076 interface to the other executables to change incompatibly between
5077 compiler versions, so unless the version specified is very close to that
5078 of the driver (for example, @option{-V 3.0} with a driver program from GCC
5079 version 3.0.1), use of @option{-V} may not work; for example, using
5080 @option{-V 2.95.2} will not work with a driver program from GCC 3.0.
5081
5082 The only way that the driver program depends on the target machine is
5083 in the parsing and handling of special machine-specific options.
5084 However, this is controlled by a file which is found, along with the
5085 other executables, in the directory for the specified version and
5086 target machine.  As a result, a single installed driver program adapts
5087 to any specified target machine, and sufficiently similar compiler
5088 versions.
5089
5090 The driver program executable does control one significant thing,
5091 however: the default version and target machine.  Therefore, you can
5092 install different instances of the driver program, compiled for
5093 different targets or versions, under different names.
5094
5095 For example, if the driver for version 2.0 is installed as @command{ogcc}
5096 and that for version 2.1 is installed as @command{gcc}, then the command
5097 @command{gcc} will use version 2.1 by default, while @command{ogcc} will use
5098 2.0 by default.  However, you can choose either version with either
5099 command with the @option{-V} option.
5100
5101 @node Submodel Options
5102 @section Hardware Models and Configurations
5103 @cindex submodel options
5104 @cindex specifying hardware config
5105 @cindex hardware models and configurations, specifying
5106 @cindex machine dependent options
5107
5108 Earlier we discussed the standard option @option{-b} which chooses among
5109 different installed compilers for completely different target
5110 machines, such as VAX vs.@: 68000 vs.@: 80386.
5111
5112 In addition, each of these target machine types can have its own
5113 special options, starting with @samp{-m}, to choose among various
5114 hardware models or configurations---for example, 68010 vs 68020,
5115 floating coprocessor or none.  A single installed version of the
5116 compiler can compile for any model or configuration, according to the
5117 options specified.
5118
5119 Some configurations of the compiler also support additional special
5120 options, usually for compatibility with other compilers on the same
5121 platform.
5122
5123 @ifset INTERNALS
5124 These options are defined by the macro @code{TARGET_SWITCHES} in the
5125 machine description.  The default for the options is also defined by
5126 that macro, which enables you to change the defaults.
5127 @end ifset
5128
5129 @menu
5130 * M680x0 Options::
5131 * M68hc1x Options::
5132 * VAX Options::
5133 * SPARC Options::
5134 * Convex Options::
5135 * AMD29K Options::
5136 * ARM Options::
5137 * MN10200 Options::
5138 * MN10300 Options::
5139 * M32R/D Options::
5140 * M88K Options::
5141 * RS/6000 and PowerPC Options::
5142 * RT Options::
5143 * MIPS Options::
5144 * i386 and x86-64 Options::
5145 * HPPA Options::
5146 * Intel 960 Options::
5147 * DEC Alpha Options::
5148 * Clipper Options::
5149 * H8/300 Options::
5150 * SH Options::
5151 * System V Options::
5152 * TMS320C3x/C4x Options::
5153 * V850 Options::
5154 * ARC Options::
5155 * NS32K Options::
5156 * AVR Options::
5157 * MCore Options::
5158 * IA-64 Options::
5159 * D30V Options::
5160 * S/390 and zSeries Options::
5161 * CRIS Options::
5162 * MMIX Options::
5163 @end menu
5164
5165 @node M680x0 Options
5166 @subsection M680x0 Options
5167 @cindex M680x0 options
5168
5169 These are the @samp{-m} options defined for the 68000 series.  The default
5170 values for these options depends on which style of 68000 was selected when
5171 the compiler was configured; the defaults for the most common choices are
5172 given below.
5173
5174 @table @gcctabopt
5175 @item -m68000
5176 @itemx -mc68000
5177 @opindex m68000
5178 @opindex mc68000
5179 Generate output for a 68000.  This is the default
5180 when the compiler is configured for 68000-based systems.
5181
5182 Use this option for microcontrollers with a 68000 or EC000 core,
5183 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
5184
5185 @item -m68020
5186 @itemx -mc68020
5187 @opindex m68020
5188 @opindex mc68020
5189 Generate output for a 68020.  This is the default
5190 when the compiler is configured for 68020-based systems.
5191
5192 @item -m68881
5193 @opindex m68881
5194 Generate output containing 68881 instructions for floating point.
5195 This is the default for most 68020 systems unless @option{--nfp} was
5196 specified when the compiler was configured.
5197
5198 @item -m68030
5199 @opindex m68030
5200 Generate output for a 68030.  This is the default when the compiler is
5201 configured for 68030-based systems.
5202
5203 @item -m68040
5204 @opindex m68040
5205 Generate output for a 68040.  This is the default when the compiler is
5206 configured for 68040-based systems.
5207
5208 This option inhibits the use of 68881/68882 instructions that have to be
5209 emulated by software on the 68040.  Use this option if your 68040 does not
5210 have code to emulate those instructions.
5211
5212 @item -m68060
5213 @opindex m68060
5214 Generate output for a 68060.  This is the default when the compiler is
5215 configured for 68060-based systems.
5216
5217 This option inhibits the use of 68020 and 68881/68882 instructions that
5218 have to be emulated by software on the 68060.  Use this option if your 68060
5219 does not have code to emulate those instructions.
5220
5221 @item -mcpu32
5222 @opindex mcpu32
5223 Generate output for a CPU32.  This is the default
5224 when the compiler is configured for CPU32-based systems.
5225
5226 Use this option for microcontrollers with a
5227 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
5228 68336, 68340, 68341, 68349 and 68360.
5229
5230 @item -m5200
5231 @opindex m5200
5232 Generate output for a 520X ``coldfire'' family cpu.  This is the default
5233 when the compiler is configured for 520X-based systems.
5234
5235 Use this option for microcontroller with a 5200 core, including
5236 the MCF5202, MCF5203, MCF5204 and MCF5202.
5237
5238
5239 @item -m68020-40
5240 @opindex m68020-40
5241 Generate output for a 68040, without using any of the new instructions.
5242 This results in code which can run relatively efficiently on either a
5243 68020/68881 or a 68030 or a 68040.  The generated code does use the
5244 68881 instructions that are emulated on the 68040.
5245
5246 @item -m68020-60
5247 @opindex m68020-60
5248 Generate output for a 68060, without using any of the new instructions.
5249 This results in code which can run relatively efficiently on either a
5250 68020/68881 or a 68030 or a 68040.  The generated code does use the
5251 68881 instructions that are emulated on the 68060.
5252
5253 @item -mfpa
5254 @opindex mfpa
5255 Generate output containing Sun FPA instructions for floating point.
5256
5257 @item -msoft-float
5258 @opindex msoft-float
5259 Generate output containing library calls for floating point.
5260 @strong{Warning:} the requisite libraries are not available for all m68k
5261 targets.  Normally the facilities of the machine's usual C compiler are
5262 used, but this can't be done directly in cross-compilation.  You must
5263 make your own arrangements to provide suitable library functions for
5264 cross-compilation.  The embedded targets @samp{m68k-*-aout} and
5265 @samp{m68k-*-coff} do provide software floating point support.
5266
5267 @item -mshort
5268 @opindex mshort
5269 Consider type @code{int} to be 16 bits wide, like @code{short int}.
5270
5271 @item -mnobitfield
5272 @opindex mnobitfield
5273 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
5274 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
5275
5276 @item -mbitfield
5277 @opindex mbitfield
5278 Do use the bit-field instructions.  The @option{-m68020} option implies
5279 @option{-mbitfield}.  This is the default if you use a configuration
5280 designed for a 68020.
5281
5282 @item -mrtd
5283 @opindex mrtd
5284 Use a different function-calling convention, in which functions
5285 that take a fixed number of arguments return with the @code{rtd}
5286 instruction, which pops their arguments while returning.  This
5287 saves one instruction in the caller since there is no need to pop
5288 the arguments there.
5289
5290 This calling convention is incompatible with the one normally
5291 used on Unix, so you cannot use it if you need to call libraries
5292 compiled with the Unix compiler.
5293
5294 Also, you must provide function prototypes for all functions that
5295 take variable numbers of arguments (including @code{printf});
5296 otherwise incorrect code will be generated for calls to those
5297 functions.
5298
5299 In addition, seriously incorrect code will result if you call a
5300 function with too many arguments.  (Normally, extra arguments are
5301 harmlessly ignored.)
5302
5303 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
5304 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
5305
5306 @item -malign-int
5307 @itemx -mno-align-int
5308 @opindex malign-int
5309 @opindex mno-align-int
5310 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
5311 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
5312 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
5313 Aligning variables on 32-bit boundaries produces code that runs somewhat
5314 faster on processors with 32-bit busses at the expense of more memory.
5315
5316 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
5317 align structures containing the above types  differently than
5318 most published application binary interface specifications for the m68k.
5319
5320 @item -mpcrel
5321 @opindex mpcrel
5322 Use the pc-relative addressing mode of the 68000 directly, instead of
5323 using a global offset table.  At present, this option implies @option{-fpic},
5324 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
5325 not presently supported with @option{-mpcrel}, though this could be supported for
5326 68020 and higher processors.
5327
5328 @item -mno-strict-align
5329 @itemx -mstrict-align
5330 @opindex mno-strict-align
5331 @opindex mstrict-align
5332 Do not (do) assume that unaligned memory references will be handled by
5333 the system.
5334
5335 @end table
5336
5337 @node M68hc1x Options
5338 @subsection M68hc1x Options
5339 @cindex M68hc1x options
5340
5341 These are the @samp{-m} options defined for the 68hc11 and 68hc12
5342 microcontrollers.  The default values for these options depends on
5343 which style of microcontroller was selected when the compiler was configured;
5344 the defaults for the most common choices are given below.
5345
5346 @table @gcctabopt
5347 @item -m6811
5348 @itemx -m68hc11
5349 @opindex m6811
5350 @opindex m68hc11
5351 Generate output for a 68HC11.  This is the default
5352 when the compiler is configured for 68HC11-based systems.
5353
5354 @item -m6812
5355 @itemx -m68hc12
5356 @opindex m6812
5357 @opindex m68hc12
5358 Generate output for a 68HC12.  This is the default
5359 when the compiler is configured for 68HC12-based systems.
5360
5361 @item -mauto-incdec
5362 @opindex mauto-incdec
5363 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
5364 addressing modes.
5365
5366 @item -mshort
5367 @opindex mshort
5368 Consider type @code{int} to be 16 bits wide, like @code{short int}.
5369
5370 @item -msoft-reg-count=@var{count}
5371 @opindex msoft-reg-count
5372 Specify the number of pseudo-soft registers which are used for the
5373 code generation.  The maximum number is 32.  Using more pseudo-soft
5374 register may or may not result in better code depending on the program.
5375 The default is 4 for 68HC11 and 2 for 68HC12.
5376
5377 @end table
5378
5379 @node VAX Options
5380 @subsection VAX Options
5381 @cindex VAX options
5382
5383 These @samp{-m} options are defined for the VAX:
5384
5385 @table @gcctabopt
5386 @item -munix
5387 @opindex munix
5388 Do not output certain jump instructions (@code{aobleq} and so on)
5389 that the Unix assembler for the VAX cannot handle across long
5390 ranges.
5391
5392 @item -mgnu
5393 @opindex mgnu
5394 Do output those jump instructions, on the assumption that you
5395 will assemble with the GNU assembler.
5396
5397 @item -mg
5398 @opindex mg
5399 Output code for g-format floating point numbers instead of d-format.
5400 @end table
5401
5402 @node SPARC Options
5403 @subsection SPARC Options
5404 @cindex SPARC options
5405
5406 These @samp{-m} switches are supported on the SPARC:
5407
5408 @table @gcctabopt
5409 @item -mno-app-regs
5410 @itemx -mapp-regs
5411 @opindex mno-app-regs
5412 @opindex mapp-regs
5413 Specify @option{-mapp-regs} to generate output using the global registers
5414 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
5415 is the default.
5416
5417 To be fully SVR4 ABI compliant at the cost of some performance loss,
5418 specify @option{-mno-app-regs}.  You should compile libraries and system
5419 software with this option.
5420
5421 @item -mfpu
5422 @itemx -mhard-float
5423 @opindex mfpu
5424 @opindex mhard-float
5425 Generate output containing floating point instructions.  This is the
5426 default.
5427
5428 @item -mno-fpu
5429 @itemx -msoft-float
5430 @opindex mno-fpu
5431 @opindex msoft-float
5432 Generate output containing library calls for floating point.
5433 @strong{Warning:} the requisite libraries are not available for all SPARC
5434 targets.  Normally the facilities of the machine's usual C compiler are
5435 used, but this cannot be done directly in cross-compilation.  You must make
5436 your own arrangements to provide suitable library functions for
5437 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
5438 @samp{sparclite-*-*} do provide software floating point support.
5439
5440 @option{-msoft-float} changes the calling convention in the output file;
5441 therefore, it is only useful if you compile @emph{all} of a program with
5442 this option.  In particular, you need to compile @file{libgcc.a}, the
5443 library that comes with GCC, with @option{-msoft-float} in order for
5444 this to work.
5445
5446 @item -mhard-quad-float
5447 @opindex mhard-quad-float
5448 Generate output containing quad-word (long double) floating point
5449 instructions.
5450
5451 @item -msoft-quad-float
5452 @opindex msoft-quad-float
5453 Generate output containing library calls for quad-word (long double)
5454 floating point instructions.  The functions called are those specified
5455 in the SPARC ABI@.  This is the default.
5456
5457 As of this writing, there are no sparc implementations that have hardware
5458 support for the quad-word floating point instructions.  They all invoke
5459 a trap handler for one of these instructions, and then the trap handler
5460 emulates the effect of the instruction.  Because of the trap handler overhead,
5461 this is much slower than calling the ABI library routines.  Thus the
5462 @option{-msoft-quad-float} option is the default.
5463
5464 @item -mno-epilogue
5465 @itemx -mepilogue
5466 @opindex mno-epilogue
5467 @opindex mepilogue
5468 With @option{-mepilogue} (the default), the compiler always emits code for
5469 function exit at the end of each function.  Any function exit in
5470 the middle of the function (such as a return statement in C) will
5471 generate a jump to the exit code at the end of the function.
5472
5473 With @option{-mno-epilogue}, the compiler tries to emit exit code inline
5474 at every function exit.
5475
5476 @item -mno-flat
5477 @itemx -mflat
5478 @opindex mno-flat
5479 @opindex mflat
5480 With @option{-mflat}, the compiler does not generate save/restore instructions
5481 and will use a ``flat'' or single register window calling convention.
5482 This model uses %i7 as the frame pointer and is compatible with the normal
5483 register window model.  Code from either may be intermixed.
5484 The local registers and the input registers (0--5) are still treated as
5485 ``call saved'' registers and will be saved on the stack as necessary.
5486
5487 With @option{-mno-flat} (the default), the compiler emits save/restore
5488 instructions (except for leaf functions) and is the normal mode of operation.
5489
5490 @item -mno-unaligned-doubles
5491 @itemx -munaligned-doubles
5492 @opindex mno-unaligned-doubles
5493 @opindex munaligned-doubles
5494 Assume that doubles have 8 byte alignment.  This is the default.
5495
5496 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
5497 alignment only if they are contained in another type, or if they have an
5498 absolute address.  Otherwise, it assumes they have 4 byte alignment.
5499 Specifying this option avoids some rare compatibility problems with code
5500 generated by other compilers.  It is not the default because it results
5501 in a performance loss, especially for floating point code.
5502
5503 @item -mno-faster-structs
5504 @itemx -mfaster-structs
5505 @opindex mno-faster-structs
5506 @opindex mfaster-structs
5507 With @option{-mfaster-structs}, the compiler assumes that structures
5508 should have 8 byte alignment.  This enables the use of pairs of
5509 @code{ldd} and @code{std} instructions for copies in structure
5510 assignment, in place of twice as many @code{ld} and @code{st} pairs.
5511 However, the use of this changed alignment directly violates the Sparc
5512 ABI@.  Thus, it's intended only for use on targets where the developer
5513 acknowledges that their resulting code will not be directly in line with
5514 the rules of the ABI@.
5515
5516 @item -mv8
5517 @itemx -msparclite
5518 @opindex mv8
5519 @opindex msparclite
5520 These two options select variations on the SPARC architecture.
5521
5522 By default (unless specifically configured for the Fujitsu SPARClite),
5523 GCC generates code for the v7 variant of the SPARC architecture.
5524
5525 @option{-mv8} will give you SPARC v8 code.  The only difference from v7
5526 code is that the compiler emits the integer multiply and integer
5527 divide instructions which exist in SPARC v8 but not in SPARC v7.
5528
5529 @option{-msparclite} will give you SPARClite code.  This adds the integer
5530 multiply, integer divide step and scan (@code{ffs}) instructions which
5531 exist in SPARClite but not in SPARC v7.
5532
5533 These options are deprecated and will be deleted in a future GCC release.
5534 They have been replaced with @option{-mcpu=xxx}.
5535
5536 @item -mcypress
5537 @itemx -msupersparc
5538 @opindex mcypress
5539 @opindex msupersparc
5540 These two options select the processor for which the code is optimised.
5541
5542 With @option{-mcypress} (the default), the compiler optimizes code for the
5543 Cypress CY7C602 chip, as used in the SparcStation/SparcServer 3xx series.
5544 This is also appropriate for the older SparcStation 1, 2, IPX etc.
5545
5546 With @option{-msupersparc} the compiler optimizes code for the SuperSparc cpu, as
5547 used in the SparcStation 10, 1000 and 2000 series.  This flag also enables use
5548 of the full SPARC v8 instruction set.
5549
5550 These options are deprecated and will be deleted in a future GCC release.
5551 They have been replaced with @option{-mcpu=xxx}.
5552
5553 @item -mcpu=@var{cpu_type}
5554 @opindex mcpu
5555 Set the instruction set, register set, and instruction scheduling parameters
5556 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
5557 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
5558 @samp{hypersparc}, @samp{sparclite86x}, @samp{f930}, @samp{f934},
5559 @samp{sparclet}, @samp{tsc701}, @samp{v9}, and @samp{ultrasparc}.
5560
5561 Default instruction scheduling parameters are used for values that select
5562 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
5563 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
5564
5565 Here is a list of each supported architecture and their supported
5566 implementations.
5567
5568 @smallexample
5569     v7:             cypress
5570     v8:             supersparc, hypersparc
5571     sparclite:      f930, f934, sparclite86x
5572     sparclet:       tsc701
5573     v9:             ultrasparc
5574 @end smallexample
5575
5576 @item -mtune=@var{cpu_type}
5577 @opindex mtune
5578 Set the instruction scheduling parameters for machine type
5579 @var{cpu_type}, but do not set the instruction set or register set that the
5580 option @option{-mcpu=@var{cpu_type}} would.
5581
5582 The same values for @option{-mcpu=@var{cpu_type}} can be used for
5583 @option{-mtune=@var{cpu_type}}, but the only useful values are those
5584 that select a particular cpu implementation.  Those are @samp{cypress},
5585 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
5586 @samp{sparclite86x}, @samp{tsc701}, and @samp{ultrasparc}.
5587
5588 @end table
5589
5590 These @samp{-m} switches are supported in addition to the above
5591 on the SPARCLET processor.
5592
5593 @table @gcctabopt
5594 @item -mlittle-endian
5595 @opindex mlittle-endian
5596 Generate code for a processor running in little-endian mode.
5597
5598 @item -mlive-g0
5599 @opindex mlive-g0
5600 Treat register @code{%g0} as a normal register.
5601 GCC will continue to clobber it as necessary but will not assume
5602 it always reads as 0.
5603
5604 @item -mbroken-saverestore
5605 @opindex mbroken-saverestore
5606 Generate code that does not use non-trivial forms of the @code{save} and
5607 @code{restore} instructions.  Early versions of the SPARCLET processor do
5608 not correctly handle @code{save} and @code{restore} instructions used with
5609 arguments.  They correctly handle them used without arguments.  A @code{save}
5610 instruction used without arguments increments the current window pointer
5611 but does not allocate a new stack frame.  It is assumed that the window
5612 overflow trap handler will properly handle this case as will interrupt
5613 handlers.
5614 @end table
5615
5616 These @samp{-m} switches are supported in addition to the above
5617 on SPARC V9 processors in 64-bit environments.
5618
5619 @table @gcctabopt
5620 @item -mlittle-endian
5621 @opindex mlittle-endian
5622 Generate code for a processor running in little-endian mode.
5623
5624 @item -m32
5625 @itemx -m64
5626 @opindex m32
5627 @opindex m64
5628 Generate code for a 32-bit or 64-bit environment.
5629 The 32-bit environment sets int, long and pointer to 32 bits.
5630 The 64-bit environment sets int to 32 bits and long and pointer
5631 to 64 bits.
5632
5633 @item -mcmodel=medlow
5634 @opindex mcmodel=medlow
5635 Generate code for the Medium/Low code model: the program must be linked
5636 in the low 32 bits of the address space.  Pointers are 64 bits.
5637 Programs can be statically or dynamically linked.
5638
5639 @item -mcmodel=medmid
5640 @opindex mcmodel=medmid
5641 Generate code for the Medium/Middle code model: the program must be linked
5642 in the low 44 bits of the address space, the text segment must be less than
5643 2G bytes, and data segment must be within 2G of the text segment.
5644 Pointers are 64 bits.
5645
5646 @item -mcmodel=medany
5647 @opindex mcmodel=medany
5648 Generate code for the Medium/Anywhere code model: the program may be linked
5649 anywhere in the address space, the text segment must be less than
5650 2G bytes, and data segment must be within 2G of the text segment.
5651 Pointers are 64 bits.
5652
5653 @item -mcmodel=embmedany
5654 @opindex mcmodel=embmedany
5655 Generate code for the Medium/Anywhere code model for embedded systems:
5656 assume a 32-bit text and a 32-bit data segment, both starting anywhere
5657 (determined at link time).  Register %g4 points to the base of the
5658 data segment.  Pointers are still 64 bits.
5659 Programs are statically linked, PIC is not supported.
5660
5661 @item -mstack-bias
5662 @itemx -mno-stack-bias
5663 @opindex mstack-bias
5664 @opindex mno-stack-bias
5665 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
5666 frame pointer if present, are offset by @minus{}2047 which must be added back
5667 when making stack frame references.
5668 Otherwise, assume no such offset is present.
5669 @end table
5670
5671 @node Convex Options
5672 @subsection Convex Options
5673 @cindex Convex options
5674
5675 These @samp{-m} options are defined for Convex:
5676
5677 @table @gcctabopt
5678 @item -mc1
5679 @opindex mc1
5680 Generate output for C1.  The code will run on any Convex machine.
5681 The preprocessor symbol @code{__convex__c1__} is defined.
5682
5683 @item -mc2
5684 @opindex mc2
5685 Generate output for C2.  Uses instructions not available on C1.
5686 Scheduling and other optimizations are chosen for max performance on C2.
5687 The preprocessor symbol @code{__convex_c2__} is defined.
5688
5689 @item -mc32
5690 @opindex mc32
5691 Generate output for C32xx.  Uses instructions not available on C1.
5692 Scheduling and other optimizations are chosen for max performance on C32.
5693 The preprocessor symbol @code{__convex_c32__} is defined.
5694
5695 @item -mc34
5696 @opindex mc34
5697 Generate output for C34xx.  Uses instructions not available on C1.
5698 Scheduling and other optimizations are chosen for max performance on C34.
5699 The preprocessor symbol @code{__convex_c34__} is defined.
5700
5701 @item -mc38
5702 @opindex mc38
5703 Generate output for C38xx.  Uses instructions not available on C1.
5704 Scheduling and other optimizations are chosen for max performance on C38.
5705 The preprocessor symbol @code{__convex_c38__} is defined.
5706
5707 @item -margcount
5708 @opindex margcount
5709 Generate code which puts an argument count in the word preceding each
5710 argument list.  This is compatible with regular CC, and a few programs
5711 may need the argument count word.  GDB and other source-level debuggers
5712 do not need it; this info is in the symbol table.
5713
5714 @item -mnoargcount
5715 @opindex mnoargcount
5716 Omit the argument count word.  This is the default.
5717
5718 @item -mvolatile-cache
5719 @opindex mvolatile-cache
5720 Allow volatile references to be cached.  This is the default.
5721
5722 @item -mvolatile-nocache
5723 @opindex mvolatile-nocache
5724 Volatile references bypass the data cache, going all the way to memory.
5725 This is only needed for multi-processor code that does not use standard
5726 synchronization instructions.  Making non-volatile references to volatile
5727 locations will not necessarily work.
5728
5729 @item -mlong32
5730 @opindex mlong32
5731 Type long is 32 bits, the same as type int.  This is the default.
5732
5733 @item -mlong64
5734 @opindex mlong64
5735 Type long is 64 bits, the same as type long long.  This option is useless,
5736 because no library support exists for it.
5737 @end table
5738
5739 @node AMD29K Options
5740 @subsection AMD29K Options
5741 @cindex AMD29K options
5742
5743 These @samp{-m} options are defined for the AMD Am29000:
5744
5745 @table @gcctabopt
5746 @item -mdw
5747 @opindex mdw
5748 @cindex DW bit (29k)
5749 Generate code that assumes the @code{DW} bit is set, i.e., that byte and
5750 halfword operations are directly supported by the hardware.  This is the
5751 default.
5752
5753 @item -mndw
5754 @opindex mndw
5755 Generate code that assumes the @code{DW} bit is not set.
5756
5757 @item -mbw
5758 @opindex mbw
5759 @cindex byte writes (29k)
5760 Generate code that assumes the system supports byte and halfword write
5761 operations.  This is the default.
5762
5763 @item -mnbw
5764 @opindex mnbw
5765 Generate code that assumes the systems does not support byte and
5766 halfword write operations.  @option{-mnbw} implies @option{-mndw}.
5767
5768 @item -msmall
5769 @opindex msmall
5770 @cindex memory model (29k)
5771 Use a small memory model that assumes that all function addresses are
5772 either within a single 256 KB segment or at an absolute address of less
5773 than 256k.  This allows the @code{call} instruction to be used instead
5774 of a @code{const}, @code{consth}, @code{calli} sequence.
5775
5776 @item -mnormal
5777 @opindex mnormal
5778 Use the normal memory model: Generate @code{call} instructions only when
5779 calling functions in the same file and @code{calli} instructions
5780 otherwise.  This works if each file occupies less than 256 KB but allows
5781 the entire executable to be larger than 256 KB@.  This is the default.
5782
5783 @item -mlarge
5784 @opindex mlarge
5785 Always use @code{calli} instructions.  Specify this option if you expect
5786 a single file to compile into more than 256 KB of code.
5787
5788 @item -m29050
5789 @opindex m29050
5790 @cindex processor selection (29k)
5791 Generate code for the Am29050.
5792
5793 @item -m29000
5794 @opindex m29000
5795 Generate code for the Am29000.  This is the default.
5796
5797 @item -mkernel-registers
5798 @opindex mkernel-registers
5799 @cindex kernel and user registers (29k)
5800 Generate references to registers @code{gr64-gr95} instead of to
5801 registers @code{gr96-gr127}.  This option can be used when compiling
5802 kernel code that wants a set of global registers disjoint from that used
5803 by user-mode code.
5804
5805 Note that when this option is used, register names in @samp{-f} flags
5806 must use the normal, user-mode, names.
5807
5808 @item -muser-registers
5809 @opindex muser-registers
5810 Use the normal set of global registers, @code{gr96-gr127}.  This is the
5811 default.
5812
5813 @item -mstack-check
5814 @itemx -mno-stack-check
5815 @opindex mstack-check
5816 @opindex mno-stack-check
5817 @cindex stack checks (29k)
5818 Insert (or do not insert) a call to @code{__msp_check} after each stack
5819 adjustment.  This is often used for kernel code.
5820
5821 @item -mstorem-bug
5822 @itemx -mno-storem-bug
5823 @opindex mstorem-bug
5824 @opindex mno-storem-bug
5825 @cindex storem bug (29k)
5826 @option{-mstorem-bug} handles 29k processors which cannot handle the
5827 separation of a mtsrim insn and a storem instruction (most 29000 chips
5828 to date, but not the 29050).
5829
5830 @item -mno-reuse-arg-regs
5831 @itemx -mreuse-arg-regs
5832 @opindex mno-reuse-arg-regs
5833 @opindex mreuse-arg-regs
5834 @option{-mno-reuse-arg-regs} tells the compiler to only use incoming argument
5835 registers for copying out arguments.  This helps detect calling a function
5836 with fewer arguments than it was declared with.
5837
5838 @item -mno-impure-text
5839 @itemx -mimpure-text
5840 @opindex mno-impure-text
5841 @opindex mimpure-text
5842 @option{-mimpure-text}, used in addition to @option{-shared}, tells the compiler to
5843 not pass @option{-assert pure-text} to the linker when linking a shared object.
5844
5845 @item -msoft-float
5846 @opindex msoft-float
5847 Generate output containing library calls for floating point.
5848 @strong{Warning:} the requisite libraries are not part of GCC@.
5849 Normally the facilities of the machine's usual C compiler are used, but
5850 this can't be done directly in cross-compilation.  You must make your
5851 own arrangements to provide suitable library functions for
5852 cross-compilation.
5853
5854 @item -mno-multm
5855 @opindex mno-multm
5856 Do not generate multm or multmu instructions.  This is useful for some embedded
5857 systems which do not have trap handlers for these instructions.
5858 @end table
5859
5860 @node ARM Options
5861 @subsection ARM Options
5862 @cindex ARM options
5863
5864 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
5865 architectures:
5866
5867 @table @gcctabopt
5868 @item -mapcs-frame
5869 @opindex mapcs-frame
5870 Generate a stack frame that is compliant with the ARM Procedure Call
5871 Standard for all functions, even if this is not strictly necessary for
5872 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
5873 with this option will cause the stack frames not to be generated for
5874 leaf functions.  The default is @option{-mno-apcs-frame}.
5875
5876 @item -mapcs
5877 @opindex mapcs
5878 This is a synonym for @option{-mapcs-frame}.
5879
5880 @item -mapcs-26
5881 @opindex mapcs-26
5882 Generate code for a processor running with a 26-bit program counter,
5883 and conforming to the function calling standards for the APCS 26-bit
5884 option.  This option replaces the @option{-m2} and @option{-m3} options
5885 of previous releases of the compiler.
5886
5887 @item -mapcs-32
5888 @opindex mapcs-32
5889 Generate code for a processor running with a 32-bit program counter,
5890 and conforming to the function calling standards for the APCS 32-bit
5891 option.  This option replaces the @option{-m6} option of previous releases
5892 of the compiler.
5893
5894 @ignore
5895 @c not currently implemented
5896 @item -mapcs-stack-check
5897 @opindex mapcs-stack-check
5898 Generate code to check the amount of stack space available upon entry to
5899 every function (that actually uses some stack space).  If there is
5900 insufficient space available then either the function
5901 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
5902 called, depending upon the amount of stack space required.  The run time
5903 system is required to provide these functions.  The default is
5904 @option{-mno-apcs-stack-check}, since this produces smaller code.
5905
5906 @c not currently implemented
5907 @item -mapcs-float
5908 @opindex mapcs-float
5909 Pass floating point arguments using the float point registers.  This is
5910 one of the variants of the APCS@.  This option is recommended if the
5911 target hardware has a floating point unit or if a lot of floating point
5912 arithmetic is going to be performed by the code.  The default is
5913 @option{-mno-apcs-float}, since integer only code is slightly increased in
5914 size if @option{-mapcs-float} is used.
5915
5916 @c not currently implemented
5917 @item -mapcs-reentrant
5918 @opindex mapcs-reentrant
5919 Generate reentrant, position independent code.  The default is
5920 @option{-mno-apcs-reentrant}.
5921 @end ignore
5922
5923 @item -mthumb-interwork
5924 @opindex mthumb-interwork
5925 Generate code which supports calling between the ARM and Thumb
5926 instruction sets.  Without this option the two instruction sets cannot
5927 be reliably used inside one program.  The default is
5928 @option{-mno-thumb-interwork}, since slightly larger code is generated
5929 when @option{-mthumb-interwork} is specified.
5930
5931 @item -mno-sched-prolog
5932 @opindex mno-sched-prolog
5933 Prevent the reordering of instructions in the function prolog, or the
5934 merging of those instruction with the instructions in the function's
5935 body.  This means that all functions will start with a recognizable set
5936 of instructions (or in fact one of a choice from a small set of
5937 different function prologues), and this information can be used to
5938 locate the start if functions inside an executable piece of code.  The
5939 default is @option{-msched-prolog}.
5940
5941 @item -mhard-float
5942 @opindex mhard-float
5943 Generate output containing floating point instructions.  This is the
5944 default.
5945
5946 @item -msoft-float
5947 @opindex msoft-float
5948 Generate output containing library calls for floating point.
5949 @strong{Warning:} the requisite libraries are not available for all ARM
5950 targets.  Normally the facilities of the machine's usual C compiler are
5951 used, but this cannot be done directly in cross-compilation.  You must make
5952 your own arrangements to provide suitable library functions for
5953 cross-compilation.
5954
5955 @option{-msoft-float} changes the calling convention in the output file;
5956 therefore, it is only useful if you compile @emph{all} of a program with
5957 this option.  In particular, you need to compile @file{libgcc.a}, the
5958 library that comes with GCC, with @option{-msoft-float} in order for
5959 this to work.
5960
5961 @item -mlittle-endian
5962 @opindex mlittle-endian
5963 Generate code for a processor running in little-endian mode.  This is
5964 the default for all standard configurations.
5965
5966 @item -mbig-endian
5967 @opindex mbig-endian
5968 Generate code for a processor running in big-endian mode; the default is
5969 to compile code for a little-endian processor.
5970
5971 @item -mwords-little-endian
5972 @opindex mwords-little-endian
5973 This option only applies when generating code for big-endian processors.
5974 Generate code for a little-endian word order but a big-endian byte
5975 order.  That is, a byte order of the form @samp{32107654}.  Note: this
5976 option should only be used if you require compatibility with code for
5977 big-endian ARM processors generated by versions of the compiler prior to
5978 2.8.
5979
5980 @item -malignment-traps
5981 @opindex malignment-traps
5982 Generate code that will not trap if the MMU has alignment traps enabled.
5983 On ARM architectures prior to ARMv4, there were no instructions to
5984 access half-word objects stored in memory.  However, when reading from
5985 memory a feature of the ARM architecture allows a word load to be used,
5986 even if the address is unaligned, and the processor core will rotate the
5987 data as it is being loaded.  This option tells the compiler that such
5988 misaligned accesses will cause a MMU trap and that it should instead
5989 synthesise the access as a series of byte accesses.  The compiler can
5990 still use word accesses to load half-word data if it knows that the
5991 address is aligned to a word boundary.
5992
5993 This option is ignored when compiling for ARM architecture 4 or later,
5994 since these processors have instructions to directly access half-word
5995 objects in memory.
5996
5997 @item -mno-alignment-traps
5998 @opindex mno-alignment-traps
5999 Generate code that assumes that the MMU will not trap unaligned
6000 accesses.  This produces better code when the target instruction set
6001 does not have half-word memory operations (i.e.@: implementations prior to
6002 ARMv4).
6003
6004 Note that you cannot use this option to access unaligned word objects,
6005 since the processor will only fetch one 32-bit aligned object from
6006 memory.
6007
6008 The default setting for most targets is @option{-mno-alignment-traps}, since
6009 this produces better code when there are no half-word memory
6010 instructions available.
6011
6012 @item -mshort-load-bytes
6013 @itemx -mno-short-load-words
6014 @opindex mshort-load-bytes
6015 @opindex mno-short-load-words
6016 These are deprecated aliases for @option{-malignment-traps}.
6017
6018 @item -mno-short-load-bytes
6019 @itemx -mshort-load-words
6020 @opindex mno-short-load-bytes
6021 @opindex mshort-load-words
6022 This are deprecated aliases for @option{-mno-alignment-traps}.
6023
6024 @item -mbsd
6025 @opindex mbsd
6026 This option only applies to RISC iX@.  Emulate the native BSD-mode
6027 compiler.  This is the default if @option{-ansi} is not specified.
6028
6029 @item -mxopen
6030 @opindex mxopen
6031 This option only applies to RISC iX@.  Emulate the native X/Open-mode
6032 compiler.
6033
6034 @item -mno-symrename
6035 @opindex mno-symrename
6036 This option only applies to RISC iX@.  Do not run the assembler
6037 post-processor, @samp{symrename}, after code has been assembled.
6038 Normally it is necessary to modify some of the standard symbols in
6039 preparation for linking with the RISC iX C library; this option
6040 suppresses this pass.  The post-processor is never run when the
6041 compiler is built for cross-compilation.
6042
6043 @item -mcpu=@var{name}
6044 @opindex mcpu
6045 This specifies the name of the target ARM processor.  GCC uses this name
6046 to determine what kind of instructions it can emit when generating
6047 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
6048 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
6049 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
6050 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
6051 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
6052 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm8},
6053 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
6054 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
6055 @samp{arm920t}, @samp{arm940t}, @samp{arm9tdmi}, @samp{arm10tdmi},
6056 @samp{arm1020t}, @samp{xscale}.
6057
6058 @itemx -mtune=@var{name}
6059 @opindex mtune
6060 This option is very similar to the @option{-mcpu=} option, except that
6061 instead of specifying the actual target processor type, and hence
6062 restricting which instructions can be used, it specifies that GCC should
6063 tune the performance of the code as if the target were of the type
6064 specified in this option, but still choosing the instructions that it
6065 will generate based on the cpu specified by a @option{-mcpu=} option.
6066 For some ARM implementations better performance can be obtained by using
6067 this option.
6068
6069 @item -march=@var{name}
6070 @opindex march
6071 This specifies the name of the target ARM architecture.  GCC uses this
6072 name to determine what kind of instructions it can emit when generating
6073 assembly code.  This option can be used in conjunction with or instead
6074 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
6075 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
6076 @samp{armv5}, @samp{armv5t}, @samp{armv5te}.
6077
6078 @item -mfpe=@var{number}
6079 @itemx -mfp=@var{number}
6080 @opindex mfpe
6081 @opindex mfp
6082 This specifies the version of the floating point emulation available on
6083 the target.  Permissible values are 2 and 3.  @option{-mfp=} is a synonym
6084 for @option{-mfpe=}, for compatibility with older versions of GCC@.
6085
6086 @item -mstructure-size-boundary=@var{n}
6087 @opindex mstructure-size-boundary
6088 The size of all structures and unions will be rounded up to a multiple
6089 of the number of bits set by this option.  Permissible values are 8 and
6090 32.  The default value varies for different toolchains.  For the COFF
6091 targeted toolchain the default value is 8.  Specifying the larger number
6092 can produce faster, more efficient code, but can also increase the size
6093 of the program.  The two values are potentially incompatible.  Code
6094 compiled with one value cannot necessarily expect to work with code or
6095 libraries compiled with the other value, if they exchange information
6096 using structures or unions.
6097
6098 @item -mabort-on-noreturn
6099 @opindex mabort-on-noreturn
6100 Generate a call to the function @code{abort} at the end of a
6101 @code{noreturn} function.  It will be executed if the function tries to
6102 return.
6103
6104 @item -mlong-calls
6105 @itemx -mno-long-calls
6106 @opindex mlong-calls
6107 @opindex mno-long-calls
6108 Tells the compiler to perform function calls by first loading the
6109 address of the function into a register and then performing a subroutine
6110 call on this register.  This switch is needed if the target function
6111 will lie outside of the 64 megabyte addressing range of the offset based
6112 version of subroutine call instruction.
6113
6114 Even if this switch is enabled, not all function calls will be turned
6115 into long calls.  The heuristic is that static functions, functions
6116 which have the @samp{short-call} attribute, functions that are inside
6117 the scope of a @samp{#pragma no_long_calls} directive and functions whose
6118 definitions have already been compiled within the current compilation
6119 unit, will not be turned into long calls.  The exception to this rule is
6120 that weak function definitions, functions with the @samp{long-call}
6121 attribute or the @samp{section} attribute, and functions that are within
6122 the scope of a @samp{#pragma long_calls} directive, will always be
6123 turned into long calls.
6124
6125 This feature is not enabled by default.  Specifying
6126 @option{-mno-long-calls} will restore the default behaviour, as will
6127 placing the function calls within the scope of a @samp{#pragma
6128 long_calls_off} directive.  Note these switches have no effect on how
6129 the compiler generates code to handle function calls via function
6130 pointers.
6131
6132 @item -mnop-fun-dllimport
6133 @opindex mnop-fun-dllimport
6134 Disable support for the @code{dllimport} attribute.
6135
6136 @item -msingle-pic-base
6137 @opindex msingle-pic-base
6138 Treat the register used for PIC addressing as read-only, rather than
6139 loading it in the prologue for each function.  The run-time system is
6140 responsible for initialising this register with an appropriate value
6141 before execution begins.
6142
6143 @item -mpic-register=@var{reg}
6144 @opindex mpic-register
6145 Specify the register to be used for PIC addressing.  The default is R10
6146 unless stack-checking is enabled, when R9 is used.
6147
6148 @item -mpoke-function-name
6149 @opindex mpoke-function-name
6150 Write the name of each function into the text section, directly
6151 preceding the function prologue.  The generated code is similar to this:
6152
6153 @smallexample
6154      t0
6155          .ascii "arm_poke_function_name", 0
6156          .align
6157      t1
6158          .word 0xff000000 + (t1 - t0)
6159      arm_poke_function_name
6160          mov     ip, sp
6161          stmfd   sp!, @{fp, ip, lr, pc@}
6162          sub     fp, ip, #4
6163 @end smallexample
6164
6165 When performing a stack backtrace, code can inspect the value of
6166 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
6167 location @code{pc - 12} and the top 8 bits are set, then we know that
6168 there is a function name embedded immediately preceding this location
6169 and has length @code{((pc[-3]) & 0xff000000)}.
6170
6171 @item -mthumb
6172 @opindex mthumb
6173 Generate code for the 16-bit Thumb instruction set.  The default is to
6174 use the 32-bit ARM instruction set.
6175
6176 @item -mtpcs-frame
6177 @opindex mtpcs-frame
6178 Generate a stack frame that is compliant with the Thumb Procedure Call
6179 Standard for all non-leaf functions.  (A leaf function is one that does
6180 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
6181
6182 @item -mtpcs-leaf-frame
6183 @opindex mtpcs-leaf-frame
6184 Generate a stack frame that is compliant with the Thumb Procedure Call
6185 Standard for all leaf functions.  (A leaf function is one that does
6186 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
6187
6188 @item -mcallee-super-interworking
6189 @opindex mcallee-super-interworking
6190 Gives all externally visible functions in the file being compiled an ARM
6191 instruction set header which switches to Thumb mode before executing the
6192 rest of the function.  This allows these functions to be called from
6193 non-interworking code.
6194
6195 @item -mcaller-super-interworking
6196 @opindex mcaller-super-interworking
6197 Allows calls via function pointers (including virtual functions) to
6198 execute correctly regardless of whether the target code has been
6199 compiled for interworking or not.  There is a small overhead in the cost
6200 of executing a function pointer if this option is enabled.
6201
6202 @end table
6203
6204 @node MN10200 Options
6205 @subsection MN10200 Options
6206 @cindex MN10200 options
6207 These @option{-m} options are defined for Matsushita MN10200 architectures:
6208 @table @gcctabopt
6209
6210 @item -mrelax
6211 @opindex mrelax
6212 Indicate to the linker that it should perform a relaxation optimization pass
6213 to shorten branches, calls and absolute memory addresses.  This option only
6214 has an effect when used on the command line for the final link step.
6215
6216 This option makes symbolic debugging impossible.
6217 @end table
6218
6219 @node MN10300 Options
6220 @subsection MN10300 Options
6221 @cindex MN10300 options
6222 These @option{-m} options are defined for Matsushita MN10300 architectures:
6223
6224 @table @gcctabopt
6225 @item -mmult-bug
6226 @opindex mmult-bug
6227 Generate code to avoid bugs in the multiply instructions for the MN10300
6228 processors.  This is the default.
6229
6230 @item -mno-mult-bug
6231 @opindex mno-mult-bug
6232 Do not generate code to avoid bugs in the multiply instructions for the
6233 MN10300 processors.
6234
6235 @item -mam33
6236 @opindex mam33
6237 Generate code which uses features specific to the AM33 processor.
6238
6239 @item -mno-am33
6240 @opindex mno-am33
6241 Do not generate code which uses features specific to the AM33 processor.  This
6242 is the default.
6243
6244 @item -mno-crt0
6245 @opindex mno-crt0
6246 Do not link in the C run-time initialization object file.
6247
6248 @item -mrelax
6249 @opindex mrelax
6250 Indicate to the linker that it should perform a relaxation optimization pass
6251 to shorten branches, calls and absolute memory addresses.  This option only
6252 has an effect when used on the command line for the final link step.
6253
6254 This option makes symbolic debugging impossible.
6255 @end table
6256
6257
6258 @node M32R/D Options
6259 @subsection M32R/D Options
6260 @cindex M32R/D options
6261
6262 These @option{-m} options are defined for Mitsubishi M32R/D architectures:
6263
6264 @table @gcctabopt
6265 @item -m32rx
6266 @opindex m32rx
6267 Generate code for the M32R/X@.
6268
6269 @item -m32r
6270 @opindex m32r
6271 Generate code for the M32R@.  This is the default.
6272
6273 @item -mcode-model=small
6274 @opindex mcode-model=small
6275 Assume all objects live in the lower 16MB of memory (so that their addresses
6276 can be loaded with the @code{ld24} instruction), and assume all subroutines
6277 are reachable with the @code{bl} instruction.
6278 This is the default.
6279
6280 The addressability of a particular object can be set with the
6281 @code{model} attribute.
6282
6283 @item -mcode-model=medium
6284 @opindex mcode-model=medium
6285 Assume objects may be anywhere in the 32-bit address space (the compiler
6286 will generate @code{seth/add3} instructions to load their addresses), and
6287 assume all subroutines are reachable with the @code{bl} instruction.
6288
6289 @item -mcode-model=large
6290 @opindex mcode-model=large
6291 Assume objects may be anywhere in the 32-bit address space (the compiler
6292 will generate @code{seth/add3} instructions to load their addresses), and
6293 assume subroutines may not be reachable with the @code{bl} instruction
6294 (the compiler will generate the much slower @code{seth/add3/jl}
6295 instruction sequence).
6296
6297 @item -msdata=none
6298 @opindex msdata=none
6299 Disable use of the small data area.  Variables will be put into
6300 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
6301 @code{section} attribute has been specified).
6302 This is the default.
6303
6304 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
6305 Objects may be explicitly put in the small data area with the
6306 @code{section} attribute using one of these sections.
6307
6308 @item -msdata=sdata
6309 @opindex msdata=sdata
6310 Put small global and static data in the small data area, but do not
6311 generate special code to reference them.
6312
6313 @item -msdata=use
6314 @opindex msdata=use
6315 Put small global and static data in the small data area, and generate
6316 special instructions to reference them.
6317
6318 @item -G @var{num}
6319 @opindex G
6320 @cindex smaller data references
6321 Put global and static objects less than or equal to @var{num} bytes
6322 into the small data or bss sections instead of the normal data or bss
6323 sections.  The default value of @var{num} is 8.
6324 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
6325 for this option to have any effect.
6326
6327 All modules should be compiled with the same @option{-G @var{num}} value.
6328 Compiling with different values of @var{num} may or may not work; if it
6329 doesn't the linker will give an error message---incorrect code will not be
6330 generated.
6331
6332 @end table
6333
6334 @node M88K Options
6335 @subsection M88K Options
6336 @cindex M88k options
6337
6338 These @samp{-m} options are defined for Motorola 88k architectures:
6339
6340 @table @gcctabopt
6341 @item -m88000
6342 @opindex m88000
6343 Generate code that works well on both the m88100 and the
6344 m88110.
6345
6346 @item -m88100
6347 @opindex m88100
6348 Generate code that works best for the m88100, but that also
6349 runs on the m88110.
6350
6351 @item -m88110
6352 @opindex m88110
6353 Generate code that works best for the m88110, and may not run
6354 on the m88100.
6355
6356 @item -mbig-pic
6357 @opindex mbig-pic
6358 Obsolete option to be removed from the next revision.
6359 Use @option{-fPIC}.
6360
6361 @item -midentify-revision
6362 @opindex midentify-revision
6363 @cindex identifying source, compiler (88k)
6364 Include an @code{ident} directive in the assembler output recording the
6365 source file name, compiler name and version, timestamp, and compilation
6366 flags used.
6367
6368 @item -mno-underscores
6369 @opindex mno-underscores
6370 @cindex underscores, avoiding (88k)
6371 In assembler output, emit symbol names without adding an underscore
6372 character at the beginning of each name.  The default is to use an
6373 underscore as prefix on each name.
6374
6375 @item -mocs-debug-info
6376 @itemx -mno-ocs-debug-info
6377 @opindex mocs-debug-info
6378 @opindex mno-ocs-debug-info
6379 @cindex OCS (88k)
6380 @cindex debugging, 88k OCS
6381 Include (or omit) additional debugging information (about registers used
6382 in each stack frame) as specified in the 88open Object Compatibility
6383 Standard, ``OCS''@.  This extra information allows debugging of code that
6384 has had the frame pointer eliminated.  The default for DG/UX, SVr4, and
6385 Delta 88 SVr3.2 is to include this information; other 88k configurations
6386 omit this information by default.
6387
6388 @item -mocs-frame-position
6389 @opindex mocs-frame-position
6390 @cindex register positions in frame (88k)
6391 When emitting COFF debugging information for automatic variables and
6392 parameters stored on the stack, use the offset from the canonical frame
6393 address, which is the stack pointer (register 31) on entry to the
6394 function.  The DG/UX, SVr4, Delta88 SVr3.2, and BCS configurations use
6395 @option{-mocs-frame-position}; other 88k configurations have the default
6396 @option{-mno-ocs-frame-position}.
6397
6398 @item -mno-ocs-frame-position
6399 @opindex mno-ocs-frame-position
6400 @cindex register positions in frame (88k)
6401 When emitting COFF debugging information for automatic variables and
6402 parameters stored on the stack, use the offset from the frame pointer
6403 register (register 30).  When this option is in effect, the frame
6404 pointer is not eliminated when debugging information is selected by the
6405 -g switch.
6406
6407 @item -moptimize-arg-area
6408 @opindex moptimize-arg-area
6409 @cindex arguments in frame (88k)
6410 Save space by reorganizing the stack frame.  This option generates code
6411 that does not agree with the 88open specifications, but uses less
6412 memory.
6413
6414 @itemx -mno-optimize-arg-area
6415 @opindex mno-optimize-arg-area
6416 Do not reorganize the stack frame to save space.  This is the default.
6417 The generated conforms to the specification, but uses more memory.
6418
6419 @item -mshort-data-@var{num}
6420 @opindex mshort-data
6421 @cindex smaller data references (88k)
6422 @cindex r0-relative references (88k)
6423 Generate smaller data references by making them relative to @code{r0},
6424 which allows loading a value using a single instruction (rather than the
6425 usual two).  You control which data references are affected by
6426 specifying @var{num} with this option.  For example, if you specify
6427 @option{-mshort-data-512}, then the data references affected are those
6428 involving displacements of less than 512 bytes.
6429 @option{-mshort-data-@var{num}} is not effective for @var{num} greater
6430 than 64k.
6431
6432 @item -mserialize-volatile
6433 @opindex mserialize-volatile
6434 @itemx -mno-serialize-volatile
6435 @opindex mno-serialize-volatile
6436 @cindex sequential consistency on 88k
6437 Do, or don't, generate code to guarantee sequential consistency
6438 of volatile memory references.  By default, consistency is
6439 guaranteed.
6440
6441 The order of memory references made by the MC88110 processor does
6442 not always match the order of the instructions requesting those
6443 references.  In particular, a load instruction may execute before
6444 a preceding store instruction.  Such reordering violates
6445 sequential consistency of volatile memory references, when there
6446 are multiple processors.   When consistency must be guaranteed,
6447 GCC generates special instructions, as needed, to force
6448 execution in the proper order.
6449
6450 The MC88100 processor does not reorder memory references and so
6451 always provides sequential consistency.  However, by default, GCC
6452 generates the special instructions to guarantee consistency
6453 even when you use @option{-m88100}, so that the code may be run on an
6454 MC88110 processor.  If you intend to run your code only on the
6455 MC88100 processor, you may use @option{-mno-serialize-volatile}.
6456
6457 The extra code generated to guarantee consistency may affect the
6458 performance of your application.  If you know that you can safely
6459 forgo this guarantee, you may use @option{-mno-serialize-volatile}.
6460
6461 @item -msvr4
6462 @itemx -msvr3
6463 @opindex msvr4
6464 @opindex msvr3
6465 @cindex assembler syntax, 88k
6466 @cindex SVr4
6467 Turn on (@option{-msvr4}) or off (@option{-msvr3}) compiler extensions
6468 related to System V release 4 (SVr4).  This controls the following:
6469
6470 @enumerate
6471 @item
6472 Which variant of the assembler syntax to emit.
6473 @item
6474 @option{-msvr4} makes the C preprocessor recognize @samp{#pragma weak}
6475 that is used on System V release 4.
6476 @item
6477 @option{-msvr4} makes GCC issue additional declaration directives used in
6478 SVr4.
6479 @end enumerate
6480
6481 @option{-msvr4} is the default for the m88k-motorola-sysv4 and
6482 m88k-dg-dgux m88k configurations.  @option{-msvr3} is the default for all
6483 other m88k configurations.
6484
6485 @item -mversion-03.00
6486 @opindex mversion-03.00
6487 This option is obsolete, and is ignored.
6488 @c ??? which asm syntax better for GAS?  option there too?
6489
6490 @item -mno-check-zero-division
6491 @itemx -mcheck-zero-division
6492 @opindex mno-check-zero-division
6493 @opindex mcheck-zero-division
6494 @cindex zero division on 88k
6495 Do, or don't, generate code to guarantee that integer division by
6496 zero will be detected.  By default, detection is guaranteed.
6497
6498 Some models of the MC88100 processor fail to trap upon integer
6499 division by zero under certain conditions.  By default, when
6500 compiling code that might be run on such a processor, GCC
6501 generates code that explicitly checks for zero-valued divisors
6502 and traps with exception number 503 when one is detected.  Use of
6503 @option{-mno-check-zero-division} suppresses such checking for code
6504 generated to run on an MC88100 processor.
6505
6506 GCC assumes that the MC88110 processor correctly detects all instances
6507 of integer division by zero.  When @option{-m88110} is specified, no
6508 explicit checks for zero-valued divisors are generated, and both
6509 @option{-mcheck-zero-division} and @option{-mno-check-zero-division} are
6510 ignored.
6511
6512 @item -muse-div-instruction
6513 @opindex muse-div-instruction
6514 @cindex divide instruction, 88k
6515 Use the div instruction for signed integer division on the
6516 MC88100 processor.  By default, the div instruction is not used.
6517
6518 On the MC88100 processor the signed integer division instruction
6519 div) traps to the operating system on a negative operand.  The
6520 operating system transparently completes the operation, but at a
6521 large cost in execution time.  By default, when compiling code
6522 that might be run on an MC88100 processor, GCC emulates signed
6523 integer division using the unsigned integer division instruction
6524 divu), thereby avoiding the large penalty of a trap to the
6525 operating system.  Such emulation has its own, smaller, execution
6526 cost in both time and space.  To the extent that your code's
6527 important signed integer division operations are performed on two
6528 nonnegative operands, it may be desirable to use the div
6529 instruction directly.
6530
6531 On the MC88110 processor the div instruction (also known as the
6532 divs instruction) processes negative operands without trapping to
6533 the operating system.  When @option{-m88110} is specified,
6534 @option{-muse-div-instruction} is ignored, and the div instruction is used
6535 for signed integer division.
6536
6537 Note that the result of dividing @code{INT_MIN} by @minus{}1 is undefined.  In
6538 particular, the behavior of such a division with and without
6539 @option{-muse-div-instruction} may differ.
6540
6541 @item -mtrap-large-shift
6542 @itemx -mhandle-large-shift
6543 @opindex mtrap-large-shift
6544 @opindex mhandle-large-shift
6545 @cindex bit shift overflow (88k)
6546 @cindex large bit shifts (88k)
6547 Include code to detect bit-shifts of more than 31 bits; respectively,
6548 trap such shifts or emit code to handle them properly.  By default GCC
6549 makes no special provision for large bit shifts.
6550
6551 @item -mwarn-passed-structs
6552 @opindex mwarn-passed-structs
6553 @cindex structure passing (88k)
6554 Warn when a function passes a struct as an argument or result.
6555 Structure-passing conventions have changed during the evolution of the C
6556 language, and are often the source of portability problems.  By default,
6557 GCC issues no such warning.
6558 @end table
6559
6560 @c break page here to avoid unsightly interparagraph stretch.
6561 @c -zw, 2001-8-17
6562 @page
6563
6564 @node RS/6000 and PowerPC Options
6565 @subsection IBM RS/6000 and PowerPC Options
6566 @cindex RS/6000 and PowerPC Options
6567 @cindex IBM RS/6000 and PowerPC Options
6568
6569 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
6570 @table @gcctabopt
6571 @item -mpower
6572 @itemx -mno-power
6573 @itemx -mpower2
6574 @itemx -mno-power2
6575 @itemx -mpowerpc
6576 @itemx -mno-powerpc
6577 @itemx -mpowerpc-gpopt
6578 @itemx -mno-powerpc-gpopt
6579 @itemx -mpowerpc-gfxopt
6580 @itemx -mno-powerpc-gfxopt
6581 @itemx -mpowerpc64
6582 @itemx -mno-powerpc64
6583 @opindex mpower
6584 @opindex mno-power
6585 @opindex mpower2
6586 @opindex mno-power2
6587 @opindex mpowerpc
6588 @opindex mno-powerpc
6589 @opindex mpowerpc-gpopt
6590 @opindex mno-powerpc-gpopt
6591 @opindex mpowerpc-gfxopt
6592 @opindex mno-powerpc-gfxopt
6593 @opindex mpowerpc64
6594 @opindex mno-powerpc64
6595 GCC supports two related instruction set architectures for the
6596 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
6597 instructions supported by the @samp{rios} chip set used in the original
6598 RS/6000 systems and the @dfn{PowerPC} instruction set is the
6599 architecture of the Motorola MPC5xx, MPC6xx, MPC8xx microprocessors, and
6600 the IBM 4xx microprocessors.
6601
6602 Neither architecture is a subset of the other.  However there is a
6603 large common subset of instructions supported by both.  An MQ
6604 register is included in processors supporting the POWER architecture.
6605
6606 You use these options to specify which instructions are available on the
6607 processor you are using.  The default value of these options is
6608 determined when configuring GCC@.  Specifying the
6609 @option{-mcpu=@var{cpu_type}} overrides the specification of these
6610 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
6611 rather than the options listed above.
6612
6613 The @option{-mpower} option allows GCC to generate instructions that
6614 are found only in the POWER architecture and to use the MQ register.
6615 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
6616 to generate instructions that are present in the POWER2 architecture but
6617 not the original POWER architecture.
6618
6619 The @option{-mpowerpc} option allows GCC to generate instructions that
6620 are found only in the 32-bit subset of the PowerPC architecture.
6621 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
6622 GCC to use the optional PowerPC architecture instructions in the
6623 General Purpose group, including floating-point square root.  Specifying
6624 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
6625 use the optional PowerPC architecture instructions in the Graphics
6626 group, including floating-point select.
6627
6628 The @option{-mpowerpc64} option allows GCC to generate the additional
6629 64-bit instructions that are found in the full PowerPC64 architecture
6630 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
6631 @option{-mno-powerpc64}.
6632
6633 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
6634 will use only the instructions in the common subset of both
6635 architectures plus some special AIX common-mode calls, and will not use
6636 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
6637 permits GCC to use any instruction from either architecture and to
6638 allow use of the MQ register; specify this for the Motorola MPC601.
6639
6640 @item -mnew-mnemonics
6641 @itemx -mold-mnemonics
6642 @opindex mnew-mnemonics
6643 @opindex mold-mnemonics
6644 Select which mnemonics to use in the generated assembler code.  With
6645 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
6646 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
6647 assembler mnemonics defined for the POWER architecture.  Instructions
6648 defined in only one architecture have only one mnemonic; GCC uses that
6649 mnemonic irrespective of which of these options is specified.
6650
6651 GCC defaults to the mnemonics appropriate for the architecture in
6652 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
6653 value of these option.  Unless you are building a cross-compiler, you
6654 should normally not specify either @option{-mnew-mnemonics} or
6655 @option{-mold-mnemonics}, but should instead accept the default.
6656
6657 @item -mcpu=@var{cpu_type}
6658 @opindex mcpu
6659 Set architecture type, register usage, choice of mnemonics, and
6660 instruction scheduling parameters for machine type @var{cpu_type}.
6661 Supported values for @var{cpu_type} are @samp{rios}, @samp{rios1},
6662 @samp{rsc}, @samp{rios2}, @samp{rs64a}, @samp{601}, @samp{602},
6663 @samp{603}, @samp{603e}, @samp{604}, @samp{604e}, @samp{620},
6664 @samp{630}, @samp{740}, @samp{7400}, @samp{7450}, @samp{750},
6665 @samp{power}, @samp{power2}, @samp{powerpc}, @samp{403}, @samp{505},
6666 @samp{801}, @samp{821}, @samp{823}, and @samp{860} and @samp{common}.
6667
6668 @option{-mcpu=common} selects a completely generic processor.  Code
6669 generated under this option will run on any POWER or PowerPC processor.
6670 GCC will use only the instructions in the common subset of both
6671 architectures, and will not use the MQ register.  GCC assumes a generic
6672 processor model for scheduling purposes.
6673
6674 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
6675 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
6676 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
6677 types, with an appropriate, generic processor model assumed for
6678 scheduling purposes.
6679
6680 The other options specify a specific processor.  Code generated under
6681 those options will run best on that processor, and may not run at all on
6682 others.
6683
6684 The @option{-mcpu} options automatically enable or disable other
6685 @option{-m} options as follows:
6686
6687 @table @samp
6688 @item common
6689 @option{-mno-power}, @option{-mno-powerc}
6690
6691 @item power
6692 @itemx power2
6693 @itemx rios1
6694 @itemx rios2
6695 @itemx rsc
6696 @option{-mpower}, @option{-mno-powerpc}, @option{-mno-new-mnemonics}
6697
6698 @item powerpc
6699 @itemx rs64a
6700 @itemx 602
6701 @itemx 603
6702 @itemx 603e
6703 @itemx 604
6704 @itemx 620
6705 @itemx 630
6706 @itemx 740
6707 @itemx 7400
6708 @itemx 7450
6709 @itemx 750
6710 @itemx 505
6711 @option{-mno-power}, @option{-mpowerpc}, @option{-mnew-mnemonics}
6712
6713 @item 601
6714 @option{-mpower}, @option{-mpowerpc}, @option{-mnew-mnemonics}
6715
6716 @item 403
6717 @itemx 821
6718 @itemx 860
6719 @option{-mno-power}, @option{-mpowerpc}, @option{-mnew-mnemonics}, @option{-msoft-float}
6720 @end table
6721
6722 @item -mtune=@var{cpu_type}
6723 @opindex mtune
6724 Set the instruction scheduling parameters for machine type
6725 @var{cpu_type}, but do not set the architecture type, register usage, or
6726 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
6727 values for @var{cpu_type} are used for @option{-mtune} as for
6728 @option{-mcpu}.  If both are specified, the code generated will use the
6729 architecture, registers, and mnemonics set by @option{-mcpu}, but the
6730 scheduling parameters set by @option{-mtune}.
6731
6732 @item -maltivec
6733 @itemx -mno-altivec
6734 @opindex maltivec
6735 @opindex mno-altivec
6736 These switches enable or disable the use of built-in functions that
6737 allow access to the AltiVec instruction set.  You may also need to set
6738 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
6739 enhancements.
6740
6741 @item -mfull-toc
6742 @itemx -mno-fp-in-toc
6743 @itemx -mno-sum-in-toc
6744 @itemx -mminimal-toc
6745 @opindex mfull-toc
6746 @opindex mno-fp-in-toc
6747 @opindex mno-sum-in-toc
6748 @opindex mminimal-toc
6749 Modify generation of the TOC (Table Of Contents), which is created for
6750 every executable file.  The @option{-mfull-toc} option is selected by
6751 default.  In that case, GCC will allocate at least one TOC entry for
6752 each unique non-automatic variable reference in your program.  GCC
6753 will also place floating-point constants in the TOC@.  However, only
6754 16,384 entries are available in the TOC@.
6755
6756 If you receive a linker error message that saying you have overflowed
6757 the available TOC space, you can reduce the amount of TOC space used
6758 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
6759 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
6760 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
6761 generate code to calculate the sum of an address and a constant at
6762 run-time instead of putting that sum into the TOC@.  You may specify one
6763 or both of these options.  Each causes GCC to produce very slightly
6764 slower and larger code at the expense of conserving TOC space.
6765
6766 If you still run out of space in the TOC even when you specify both of
6767 these options, specify @option{-mminimal-toc} instead.  This option causes
6768 GCC to make only one TOC entry for every file.  When you specify this
6769 option, GCC will produce code that is slower and larger but which
6770 uses extremely little TOC space.  You may wish to use this option
6771 only on files that contain less frequently executed code.
6772
6773 @item -maix64
6774 @itemx -maix32
6775 @opindex maix64
6776 @opindex maix32
6777 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
6778 @code{long} type, and the infrastructure needed to support them.
6779 Specifying @option{-maix64} implies @option{-mpowerpc64} and
6780 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
6781 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
6782
6783 @item -mxl-call
6784 @itemx -mno-xl-call
6785 @opindex mxl-call
6786 @opindex mno-xl-call
6787 On AIX, pass floating-point arguments to prototyped functions beyond the
6788 register save area (RSA) on the stack in addition to argument FPRs.  The
6789 AIX calling convention was extended but not initially documented to
6790 handle an obscure K&R C case of calling a function that takes the
6791 address of its arguments with fewer arguments than declared.  AIX XL
6792 compilers access floating point arguments which do not fit in the
6793 RSA from the stack when a subroutine is compiled without
6794 optimization.  Because always storing floating-point arguments on the
6795 stack is inefficient and rarely needed, this option is not enabled by
6796 default and only is necessary when calling subroutines compiled by AIX
6797 XL compilers without optimization.
6798
6799 @item -mthreads
6800 @opindex mthreads
6801 Support @dfn{AIX Threads}.  Link an application written to use
6802 @dfn{pthreads} with special libraries and startup code to enable the
6803 application to run.
6804
6805 @item -mpe
6806 @opindex mpe
6807 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
6808 application written to use message passing with special startup code to
6809 enable the application to run.  The system must have PE installed in the
6810 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
6811 must be overridden with the @option{-specs=} option to specify the
6812 appropriate directory location.  The Parallel Environment does not
6813 support threads, so the @option{-mpe} option and the @option{-mthreads}
6814 option are incompatible.
6815
6816 @item -msoft-float
6817 @itemx -mhard-float
6818 @opindex msoft-float
6819 @opindex mhard-float
6820 Generate code that does not use (uses) the floating-point register set.
6821 Software floating point emulation is provided if you use the
6822 @option{-msoft-float} option, and pass the option to GCC when linking.
6823
6824 @item -mmultiple
6825 @itemx -mno-multiple
6826 @opindex mmultiple
6827 @opindex mno-multiple
6828 Generate code that uses (does not use) the load multiple word
6829 instructions and the store multiple word instructions.  These
6830 instructions are generated by default on POWER systems, and not
6831 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
6832 endian PowerPC systems, since those instructions do not work when the
6833 processor is in little endian mode.  The exceptions are PPC740 and
6834 PPC750 which permit the instructions usage in little endian mode.
6835
6836 @item -mstring
6837 @itemx -mno-string
6838 @opindex mstring
6839 @opindex mno-string
6840 Generate code that uses (does not use) the load string instructions
6841 and the store string word instructions to save multiple registers and
6842 do small block moves.  These instructions are generated by default on
6843 POWER systems, and not generated on PowerPC systems.  Do not use
6844 @option{-mstring} on little endian PowerPC systems, since those
6845 instructions do not work when the processor is in little endian mode.
6846 The exceptions are PPC740 and PPC750 which permit the instructions
6847 usage in little endian mode.
6848
6849 @item -mupdate
6850 @itemx -mno-update
6851 @opindex mupdate
6852 @opindex mno-update
6853 Generate code that uses (does not use) the load or store instructions
6854 that update the base register to the address of the calculated memory
6855 location.  These instructions are generated by default.  If you use
6856 @option{-mno-update}, there is a small window between the time that the
6857 stack pointer is updated and the address of the previous frame is
6858 stored, which means code that walks the stack frame across interrupts or
6859 signals may get corrupted data.
6860
6861 @item -mfused-madd
6862 @itemx -mno-fused-madd
6863 @opindex mfused-madd
6864 @opindex mno-fused-madd
6865 Generate code that uses (does not use) the floating point multiply and
6866 accumulate instructions.  These instructions are generated by default if
6867 hardware floating is used.
6868
6869 @item -mno-bit-align
6870 @itemx -mbit-align
6871 @opindex mno-bit-align
6872 @opindex mbit-align
6873 On System V.4 and embedded PowerPC systems do not (do) force structures
6874 and unions that contain bit-fields to be aligned to the base type of the
6875 bit-field.
6876
6877 For example, by default a structure containing nothing but 8
6878 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
6879 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
6880 the structure would be aligned to a 1 byte boundary and be one byte in
6881 size.
6882
6883 @item -mno-strict-align
6884 @itemx -mstrict-align
6885 @opindex mno-strict-align
6886 @opindex mstrict-align
6887 On System V.4 and embedded PowerPC systems do not (do) assume that
6888 unaligned memory references will be handled by the system.
6889
6890 @item -mrelocatable
6891 @itemx -mno-relocatable
6892 @opindex mrelocatable
6893 @opindex mno-relocatable
6894 On embedded PowerPC systems generate code that allows (does not allow)
6895 the program to be relocated to a different address at runtime.  If you
6896 use @option{-mrelocatable} on any module, all objects linked together must
6897 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
6898
6899 @item -mrelocatable-lib
6900 @itemx -mno-relocatable-lib
6901 @opindex mrelocatable-lib
6902 @opindex mno-relocatable-lib
6903 On embedded PowerPC systems generate code that allows (does not allow)
6904 the program to be relocated to a different address at runtime.  Modules
6905 compiled with @option{-mrelocatable-lib} can be linked with either modules
6906 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
6907 with modules compiled with the @option{-mrelocatable} options.
6908
6909 @item -mno-toc
6910 @itemx -mtoc
6911 @opindex mno-toc
6912 @opindex mtoc
6913 On System V.4 and embedded PowerPC systems do not (do) assume that
6914 register 2 contains a pointer to a global area pointing to the addresses
6915 used in the program.
6916
6917 @item -mlittle
6918 @itemx -mlittle-endian
6919 @opindex mlittle
6920 @opindex mlittle-endian
6921 On System V.4 and embedded PowerPC systems compile code for the
6922 processor in little endian mode.  The @option{-mlittle-endian} option is
6923 the same as @option{-mlittle}.
6924
6925 @item -mbig
6926 @itemx -mbig-endian
6927 @opindex mbig
6928 @opindex mbig-endian
6929 On System V.4 and embedded PowerPC systems compile code for the
6930 processor in big endian mode.  The @option{-mbig-endian} option is
6931 the same as @option{-mbig}.
6932
6933 @item -mcall-sysv
6934 @opindex mcall-sysv
6935 On System V.4 and embedded PowerPC systems compile code using calling
6936 conventions that adheres to the March 1995 draft of the System V
6937 Application Binary Interface, PowerPC processor supplement.  This is the
6938 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
6939
6940 @item -mcall-sysv-eabi
6941 @opindex mcall-sysv-eabi
6942 Specify both @option{-mcall-sysv} and @option{-meabi} options.
6943
6944 @item -mcall-sysv-noeabi
6945 @opindex mcall-sysv-noeabi
6946 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
6947
6948 @item -mcall-aix
6949 @opindex mcall-aix
6950 On System V.4 and embedded PowerPC systems compile code using calling
6951 conventions that are similar to those used on AIX@.  This is the
6952 default if you configured GCC using @samp{powerpc-*-eabiaix}.
6953
6954 @item -mcall-solaris
6955 @opindex mcall-solaris
6956 On System V.4 and embedded PowerPC systems compile code for the Solaris
6957 operating system.
6958
6959 @item -mcall-linux
6960 @opindex mcall-linux
6961 On System V.4 and embedded PowerPC systems compile code for the
6962 Linux-based GNU system.
6963
6964 @item -mcall-netbsd
6965 @opindex mcall-netbsd
6966 On System V.4 and embedded PowerPC systems compile code for the
6967 NetBSD operating system.
6968
6969 @item -maix-struct-return
6970 @opindex maix-struct-return
6971 Return all structures in memory (as specified by the AIX ABI)@.
6972
6973 @item -msvr4-struct-return
6974 @opindex msvr4-struct-return
6975 Return structures smaller than 8 bytes in registers (as specified by the
6976 SVR4 ABI)@.
6977
6978 @item -mabi=altivec
6979 @opindex mabi=altivec
6980 Extend the current ABI with AltiVec ABI extensions.  This does not
6981 change the default ABI, instead it adds the AltiVec ABI extensions to
6982 the current ABI@.
6983
6984 @item -mprototype
6985 @itemx -mno-prototype
6986 @opindex mprototype
6987 @opindex mno-prototype
6988 On System V.4 and embedded PowerPC systems assume that all calls to
6989 variable argument functions are properly prototyped.  Otherwise, the
6990 compiler must insert an instruction before every non prototyped call to
6991 set or clear bit 6 of the condition code register (@var{CR}) to
6992 indicate whether floating point values were passed in the floating point
6993 registers in case the function takes a variable arguments.  With
6994 @option{-mprototype}, only calls to prototyped variable argument functions
6995 will set or clear the bit.
6996
6997 @item -msim
6998 @opindex msim
6999 On embedded PowerPC systems, assume that the startup module is called
7000 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
7001 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
7002 configurations.
7003
7004 @item -mmvme
7005 @opindex mmvme
7006 On embedded PowerPC systems, assume that the startup module is called
7007 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
7008 @file{libc.a}.
7009
7010 @item -mads
7011 @opindex mads
7012 On embedded PowerPC systems, assume that the startup module is called
7013 @file{crt0.o} and the standard C libraries are @file{libads.a} and
7014 @file{libc.a}.
7015
7016 @item -myellowknife
7017 @opindex myellowknife
7018 On embedded PowerPC systems, assume that the startup module is called
7019 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
7020 @file{libc.a}.
7021
7022 @item -mvxworks
7023 @opindex mvxworks
7024 On System V.4 and embedded PowerPC systems, specify that you are
7025 compiling for a VxWorks system.
7026
7027 @item -memb
7028 @opindex memb
7029 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
7030 header to indicate that @samp{eabi} extended relocations are used.
7031
7032 @item -meabi
7033 @itemx -mno-eabi
7034 @opindex meabi
7035 @opindex mno-eabi
7036 On System V.4 and embedded PowerPC systems do (do not) adhere to the
7037 Embedded Applications Binary Interface (eabi) which is a set of
7038 modifications to the System V.4 specifications.  Selecting @option{-meabi}
7039 means that the stack is aligned to an 8 byte boundary, a function
7040 @code{__eabi} is called to from @code{main} to set up the eabi
7041 environment, and the @option{-msdata} option can use both @code{r2} and
7042 @code{r13} to point to two separate small data areas.  Selecting
7043 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
7044 do not call an initialization function from @code{main}, and the
7045 @option{-msdata} option will only use @code{r13} to point to a single
7046 small data area.  The @option{-meabi} option is on by default if you
7047 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
7048
7049 @item -msdata=eabi
7050 @opindex msdata=eabi
7051 On System V.4 and embedded PowerPC systems, put small initialized
7052 @code{const} global and static data in the @samp{.sdata2} section, which
7053 is pointed to by register @code{r2}.  Put small initialized
7054 non-@code{const} global and static data in the @samp{.sdata} section,
7055 which is pointed to by register @code{r13}.  Put small uninitialized
7056 global and static data in the @samp{.sbss} section, which is adjacent to
7057 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
7058 incompatible with the @option{-mrelocatable} option.  The
7059 @option{-msdata=eabi} option also sets the @option{-memb} option.
7060
7061 @item -msdata=sysv
7062 @opindex msdata=sysv
7063 On System V.4 and embedded PowerPC systems, put small global and static
7064 data in the @samp{.sdata} section, which is pointed to by register
7065 @code{r13}.  Put small uninitialized global and static data in the
7066 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
7067 The @option{-msdata=sysv} option is incompatible with the
7068 @option{-mrelocatable} option.
7069
7070 @item -msdata=default
7071 @itemx -msdata
7072 @opindex msdata=default
7073 @opindex msdata
7074 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
7075 compile code the same as @option{-msdata=eabi}, otherwise compile code the
7076 same as @option{-msdata=sysv}.
7077
7078 @item -msdata-data
7079 @opindex msdata-data
7080 On System V.4 and embedded PowerPC systems, put small global and static
7081 data in the @samp{.sdata} section.  Put small uninitialized global and
7082 static data in the @samp{.sbss} section.  Do not use register @code{r13}
7083 to address small data however.  This is the default behavior unless
7084 other @option{-msdata} options are used.
7085
7086 @item -msdata=none
7087 @itemx -mno-sdata
7088 @opindex msdata=none
7089 @opindex mno-sdata
7090 On embedded PowerPC systems, put all initialized global and static data
7091 in the @samp{.data} section, and all uninitialized data in the
7092 @samp{.bss} section.
7093
7094 @item -G @var{num}
7095 @opindex G
7096 @cindex smaller data references (PowerPC)
7097 @cindex .sdata/.sdata2 references (PowerPC)
7098 On embedded PowerPC systems, put global and static items less than or
7099 equal to @var{num} bytes into the small data or bss sections instead of
7100 the normal data or bss section.  By default, @var{num} is 8.  The
7101 @option{-G @var{num}} switch is also passed to the linker.
7102 All modules should be compiled with the same @option{-G @var{num}} value.
7103
7104 @item -mregnames
7105 @itemx -mno-regnames
7106 @opindex mregnames
7107 @opindex mno-regnames
7108 On System V.4 and embedded PowerPC systems do (do not) emit register
7109 names in the assembly language output using symbolic forms.
7110
7111 @end table
7112
7113 @node RT Options
7114 @subsection IBM RT Options
7115 @cindex RT options
7116 @cindex IBM RT options
7117
7118 These @samp{-m} options are defined for the IBM RT PC:
7119
7120 @table @gcctabopt
7121 @item -min-line-mul
7122 @opindex min-line-mul
7123 Use an in-line code sequence for integer multiplies.  This is the
7124 default.
7125
7126 @item -mcall-lib-mul
7127 @opindex mcall-lib-mul
7128 Call @code{lmul$$} for integer multiples.
7129
7130 @item -mfull-fp-blocks
7131 @opindex mfull-fp-blocks
7132 Generate full-size floating point data blocks, including the minimum
7133 amount of scratch space recommended by IBM@.  This is the default.
7134
7135 @item -mminimum-fp-blocks
7136 @opindex mminimum-fp-blocks
7137 Do not include extra scratch space in floating point data blocks.  This
7138 results in smaller code, but slower execution, since scratch space must
7139 be allocated dynamically.
7140
7141 @cindex @file{varargs.h} and RT PC
7142 @cindex @file{stdarg.h} and RT PC
7143 @item -mfp-arg-in-fpregs
7144 @opindex mfp-arg-in-fpregs
7145 Use a calling sequence incompatible with the IBM calling convention in
7146 which floating point arguments are passed in floating point registers.
7147 Note that @code{varargs.h} and @code{stdarg.h} will not work with
7148 floating point operands if this option is specified.
7149
7150 @item -mfp-arg-in-gregs
7151 @opindex mfp-arg-in-gregs
7152 Use the normal calling convention for floating point arguments.  This is
7153 the default.
7154
7155 @item -mhc-struct-return
7156 @opindex mhc-struct-return
7157 Return structures of more than one word in memory, rather than in a
7158 register.  This provides compatibility with the MetaWare HighC (hc)
7159 compiler.  Use the option @option{-fpcc-struct-return} for compatibility
7160 with the Portable C Compiler (pcc).
7161
7162 @item -mnohc-struct-return
7163 @opindex mnohc-struct-return
7164 Return some structures of more than one word in registers, when
7165 convenient.  This is the default.  For compatibility with the
7166 IBM-supplied compilers, use the option @option{-fpcc-struct-return} or the
7167 option @option{-mhc-struct-return}.
7168 @end table
7169
7170 @node MIPS Options
7171 @subsection MIPS Options
7172 @cindex MIPS options
7173
7174 These @samp{-m} options are defined for the MIPS family of computers:
7175
7176 @table @gcctabopt
7177
7178 @item -march=@var{cpu-type}
7179 @opindex march
7180 Assume the defaults for the machine type @var{cpu-type} when generating
7181 instructions.  The choices for @var{cpu-type} are  @samp{r2000}, @samp{r3000},
7182 @samp{r3900}, @samp{r4000}, @samp{r4100}, @samp{r4300}, @samp{r4400},
7183 @samp{r4600}, @samp{r4650}, @samp{r5000}, @samp{r6000}, @samp{r8000},
7184 and @samp{orion}.  Additionally, the @samp{r2000}, @samp{r3000},
7185 @samp{r4000}, @samp{r5000}, and @samp{r6000} can be abbreviated as
7186 @samp{r2k} (or @samp{r2K}), @samp{r3k}, etc.
7187
7188 @item -mtune=@var{cpu-type}
7189 @opindex mtune
7190 Assume the defaults for the machine type @var{cpu-type} when scheduling
7191 instructions.  The choices for @var{cpu-type} are @samp{r2000}, @samp{r3000},
7192 @samp{r3900}, @samp{r4000}, @samp{r4100}, @samp{r4300}, @samp{r4400},
7193 @samp{r4600}, @samp{r4650}, @samp{r5000}, @samp{r6000}, @samp{r8000},
7194 and @samp{orion}.  Additionally, the @samp{r2000}, @samp{r3000},
7195 @samp{r4000}, @samp{r5000}, and @samp{r6000} can be abbreviated as
7196 @samp{r2k} (or @samp{r2K}), @samp{r3k}, etc.  While picking a specific
7197 @var{cpu-type} will schedule things appropriately for that particular
7198 chip, the compiler will not generate any code that does not meet level 1
7199 of the MIPS ISA (instruction set architecture) without a @option{-mipsX}
7200 or @option{-mabi} switch being used.
7201
7202 @item -mcpu=@var{cpu-type}
7203 @opindex mcpu
7204 This is identical to specifying both @option{-march} and @option{-mtune}.
7205
7206 @item -mips1
7207 @opindex mips1
7208 Issue instructions from level 1 of the MIPS ISA@.  This is the default.
7209 @samp{r3000} is the default @var{cpu-type} at this ISA level.
7210
7211 @item -mips2
7212 @opindex mips2
7213 Issue instructions from level 2 of the MIPS ISA (branch likely, square
7214 root instructions).  @samp{r6000} is the default @var{cpu-type} at this
7215 ISA level.
7216
7217 @item -mips3
7218 @opindex mips3
7219 Issue instructions from level 3 of the MIPS ISA (64-bit instructions).
7220 @samp{r4000} is the default @var{cpu-type} at this ISA level.
7221
7222 @item -mips4
7223 @opindex mips4
7224 Issue instructions from level 4 of the MIPS ISA (conditional move,
7225 prefetch, enhanced FPU instructions).  @samp{r8000} is the default
7226 @var{cpu-type} at this ISA level.
7227
7228 @item -mfp32
7229 @opindex mfp32
7230 Assume that 32 32-bit floating point registers are available.  This is
7231 the default.
7232
7233 @item -mfp64
7234 @opindex mfp64
7235 Assume that 32 64-bit floating point registers are available.  This is
7236 the default when the @option{-mips3} option is used.
7237
7238 @item -mfused-madd
7239 @itemx -mno-fused-madd
7240 @opindex mfused-madd
7241 @opindex mno-fused-madd
7242 Generate code that uses (does not use) the floating point multiply and
7243 accumulate instructions, when they are available.  These instructions
7244 are generated by default if they are available, but this may be
7245 undesirable if the extra precision causes problems or on certain chips
7246 in the mode where denormals are rounded to zero where denormals
7247 generated by multiply and accumulate instructions cause exceptions
7248 anyway.
7249
7250 @item -mgp32
7251 @opindex mgp32
7252 Assume that 32 32-bit general purpose registers are available.  This is
7253 the default.
7254
7255 @item -mgp64
7256 @opindex mgp64
7257 Assume that 32 64-bit general purpose registers are available.  This is
7258 the default when the @option{-mips3} option is used.
7259
7260 @item -mint64
7261 @opindex mint64
7262 Force int and long types to be 64 bits wide.  See @option{-mlong32} for an
7263 explanation of the default, and the width of pointers.
7264
7265 @item -mlong64
7266 @opindex mlong64
7267 Force long types to be 64 bits wide.  See @option{-mlong32} for an
7268 explanation of the default, and the width of pointers.
7269
7270 @item -mlong32
7271 @opindex mlong32
7272 Force long, int, and pointer types to be 32 bits wide.
7273
7274 If none of @option{-mlong32}, @option{-mlong64}, or @option{-mint64} are set,
7275 the size of ints, longs, and pointers depends on the ABI and ISA chosen.
7276 For @option{-mabi=32}, and @option{-mabi=n32}, ints and longs are 32 bits
7277 wide.  For @option{-mabi=64}, ints are 32 bits, and longs are 64 bits wide.
7278 For @option{-mabi=eabi} and either @option{-mips1} or @option{-mips2}, ints
7279 and longs are 32 bits wide.  For @option{-mabi=eabi} and higher ISAs, ints
7280 are 32 bits, and longs are 64 bits wide.  The width of pointer types is
7281 the smaller of the width of longs or the width of general purpose
7282 registers (which in turn depends on the ISA)@.
7283
7284 @item -mabi=32
7285 @itemx -mabi=o64
7286 @itemx -mabi=n32
7287 @itemx -mabi=64
7288 @itemx -mabi=eabi
7289 @opindex mabi=32
7290 @opindex mabi=o64
7291 @opindex mabi=n32
7292 @opindex mabi=64
7293 @opindex mabi=eabi
7294 Generate code for the indicated ABI@.  The default instruction level is
7295 @option{-mips1} for @samp{32}, @option{-mips3} for @samp{n32}, and
7296 @option{-mips4} otherwise.  Conversely, with @option{-mips1} or
7297 @option{-mips2}, the default ABI is @samp{32}; otherwise, the default ABI
7298 is @samp{64}.
7299
7300 @item -mmips-as
7301 @opindex mmips-as
7302 Generate code for the MIPS assembler, and invoke @file{mips-tfile} to
7303 add normal debug information.  This is the default for all
7304 platforms except for the OSF/1 reference platform, using the OSF/rose
7305 object format.  If the either of the @option{-gstabs} or @option{-gstabs+}
7306 switches are used, the @file{mips-tfile} program will encapsulate the
7307 stabs within MIPS ECOFF@.
7308
7309 @item -mgas
7310 @opindex mgas
7311 Generate code for the GNU assembler.  This is the default on the OSF/1
7312 reference platform, using the OSF/rose object format.  Also, this is
7313 the default if the configure option @option{--with-gnu-as} is used.
7314
7315 @item -msplit-addresses
7316 @itemx -mno-split-addresses
7317 @opindex msplit-addresses
7318 @opindex mno-split-addresses
7319 Generate code to load the high and low parts of address constants separately.
7320 This allows GCC to optimize away redundant loads of the high order
7321 bits of addresses.  This optimization requires GNU as and GNU ld.
7322 This optimization is enabled by default for some embedded targets where
7323 GNU as and GNU ld are standard.
7324
7325 @item -mrnames
7326 @itemx -mno-rnames
7327 @opindex mrnames
7328 @opindex mno-rnames
7329 The @option{-mrnames} switch says to output code using the MIPS software
7330 names for the registers, instead of the hardware names (ie, @var{a0}
7331 instead of @var{$4}).  The only known assembler that supports this option
7332 is the Algorithmics assembler.
7333
7334 @item -mgpopt
7335 @itemx -mno-gpopt
7336 @opindex mgpopt
7337 @opindex mno-gpopt
7338 The @option{-mgpopt} switch says to write all of the data declarations
7339 before the instructions in the text section, this allows the MIPS
7340 assembler to generate one word memory references instead of using two
7341 words for short global or static data items.  This is on by default if
7342 optimization is selected.
7343
7344 @item -mstats
7345 @itemx -mno-stats
7346 @opindex mstats
7347 @opindex mno-stats
7348 For each non-inline function processed, the @option{-mstats} switch
7349 causes the compiler to emit one line to the standard error file to
7350 print statistics about the program (number of registers saved, stack
7351 size, etc.).
7352
7353 @item -mmemcpy
7354 @itemx -mno-memcpy
7355 @opindex mmemcpy
7356 @opindex mno-memcpy
7357 The @option{-mmemcpy} switch makes all block moves call the appropriate
7358 string function (@samp{memcpy} or @samp{bcopy}) instead of possibly
7359 generating inline code.
7360
7361 @item -mmips-tfile
7362 @itemx -mno-mips-tfile
7363 @opindex mmips-tfile
7364 @opindex mno-mips-tfile
7365 The @option{-mno-mips-tfile} switch causes the compiler not
7366 postprocess the object file with the @file{mips-tfile} program,
7367 after the MIPS assembler has generated it to add debug support.  If
7368 @file{mips-tfile} is not run, then no local variables will be
7369 available to the debugger.  In addition, @file{stage2} and
7370 @file{stage3} objects will have the temporary file names passed to the
7371 assembler embedded in the object file, which means the objects will
7372 not compare the same.  The @option{-mno-mips-tfile} switch should only
7373 be used when there are bugs in the @file{mips-tfile} program that
7374 prevents compilation.
7375
7376 @item -msoft-float
7377 @opindex msoft-float
7378 Generate output containing library calls for floating point.
7379 @strong{Warning:} the requisite libraries are not part of GCC@.
7380 Normally the facilities of the machine's usual C compiler are used, but
7381 this can't be done directly in cross-compilation.  You must make your
7382 own arrangements to provide suitable library functions for
7383 cross-compilation.
7384
7385 @item -mhard-float
7386 @opindex mhard-float
7387 Generate output containing floating point instructions.  This is the
7388 default if you use the unmodified sources.
7389
7390 @item -mabicalls
7391 @itemx -mno-abicalls
7392 @opindex mabicalls
7393 @opindex mno-abicalls
7394 Emit (or do not emit) the pseudo operations @samp{.abicalls},
7395 @samp{.cpload}, and @samp{.cprestore} that some System V.4 ports use for
7396 position independent code.
7397
7398 @item -mlong-calls
7399 @itemx -mno-long-calls
7400 @opindex mlong-calls
7401 @opindex mno-long-calls
7402 Do all calls with the @samp{JALR} instruction, which requires
7403 loading up a function's address into a register before the call.
7404 You need to use this switch, if you call outside of the current
7405 512 megabyte segment to functions that are not through pointers.
7406
7407 @item -mhalf-pic
7408 @itemx -mno-half-pic
7409 @opindex mhalf-pic
7410 @opindex mno-half-pic
7411 Put pointers to extern references into the data section and load them
7412 up, rather than put the references in the text section.
7413
7414 @item -membedded-pic
7415 @itemx -mno-embedded-pic
7416 @opindex membedded-pic
7417 @opindex mno-embedded-pic
7418 Generate PIC code suitable for some embedded systems.  All calls are
7419 made using PC relative address, and all data is addressed using the $gp
7420 register.  No more than 65536 bytes of global data may be used.  This
7421 requires GNU as and GNU ld which do most of the work.  This currently
7422 only works on targets which use ECOFF; it does not work with ELF@.
7423
7424 @item -membedded-data
7425 @itemx -mno-embedded-data
7426 @opindex membedded-data
7427 @opindex mno-embedded-data
7428 Allocate variables to the read-only data section first if possible, then
7429 next in the small data section if possible, otherwise in data.  This gives
7430 slightly slower code than the default, but reduces the amount of RAM required
7431 when executing, and thus may be preferred for some embedded systems.
7432
7433 @item -muninit-const-in-rodata
7434 @itemx -mno-uninit-const-in-rodata
7435 @opindex muninit-const-in-rodata
7436 @opindex mno-uninit-const-in-rodata
7437 When used together with @option{-membedded-data}, it will always store uninitialized
7438 const variables in the read-only data section.
7439
7440 @item -msingle-float
7441 @itemx -mdouble-float
7442 @opindex msingle-float
7443 @opindex mdouble-float
7444 The @option{-msingle-float} switch tells gcc to assume that the floating
7445 point coprocessor only supports single precision operations, as on the
7446 @samp{r4650} chip.  The @option{-mdouble-float} switch permits gcc to use
7447 double precision operations.  This is the default.
7448
7449 @item -mmad
7450 @itemx -mno-mad
7451 @opindex mmad
7452 @opindex mno-mad
7453 Permit use of the @samp{mad}, @samp{madu} and @samp{mul} instructions,
7454 as on the @samp{r4650} chip.
7455
7456 @item -m4650
7457 @opindex m4650
7458 Turns on @option{-msingle-float}, @option{-mmad}, and, at least for now,
7459 @option{-mcpu=r4650}.
7460
7461 @item -mips16
7462 @itemx -mno-mips16
7463 @opindex mips16
7464 @opindex mno-mips16
7465 Enable 16-bit instructions.
7466
7467 @item -mentry
7468 @opindex mentry
7469 Use the entry and exit pseudo ops.  This option can only be used with
7470 @option{-mips16}.
7471
7472 @item -EL
7473 @opindex EL
7474 Compile code for the processor in little endian mode.
7475 The requisite libraries are assumed to exist.
7476
7477 @item -EB
7478 @opindex EB
7479 Compile code for the processor in big endian mode.
7480 The requisite libraries are assumed to exist.
7481
7482 @item -G @var{num}
7483 @opindex G
7484 @cindex smaller data references (MIPS)
7485 @cindex gp-relative references (MIPS)
7486 Put global and static items less than or equal to @var{num} bytes into
7487 the small data or bss sections instead of the normal data or bss
7488 section.  This allows the assembler to emit one word memory reference
7489 instructions based on the global pointer (@var{gp} or @var{$28}),
7490 instead of the normal two words used.  By default, @var{num} is 8 when
7491 the MIPS assembler is used, and 0 when the GNU assembler is used.  The
7492 @option{-G @var{num}} switch is also passed to the assembler and linker.
7493 All modules should be compiled with the same @option{-G @var{num}}
7494 value.
7495
7496 @item -nocpp
7497 @opindex nocpp
7498 Tell the MIPS assembler to not run its preprocessor over user
7499 assembler files (with a @samp{.s} suffix) when assembling them.
7500
7501 @item -mfix7000
7502 @opindex mfix7000
7503 Pass an option to gas which will cause nops to be inserted if
7504 the read of the destination register of an mfhi or mflo instruction
7505 occurs in the following two instructions.
7506
7507 @item -no-crt0
7508 @opindex no-crt0
7509 Do not include the default crt0.
7510
7511 @item -mflush-func=@var{func}
7512 @itemx -mno-flush-func
7513 @opindex mflush-func
7514 Specifies the function to call to flush the I and D caches, or to not
7515 call any such function.  If called, the function must take the same
7516 arguments as the common @code{_flush_func()}, that is, the address of the
7517 memory range for which the cache is being flushed, the size of the
7518 memory range, and the number 3 (to flush both caches).  The default
7519 depends on the target gcc was configured for, but commonly is either
7520 @samp{_flush_func} or @samp{__cpu_flush}.
7521 @end table
7522
7523 @ifset INTERNALS
7524 These options are defined by the macro
7525 @code{TARGET_SWITCHES} in the machine description.  The default for the
7526 options is also defined by that macro, which enables you to change the
7527 defaults.
7528 @end ifset
7529
7530 @node i386 and x86-64 Options
7531 @subsection Intel 386 and AMD x86-64 Options
7532 @cindex i386 Options
7533 @cindex x86-64 Options
7534 @cindex Intel 386 Options
7535 @cindex AMD x86-64 Options
7536
7537 These @samp{-m} options are defined for the i386 and x86-64 family of
7538 computers:
7539
7540 @table @gcctabopt
7541 @item -mcpu=@var{cpu-type}
7542 @opindex mcpu
7543 Assume the defaults for the machine type @var{cpu-type} when scheduling
7544 instructions.  The choices for @var{cpu-type} are @samp{i386},
7545 @samp{i486}, @samp{i586}, @samp{i686}, @samp{pentium},
7546 @samp{pentiumpro}, @samp{pentium4}, @samp{k6}, and @samp{athlon}
7547
7548 While picking a specific @var{cpu-type} will schedule things appropriately
7549 for that particular chip, the compiler will not generate any code that
7550 does not run on the i386 without the @option{-march=@var{cpu-type}} option
7551 being used.  @samp{i586} is equivalent to @samp{pentium} and @samp{i686}
7552 is equivalent to @samp{pentiumpro}.  @samp{k6} and @samp{athlon} are the
7553 AMD chips as opposed to the Intel ones.
7554
7555 @item -march=@var{cpu-type}
7556 @opindex march
7557 Generate instructions for the machine type @var{cpu-type}.  The choices
7558 for @var{cpu-type} are the same as for @option{-mcpu}.  Moreover,
7559 specifying @option{-march=@var{cpu-type}} implies @option{-mcpu=@var{cpu-type}}.
7560
7561 @item -m386
7562 @itemx -m486
7563 @itemx -mpentium
7564 @itemx -mpentiumpro
7565 @opindex m386
7566 @opindex m486
7567 @opindex mpentium
7568 @opindex mpentiumpro
7569 These options are synonyms for @option{-mcpu=i386}, @option{-mcpu=i486},
7570 @option{-mcpu=pentium}, and @option{-mcpu=pentiumpro} respectively.
7571 These synonyms are deprecated.
7572
7573 @item -mintel-syntax
7574 @opindex mintel-syntax
7575 Emit assembly using Intel syntax opcodes instead of AT&T syntax.
7576
7577 @item -mieee-fp
7578 @itemx -mno-ieee-fp
7579 @opindex mieee-fp
7580 @opindex mno-ieee-fp
7581 Control whether or not the compiler uses IEEE floating point
7582 comparisons.  These handle correctly the case where the result of a
7583 comparison is unordered.
7584
7585 @item -msoft-float
7586 @opindex msoft-float
7587 Generate output containing library calls for floating point.
7588 @strong{Warning:} the requisite libraries are not part of GCC@.
7589 Normally the facilities of the machine's usual C compiler are used, but
7590 this can't be done directly in cross-compilation.  You must make your
7591 own arrangements to provide suitable library functions for
7592 cross-compilation.
7593
7594 On machines where a function returns floating point results in the 80387
7595 register stack, some floating point opcodes may be emitted even if
7596 @option{-msoft-float} is used.
7597
7598 @item -mno-fp-ret-in-387
7599 @opindex mno-fp-ret-in-387
7600 Do not use the FPU registers for return values of functions.
7601
7602 The usual calling convention has functions return values of types
7603 @code{float} and @code{double} in an FPU register, even if there
7604 is no FPU@.  The idea is that the operating system should emulate
7605 an FPU@.
7606
7607 The option @option{-mno-fp-ret-in-387} causes such values to be returned
7608 in ordinary CPU registers instead.
7609
7610 @item -mno-fancy-math-387
7611 @opindex mno-fancy-math-387
7612 Some 387 emulators do not support the @code{sin}, @code{cos} and
7613 @code{sqrt} instructions for the 387.  Specify this option to avoid
7614 generating those instructions.  This option is the default on FreeBSD@.
7615 As of revision 2.6.1, these instructions are not generated unless you
7616 also use the @option{-funsafe-math-optimizations} switch.
7617
7618 @item -malign-double
7619 @itemx -mno-align-double
7620 @opindex malign-double
7621 @opindex mno-align-double
7622 Control whether GCC aligns @code{double}, @code{long double}, and
7623 @code{long long} variables on a two word boundary or a one word
7624 boundary.  Aligning @code{double} variables on a two word boundary will
7625 produce code that runs somewhat faster on a @samp{Pentium} at the
7626 expense of more memory.
7627
7628 @item -m128bit-long-double
7629 @opindex m128bit-long-double
7630 Control the size of @code{long double} type. i386 application binary interface
7631 specify the size to be 12 bytes, while modern architectures (Pentium and newer)
7632 prefer @code{long double} aligned to 8 or 16 byte boundary.  This is
7633 impossible to reach with 12 byte long doubles in the array accesses.
7634
7635 @strong{Warning:} if you use the @option{-m128bit-long-double} switch, the
7636 structures and arrays containing @code{long double} will change their size as
7637 well as function calling convention for function taking @code{long double}
7638 will be modified.
7639
7640 @item -m96bit-long-double
7641 @opindex m96bit-long-double
7642 Set the size of @code{long double} to 96 bits as required by the i386
7643 application binary interface.  This is the default.
7644
7645 @item -msvr3-shlib
7646 @itemx -mno-svr3-shlib
7647 @opindex msvr3-shlib
7648 @opindex mno-svr3-shlib
7649 Control whether GCC places uninitialized local variables into the
7650 @code{bss} or @code{data} segments.  @option{-msvr3-shlib} places them
7651 into @code{bss}.  These options are meaningful only on System V Release 3.
7652
7653 @item -mrtd
7654 @opindex mrtd
7655 Use a different function-calling convention, in which functions that
7656 take a fixed number of arguments return with the @code{ret} @var{num}
7657 instruction, which pops their arguments while returning.  This saves one
7658 instruction in the caller since there is no need to pop the arguments
7659 there.
7660
7661 You can specify that an individual function is called with this calling
7662 sequence with the function attribute @samp{stdcall}.  You can also
7663 override the @option{-mrtd} option by using the function attribute
7664 @samp{cdecl}.  @xref{Function Attributes}.
7665
7666 @strong{Warning:} this calling convention is incompatible with the one
7667 normally used on Unix, so you cannot use it if you need to call
7668 libraries compiled with the Unix compiler.
7669
7670 Also, you must provide function prototypes for all functions that
7671 take variable numbers of arguments (including @code{printf});
7672 otherwise incorrect code will be generated for calls to those
7673 functions.
7674
7675 In addition, seriously incorrect code will result if you call a
7676 function with too many arguments.  (Normally, extra arguments are
7677 harmlessly ignored.)
7678
7679 @item -mregparm=@var{num}
7680 @opindex mregparm
7681 Control how many registers are used to pass integer arguments.  By
7682 default, no registers are used to pass arguments, and at most 3
7683 registers can be used.  You can control this behavior for a specific
7684 function by using the function attribute @samp{regparm}.
7685 @xref{Function Attributes}.
7686
7687 @strong{Warning:} if you use this switch, and
7688 @var{num} is nonzero, then you must build all modules with the same
7689 value, including any libraries.  This includes the system libraries and
7690 startup modules.
7691
7692 @item -mpreferred-stack-boundary=@var{num}
7693 @opindex mpreferred-stack-boundary
7694 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
7695 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
7696 the default is 4 (16 bytes or 128 bits), except when optimizing for code
7697 size (@option{-Os}), in which case the default is the minimum correct
7698 alignment (4 bytes for x86, and 8 bytes for x86-64).
7699
7700 On Pentium and PentiumPro, @code{double} and @code{long double} values
7701 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
7702 suffer significant run time performance penalties.  On Pentium III, the
7703 Streaming SIMD Extension (SSE) data type @code{__m128} suffers similar
7704 penalties if it is not 16 byte aligned.
7705
7706 To ensure proper alignment of this values on the stack, the stack boundary
7707 must be as aligned as that required by any value stored on the stack.
7708 Further, every function must be generated such that it keeps the stack
7709 aligned.  Thus calling a function compiled with a higher preferred
7710 stack boundary from a function compiled with a lower preferred stack
7711 boundary will most likely misalign the stack.  It is recommended that
7712 libraries that use callbacks always use the default setting.
7713
7714 This extra alignment does consume extra stack space, and generally
7715 increases code size.  Code that is sensitive to stack space usage, such
7716 as embedded systems and operating system kernels, may want to reduce the
7717 preferred alignment to @option{-mpreferred-stack-boundary=2}.
7718
7719 @item -mmmx
7720 @itemx -mno-mmx
7721 @item -msse
7722 @itemx -mno-sse
7723 @item -m3dnow
7724 @itemx -mno-3dnow
7725 @opindex mmmx
7726 @opindex mno-mmx
7727 @opindex msse
7728 @opindex mno-sse
7729 @opindex m3dnow
7730 @opindex mno-3dnow
7731 These switches enable or disable the use of built-in functions that allow
7732 direct access to the MMX, SSE and 3Dnow extensions of the instruction set.
7733
7734 The following machine modes are available for use with MMX built-in functions
7735 (@pxref{Vector Extensions}): @code{V2SI} for a vector of two 32 bit integers,
7736 @code{V4HI} for a vector of four 16 bit integers, and @code{V8QI} for a
7737 vector of eight 8 bit integers.  Some of the built-in functions operate on
7738 MMX registers as a whole 64 bit entity, these use @code{DI} as their mode.
7739
7740 If 3Dnow extensions are enabled, @code{V2SF} is used as a mode for a vector
7741 of two 32 bit floating point values.
7742
7743 If SSE extensions are enabled, @code{V4SF} is used for a vector of four 32 bit
7744 floating point values.  Some instructions use a vector of four 32 bit
7745 integers, these use @code{V4SI}.  Finally, some instructions operate on an
7746 entire vector register, interpreting it as a 128 bit integer, these use mode
7747 @code{TI}.
7748
7749 The following built-in functions are made available by @option{-mmmx}:
7750 @table @code
7751 @item v8qi __builtin_ia32_paddb (v8qi, v8qi)
7752 Generates the @code{paddb} machine instruction.
7753 @item v4hi __builtin_ia32_paddw (v4hi, v4hi)
7754 Generates the @code{paddw} machine instruction.
7755 @item v2si __builtin_ia32_paddd (v2si, v2si)
7756 Generates the @code{paddd} machine instruction.
7757 @item v8qi __builtin_ia32_psubb (v8qi, v8qi)
7758 Generates the @code{psubb} machine instruction.
7759 @item v4hi __builtin_ia32_psubw (v4hi, v4hi)
7760 Generates the @code{psubw} machine instruction.
7761 @item v2si __builtin_ia32_psubd (v2si, v2si)
7762 Generates the @code{psubd} machine instruction.
7763
7764 @item v8qi __builtin_ia32_paddsb (v8qi, v8qi)
7765 Generates the @code{paddsb} machine instruction.
7766 @item v4hi __builtin_ia32_paddsw (v4hi, v4hi)
7767 Generates the @code{paddsw} machine instruction.
7768 @item v8qi __builtin_ia32_psubsb (v8qi, v8qi)
7769 Generates the @code{psubsb} machine instruction.
7770 @item v4hi __builtin_ia32_psubsw (v4hi, v4hi)
7771 Generates the @code{psubsw} machine instruction.
7772
7773 @item v8qi __builtin_ia32_paddusb (v8qi, v8qi)
7774 Generates the @code{paddusb} machine instruction.
7775 @item v4hi __builtin_ia32_paddusw (v4hi, v4hi)
7776 Generates the @code{paddusw} machine instruction.
7777 @item v8qi __builtin_ia32_psubusb (v8qi, v8qi)
7778 Generates the @code{psubusb} machine instruction.
7779 @item v4hi __builtin_ia32_psubusw (v4hi, v4hi)
7780 Generates the @code{psubusw} machine instruction.
7781
7782 @item v4hi __builtin_ia32_pmullw (v4hi, v4hi)
7783 Generates the @code{pmullw} machine instruction.
7784 @item v4hi __builtin_ia32_pmulhw (v4hi, v4hi)
7785 Generates the @code{pmulhw} machine instruction.
7786
7787 @item di __builtin_ia32_pand (di, di)
7788 Generates the @code{pand} machine instruction.
7789 @item di __builtin_ia32_pandn (di,di)
7790 Generates the @code{pandn} machine instruction.
7791 @item di __builtin_ia32_por (di, di)
7792 Generates the @code{por} machine instruction.
7793 @item di __builtin_ia32_pxor (di, di)
7794 Generates the @code{pxor} machine instruction.
7795
7796 @item v8qi __builtin_ia32_pcmpeqb (v8qi, v8qi)
7797 Generates the @code{pcmpeqb} machine instruction.
7798 @item v4hi __builtin_ia32_pcmpeqw (v4hi, v4hi)
7799 Generates the @code{pcmpeqw} machine instruction.
7800 @item v2si __builtin_ia32_pcmpeqd (v2si, v2si)
7801 Generates the @code{pcmpeqd} machine instruction.
7802 @item v8qi __builtin_ia32_pcmpgtb (v8qi, v8qi)
7803 Generates the @code{pcmpgtb} machine instruction.
7804 @item v4hi __builtin_ia32_pcmpgtw (v4hi, v4hi)
7805 Generates the @code{pcmpgtw} machine instruction.
7806 @item v2si __builtin_ia32_pcmpgtd (v2si, v2si)
7807 Generates the @code{pcmpgtd} machine instruction.
7808
7809 @item v8qi __builtin_ia32_punpckhbw (v8qi, v8qi)
7810 Generates the @code{punpckhbw} machine instruction.
7811 @item v4hi __builtin_ia32_punpckhwd (v4hi, v4hi)
7812 Generates the @code{punpckhwd} machine instruction.
7813 @item v2si __builtin_ia32_punpckhdq (v2si, v2si)
7814 Generates the @code{punpckhdq} machine instruction.
7815 @item v8qi __builtin_ia32_punpcklbw (v8qi, v8qi)
7816 Generates the @code{punpcklbw} machine instruction.
7817 @item v4hi __builtin_ia32_punpcklwd (v4hi, v4hi)
7818 Generates the @code{punpcklwd} machine instruction.
7819 @item v2si __builtin_ia32_punpckldq (v2si, v2si)
7820 Generates the @code{punpckldq} machine instruction.
7821
7822 @item v8qi __builtin_ia32_packsswb (v4hi, v4hi)
7823 Generates the @code{packsswb} machine instruction.
7824 @item v4hi __builtin_ia32_packssdw (v2si, v2si)
7825 Generates the @code{packssdw} machine instruction.
7826 @item v8qi __builtin_ia32_packuswb (v4hi, v4hi)
7827 Generates the @code{packuswb} machine instruction.
7828
7829 @end table
7830
7831 The following built-in functions are made available either with @option{-msse}, or
7832 with a combination of @option{-m3dnow} and @option{-march=athlon}.
7833 @table @code
7834
7835 @item v4hi __builtin_ia32_pmulhuw (v4hi, v4hi)
7836 Generates the @code{pmulhuw} machine instruction.
7837
7838 @item v8qi __builtin_ia32_pavgb (v8qi, v8qi)
7839 Generates the @code{pavgb} machine instruction.
7840 @item v4hi __builtin_ia32_pavgw (v4hi, v4hi)
7841 Generates the @code{pavgw} machine instruction.
7842 @item v4hi __builtin_ia32_psadbw (v8qi, v8qi)
7843 Generates the @code{psadbw} machine instruction.
7844
7845 @item v8qi __builtin_ia32_pmaxub (v8qi, v8qi)
7846 Generates the @code{pmaxub} machine instruction.
7847 @item v4hi __builtin_ia32_pmaxsw (v4hi, v4hi)
7848 Generates the @code{pmaxsw} machine instruction.
7849 @item v8qi __builtin_ia32_pminub (v8qi, v8qi)
7850 Generates the @code{pminub} machine instruction.
7851 @item v4hi __builtin_ia32_pminsw (v4hi, v4hi)
7852 Generates the @code{pminsw} machine instruction.
7853
7854 @item int __builtin_ia32_pextrw (v4hi, int)
7855 Generates the @code{pextrw} machine instruction.
7856 @item v4hi __builtin_ia32_pinsrw (v4hi, int, int)
7857 Generates the @code{pinsrw} machine instruction.
7858
7859 @item int __builtin_ia32_pmovmskb (v8qi)
7860 Generates the @code{pmovmskb} machine instruction.
7861 @item void __builtin_ia32_maskmovq (v8qi, v8qi, char *)
7862 Generates the @code{maskmovq} machine instruction.
7863 @item void __builtin_ia32_movntq (di *, di)
7864 Generates the @code{movntq} machine instruction.
7865 @item void __builtin_ia32_sfence (void)
7866 Generates the @code{sfence} machine instruction.
7867 @item void __builtin_ia32_prefetch (char *, int selector)
7868 Generates a prefetch machine instruction, depending on the value of
7869 selector.  If @code{selector} is 0, it generates @code{prefetchnta}; for
7870 a value of 1, it generates @code{prefetcht0}; for a value of 2, it generates
7871 @code{prefetcht1}; and for a value of 3 it generates @code{prefetcht2}.
7872
7873 @end table
7874
7875 The following built-in functions are available when @option{-msse} is used.
7876
7877 @table @code
7878 @item int __builtin_ia32_comieq (v4sf, v4sf)
7879 Generates the @code{comiss} machine instruction and performs an equality
7880 comparison.  The return value is the truth value of that comparison.
7881 @item int __builtin_ia32_comineq (v4sf, v4sf)
7882 Generates the @code{comiss} machine instruction and performs an inequality
7883 comparison.  The return value is the truth value of that comparison.
7884 @item int __builtin_ia32_comilt (v4sf, v4sf)
7885 Generates the @code{comiss} machine instruction and performs a ``less than''
7886 comparison.  The return value is the truth value of that comparison.
7887 @item int __builtin_ia32_comile (v4sf, v4sf)
7888 Generates the @code{comiss} machine instruction and performs a ``less or
7889 equal'' comparison.  The return value is the truth value of that comparison.
7890 @item int __builtin_ia32_comigt (v4sf, v4sf)
7891 Generates the @code{comiss} machine instruction and performs a ``greater than''
7892 comparison.  The return value is the truth value of that comparison.
7893 @item int __builtin_ia32_comige (v4sf, v4sf)
7894 Generates the @code{comiss} machine instruction and performs a ``greater or
7895 equal'' comparison.  The return value is the truth value of that comparison.
7896
7897 @item int __builtin_ia32_ucomieq (v4sf, v4sf)
7898 Generates the @code{ucomiss} machine instruction and performs an equality
7899 comparison.  The return value is the truth value of that comparison.
7900 @item int __builtin_ia32_ucomineq (v4sf, v4sf)
7901 Generates the @code{ucomiss} machine instruction and performs an inequality
7902 comparison.  The return value is the truth value of that comparison.
7903 @item int __builtin_ia32_ucomilt (v4sf, v4sf)
7904 Generates the @code{ucomiss} machine instruction and performs a ``less than''
7905 comparison.  The return value is the truth value of that comparison.
7906 @item int __builtin_ia32_ucomile (v4sf, v4sf)
7907 Generates the @code{ucomiss} machine instruction and performs a ``less or
7908 equal'' comparison.  The return value is the truth value of that comparison.
7909 @item int __builtin_ia32_ucomigt (v4sf, v4sf)
7910 Generates the @code{ucomiss} machine instruction and performs a ``greater than''
7911 comparison.  The return value is the truth value of that comparison.
7912 @item int __builtin_ia32_ucomige (v4sf, v4sf)
7913 Generates the @code{ucomiss} machine instruction and performs a ``greater or
7914 equal'' comparison.  The return value is the truth value of that comparison.
7915
7916 @item v4sf __builtin_ia32_addps (v4sf, v4sf)
7917 Generates the @code{addps} machine instruction.
7918 @item v4sf __builtin_ia32_addss (v4sf, v4sf)
7919 Generates the @code{addss} machine instruction.
7920 @item v4sf __builtin_ia32_subps (v4sf, v4sf)
7921 Generates the @code{subps} machine instruction.
7922 @item v4sf __builtin_ia32_subss (v4sf, v4sf)
7923 Generates the @code{subss} machine instruction.
7924 @item v4sf __builtin_ia32_mulps (v4sf, v4sf)
7925 Generates the @code{mulps} machine instruction.
7926 @item v4sf __builtin_ia32_mulss (v4sf, v4sf)
7927 Generates the @code{mulss} machine instruction.
7928 @item v4sf __builtin_ia32_divps (v4sf, v4sf)
7929 Generates the @code{divps} machine instruction.
7930 @item v4sf __builtin_ia32_divss (v4sf, v4sf)
7931 Generates the @code{divss} machine instruction.
7932
7933 @item v4si __builtin_ia32_cmpeqps (v4sf, v4sf)
7934 Generates the @code{cmpeqps} machine instruction.
7935 @item v4si __builtin_ia32_cmplts (v4sf, v4sf)
7936 Generates the @code{cmpltps} machine instruction.
7937 @item v4si __builtin_ia32_cmpleps (v4sf, v4sf)
7938 Generates the @code{cmpleps} machine instruction.
7939 @item v4si __builtin_ia32_cmpgtps (v4sf, v4sf)
7940 Generates the @code{cmpgtps} machine instruction.
7941 @item v4si __builtin_ia32_cmpgeps (v4sf, v4sf)
7942 Generates the @code{cmpgeps} machine instruction.
7943 @item v4si __builtin_ia32_cmpunordps (v4sf, v4sf)
7944 Generates the @code{cmpunodps} machine instruction.
7945 @item v4si __builtin_ia32_cmpneqps (v4sf, v4sf)
7946 Generates the @code{cmpeqps} machine instruction.
7947 @item v4si __builtin_ia32_cmpnltps (v4sf, v4sf)
7948 Generates the @code{cmpltps} machine instruction.
7949 @item v4si __builtin_ia32_cmpnleps (v4sf, v4sf)
7950 Generates the @code{cmpleps} machine instruction.
7951 @item v4si __builtin_ia32_cmpngtps (v4sf, v4sf)
7952 Generates the @code{cmpgtps} machine instruction.
7953 @item v4si __builtin_ia32_cmpngeps (v4sf, v4sf)
7954 Generates the @code{cmpgeps} machine instruction.
7955 @item v4si __builtin_ia32_cmpordps (v4sf, v4sf)
7956 Generates the @code{cmpunodps} machine instruction.
7957
7958 @item v4si __builtin_ia32_cmpeqss (v4sf, v4sf)
7959 Generates the @code{cmpeqss} machine instruction.
7960 @item v4si __builtin_ia32_cmpltss (v4sf, v4sf)
7961 Generates the @code{cmpltss} machine instruction.
7962 @item v4si __builtin_ia32_cmpless (v4sf, v4sf)
7963 Generates the @code{cmpless} machine instruction.
7964 @item v4si __builtin_ia32_cmpgtss (v4sf, v4sf)
7965 Generates the @code{cmpgtss} machine instruction.
7966 @item v4si __builtin_ia32_cmpgess (v4sf, v4sf)
7967 Generates the @code{cmpgess} machine instruction.
7968 @item v4si __builtin_ia32_cmpunordss (v4sf, v4sf)
7969 Generates the @code{cmpunodss} machine instruction.
7970 @item v4si __builtin_ia32_cmpneqss (v4sf, v4sf)
7971 Generates the @code{cmpeqss} machine instruction.
7972 @item v4si __builtin_ia32_cmpnlts (v4sf, v4sf)
7973 Generates the @code{cmpltss} machine instruction.
7974 @item v4si __builtin_ia32_cmpnless (v4sf, v4sf)
7975 Generates the @code{cmpless} machine instruction.
7976 @item v4si __builtin_ia32_cmpngtss (v4sf, v4sf)
7977 Generates the @code{cmpgtss} machine instruction.
7978 @item v4si __builtin_ia32_cmpngess (v4sf, v4sf)
7979 Generates the @code{cmpgess} machine instruction.
7980 @item v4si __builtin_ia32_cmpordss (v4sf, v4sf)
7981 Generates the @code{cmpunodss} machine instruction.
7982
7983 @item v4sf __builtin_ia32_maxps (v4sf, v4sf)
7984 Generates the @code{maxps} machine instruction.
7985 @item v4sf __builtin_ia32_maxsss (v4sf, v4sf)
7986 Generates the @code{maxss} machine instruction.
7987 @item v4sf __builtin_ia32_minps (v4sf, v4sf)
7988 Generates the @code{minps} machine instruction.
7989 @item v4sf __builtin_ia32_minsss (v4sf, v4sf)
7990 Generates the @code{minss} machine instruction.
7991
7992 @item ti __builtin_ia32_andps (ti, ti)
7993 Generates the @code{andps} machine instruction.
7994 @item ti __builtin_ia32_andnps (ti, ti)
7995 Generates the @code{andnps} machine instruction.
7996 @item ti __builtin_ia32_orps (ti, ti)
7997 Generates the @code{orps} machine instruction.
7998 @item ti __builtin_ia32_xorps (ti, ti)
7999 Generates the @code{xorps} machine instruction.
8000
8001 @item v4sf __builtin_ia32_movps (v4sf, v4sf)
8002 Generates the @code{movps} machine instruction.
8003 @item v4sf __builtin_ia32_movhlps (v4sf, v4sf)
8004 Generates the @code{movhlps} machine instruction.
8005 @item v4sf __builtin_ia32_movlhps (v4sf, v4sf)
8006 Generates the @code{movlhps} machine instruction.
8007 @item v4sf __builtin_ia32_unpckhps (v4sf, v4sf)
8008 Generates the @code{unpckhps} machine instruction.
8009 @item v4sf __builtin_ia32_unpcklps (v4sf, v4sf)
8010 Generates the @code{unpcklps} machine instruction.
8011
8012 @item v4sf __builtin_ia32_cvtpi2ps (v4sf, v2si)
8013 Generates the @code{cvtpi2ps} machine instruction.
8014 @item v2si __builtin_ia32_cvtps2pi (v4sf)
8015 Generates the @code{cvtps2pi} machine instruction.
8016 @item v4sf __builtin_ia32_cvtsi2ss (v4sf, int)
8017 Generates the @code{cvtsi2ss} machine instruction.
8018 @item int __builtin_ia32_cvtss2si (v4sf)
8019 Generates the @code{cvtsi2ss} machine instruction.
8020 @item v2si __builtin_ia32_cvttps2pi (v4sf)
8021 Generates the @code{cvttps2pi} machine instruction.
8022 @item int __builtin_ia32_cvttss2si (v4sf)
8023 Generates the @code{cvttsi2ss} machine instruction.
8024
8025 @item v4sf __builtin_ia32_rcpps (v4sf)
8026 Generates the @code{rcpps} machine instruction.
8027 @item v4sf __builtin_ia32_rsqrtps (v4sf)
8028 Generates the @code{rsqrtps} machine instruction.
8029 @item v4sf __builtin_ia32_sqrtps (v4sf)
8030 Generates the @code{sqrtps} machine instruction.
8031 @item v4sf __builtin_ia32_rcpss (v4sf)
8032 Generates the @code{rcpss} machine instruction.
8033 @item v4sf __builtin_ia32_rsqrtss (v4sf)
8034 Generates the @code{rsqrtss} machine instruction.
8035 @item v4sf __builtin_ia32_sqrtss (v4sf)
8036 Generates the @code{sqrtss} machine instruction.
8037
8038 @item v4sf __builtin_ia32_shufps (v4sf, v4sf, int)
8039 Generates the @code{shufps} machine instruction.
8040
8041 @item v4sf __builtin_ia32_loadaps (float *)
8042 Generates the @code{movaps} machine instruction as a load from memory.
8043 @item void __builtin_ia32_storeaps (float *, v4sf)
8044 Generates the @code{movaps} machine instruction as a store to memory.
8045 @item v4sf __builtin_ia32_loadups (float *)
8046 Generates the @code{movups} machine instruction as a load from memory.
8047 @item void __builtin_ia32_storeups (float *, v4sf)
8048 Generates the @code{movups} machine instruction as a store to memory.
8049 @item v4sf __builtin_ia32_loadsss (float *)
8050 Generates the @code{movss} machine instruction as a load from memory.
8051 @item void __builtin_ia32_storess (float *, v4sf)
8052 Generates the @code{movss} machine instruction as a store to memory.
8053
8054 @item v4sf __builtin_ia32_loadhps (v4sf, v2si *)
8055 Generates the @code{movhps} machine instruction as a load from memory.
8056 @item v4sf __builtin_ia32_loadlps (v4sf, v2si *)
8057 Generates the @code{movlps} machine instruction as a load from memory
8058 @item void __builtin_ia32_storehps (v4sf, v2si *)
8059 Generates the @code{movhps} machine instruction as a store to memory.
8060 @item void __builtin_ia32_storelps (v4sf, v2si *)
8061 Generates the @code{movlps} machine instruction as a store to memory.
8062
8063 @item void __builtin_ia32_movntps (float *, v4sf)
8064 Generates the @code{movntps} machine instruction.
8065 @item int __builtin_ia32_movmskps (v4sf)
8066 Generates the @code{movntps} machine instruction.
8067
8068 @item void __builtin_ia32_storeps1 (float *, v4sf)
8069 Generates the @code{movaps} machine instruction as a store to memory.
8070 Before storing, the value is modified with a @code{shufps} instruction
8071 so that the lowest of the four floating point elements is replicated
8072 across the entire vector that is stored.
8073 @item void __builtin_ia32_storerps (float *, v4sf)
8074 Generates the @code{movaps} machine instruction as a store to memory.
8075 Before storing, the value is modified with a @code{shufps} instruction
8076 so that the order of the four floating point elements in the vector is
8077 reversed.
8078 @item v4sf __builtin_ia32_loadps1 (float *)
8079 Generates a @code{movss} machine instruction to load a floating point
8080 value from memory, and a @code{shufps} instruction to replicate the
8081 loaded value across all four elements of the result vector.
8082 @item v4sf __builtin_ia32_loadrps (float *)
8083 Generates a @code{movaps} machine instruction to load a vector from
8084 memory, and a @code{shufps} instruction to reverse the order of the
8085 four floating point elements in the result vector.
8086 @item v4sf __builtin_ia32_setps (float, float, float, float)
8087 Constructs a vector from four single floating point values.  The return
8088 value is equal to the value that would result from storing the four
8089 arguments into consecutive memory locations and then executing a
8090 @code{movaps} to load the vector from memory.
8091 @item v4sf __builtin_ia32_setps1 (float)
8092 Constructs a vector from a single floating point value by replicating
8093 it across all four elements of the result vector.
8094 @end table
8095
8096 @item -mpush-args
8097 @itemx -mno-push-args
8098 @opindex mpush-args
8099 @opindex mno-push-args
8100 Use PUSH operations to store outgoing parameters.  This method is shorter
8101 and usually equally fast as method using SUB/MOV operations and is enabled
8102 by default.  In some cases disabling it may improve performance because of
8103 improved scheduling and reduced dependencies.
8104
8105 @item -maccumulate-outgoing-args
8106 @opindex maccumulate-outgoing-args
8107 If enabled, the maximum amount of space required for outgoing arguments will be
8108 computed in the function prologue.  This is faster on most modern CPUs
8109 because of reduced dependencies, improved scheduling and reduced stack usage
8110 when preferred stack boundary is not equal to 2.  The drawback is a notable
8111 increase in code size.  This switch implies @option{-mno-push-args}.
8112
8113 @item -mthreads
8114 @opindex mthreads
8115 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
8116 on thread-safe exception handling must compile and link all code with the
8117 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
8118 @option{-D_MT}; when linking, it links in a special thread helper library
8119 @option{-lmingwthrd} which cleans up per thread exception handling data.
8120
8121 @item -mno-align-stringops
8122 @opindex mno-align-stringops
8123 Do not align destination of inlined string operations.  This switch reduces
8124 code size and improves performance in case the destination is already aligned,
8125 but gcc don't know about it.
8126
8127 @item -minline-all-stringops
8128 @opindex minline-all-stringops
8129 By default GCC inlines string operations only when destination is known to be
8130 aligned at least to 4 byte boundary.  This enables more inlining, increase code
8131 size, but may improve performance of code that depends on fast memcpy, strlen
8132 and memset for short lengths.
8133
8134 @item -momit-leaf-frame-pointer
8135 @opindex momit-leaf-frame-pointer
8136 Don't keep the frame pointer in a register for leaf functions.  This
8137 avoids the instructions to save, set up and restore frame pointers and
8138 makes an extra register available in leaf functions.  The option
8139 @option{-fomit-frame-pointer} removes the frame pointer for all functions
8140 which might make debugging harder.
8141 @end table
8142
8143 These @samp{-m} switches are supported in addition to the above
8144 on AMD x86-64 processors in 64-bit environments.
8145
8146 @table @gcctabopt
8147 @item -m32
8148 @itemx -m64
8149 @opindex m32
8150 @opindex m64
8151 Generate code for a 32-bit or 64-bit environment.
8152 The 32-bit environment sets int, long and pointer to 32 bits and
8153 generates code that runs on any i386 system.
8154 The 64-bit environment sets int to 32 bits and long and pointer
8155 to 64 bits and generates code for AMD's x86-64 architecture.
8156
8157 @item -mno-red-zone
8158 @opindex no-red-zone
8159 Do not use a so called red zone for x86-64 code.  The red zone is mandated
8160 by the x86-64 ABI, it is a 128-byte area beyond the location of the
8161 stack pointer that will not be modified by signal or interrupt handlers
8162 and therefore can be used for temporary data without adjusting the stack
8163 pointer.  The flag @option{-mno-red-zone} disables this red zone.
8164 @end table
8165
8166 @node HPPA Options
8167 @subsection HPPA Options
8168 @cindex HPPA Options
8169
8170 These @samp{-m} options are defined for the HPPA family of computers:
8171
8172 @table @gcctabopt
8173 @item -march=@var{architecture-type}
8174 @opindex march
8175 Generate code for the specified architecture.  The choices for
8176 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
8177 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
8178 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
8179 architecture option for your machine.  Code compiled for lower numbered
8180 architectures will run on higher numbered architectures, but not the
8181 other way around.
8182
8183 PA 2.0 support currently requires gas snapshot 19990413 or later.  The
8184 next release of binutils (current is 2.9.1) will probably contain PA 2.0
8185 support.
8186
8187 @item -mpa-risc-1-0
8188 @itemx -mpa-risc-1-1
8189 @itemx -mpa-risc-2-0
8190 @opindex mpa-risc-1-0
8191 @opindex mpa-risc-1-1
8192 @opindex mpa-risc-2-0
8193 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
8194
8195 @item -mbig-switch
8196 @opindex mbig-switch
8197 Generate code suitable for big switch tables.  Use this option only if
8198 the assembler/linker complain about out of range branches within a switch
8199 table.
8200
8201 @item -mjump-in-delay
8202 @opindex mjump-in-delay
8203 Fill delay slots of function calls with unconditional jump instructions
8204 by modifying the return pointer for the function call to be the target
8205 of the conditional jump.
8206
8207 @item -mdisable-fpregs
8208 @opindex mdisable-fpregs
8209 Prevent floating point registers from being used in any manner.  This is
8210 necessary for compiling kernels which perform lazy context switching of
8211 floating point registers.  If you use this option and attempt to perform
8212 floating point operations, the compiler will abort.
8213
8214 @item -mdisable-indexing
8215 @opindex mdisable-indexing
8216 Prevent the compiler from using indexing address modes.  This avoids some
8217 rather obscure problems when compiling MIG generated code under MACH@.
8218
8219 @item -mno-space-regs
8220 @opindex mno-space-regs
8221 Generate code that assumes the target has no space registers.  This allows
8222 GCC to generate faster indirect calls and use unscaled index address modes.
8223
8224 Such code is suitable for level 0 PA systems and kernels.
8225
8226 @item -mfast-indirect-calls
8227 @opindex mfast-indirect-calls
8228 Generate code that assumes calls never cross space boundaries.  This
8229 allows GCC to emit code which performs faster indirect calls.
8230
8231 This option will not work in the presence of shared libraries or nested
8232 functions.
8233
8234 @item -mlong-load-store
8235 @opindex mlong-load-store
8236 Generate 3-instruction load and store sequences as sometimes required by
8237 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
8238 the HP compilers.
8239
8240 @item -mportable-runtime
8241 @opindex mportable-runtime
8242 Use the portable calling conventions proposed by HP for ELF systems.
8243
8244 @item -mgas
8245 @opindex mgas
8246 Enable the use of assembler directives only GAS understands.
8247
8248 @item -mschedule=@var{cpu-type}
8249 @opindex mschedule
8250 Schedule code according to the constraints for the machine type
8251 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
8252 @samp{7100}, @samp{7100LC}, @samp{7200}, and @samp{8000}.  Refer to
8253 @file{/usr/lib/sched.models} on an HP-UX system to determine the
8254 proper scheduling option for your machine.
8255
8256 @item -mlinker-opt
8257 @opindex mlinker-opt
8258 Enable the optimization pass in the HPUX linker.  Note this makes symbolic
8259 debugging impossible.  It also triggers a bug in the HPUX 8 and HPUX 9 linkers
8260 in which they give bogus error messages when linking some programs.
8261
8262 @item -msoft-float
8263 @opindex msoft-float
8264 Generate output containing library calls for floating point.
8265 @strong{Warning:} the requisite libraries are not available for all HPPA
8266 targets.  Normally the facilities of the machine's usual C compiler are
8267 used, but this cannot be done directly in cross-compilation.  You must make
8268 your own arrangements to provide suitable library functions for
8269 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
8270 does provide software floating point support.
8271
8272 @option{-msoft-float} changes the calling convention in the output file;
8273 therefore, it is only useful if you compile @emph{all} of a program with
8274 this option.  In particular, you need to compile @file{libgcc.a}, the
8275 library that comes with GCC, with @option{-msoft-float} in order for
8276 this to work.
8277 @end table
8278
8279 @node Intel 960 Options
8280 @subsection Intel 960 Options
8281
8282 These @samp{-m} options are defined for the Intel 960 implementations:
8283
8284 @table @gcctabopt
8285 @item -m@var{cpu-type}
8286 @opindex mka
8287 @opindex mkb
8288 @opindex mmc
8289 @opindex mca
8290 @opindex mcf
8291 @opindex msa
8292 @opindex msb
8293 Assume the defaults for the machine type @var{cpu-type} for some of
8294 the other options, including instruction scheduling, floating point
8295 support, and addressing modes.  The choices for @var{cpu-type} are
8296 @samp{ka}, @samp{kb}, @samp{mc}, @samp{ca}, @samp{cf},
8297 @samp{sa}, and @samp{sb}.
8298 The default is
8299 @samp{kb}.
8300
8301 @item -mnumerics
8302 @itemx -msoft-float
8303 @opindex mnumerics
8304 @opindex msoft-float
8305 The @option{-mnumerics} option indicates that the processor does support
8306 floating-point instructions.  The @option{-msoft-float} option indicates
8307 that floating-point support should not be assumed.
8308
8309 @item -mleaf-procedures
8310 @itemx -mno-leaf-procedures
8311 @opindex mleaf-procedures
8312 @opindex mno-leaf-procedures
8313 Do (or do not) attempt to alter leaf procedures to be callable with the
8314 @code{bal} instruction as well as @code{call}.  This will result in more
8315 efficient code for explicit calls when the @code{bal} instruction can be
8316 substituted by the assembler or linker, but less efficient code in other
8317 cases, such as calls via function pointers, or using a linker that doesn't
8318 support this optimization.
8319
8320 @item -mtail-call
8321 @itemx -mno-tail-call
8322 @opindex mtail-call
8323 @opindex mno-tail-call
8324 Do (or do not) make additional attempts (beyond those of the
8325 machine-independent portions of the compiler) to optimize tail-recursive
8326 calls into branches.  You may not want to do this because the detection of
8327 cases where this is not valid is not totally complete.  The default is
8328 @option{-mno-tail-call}.
8329
8330 @item -mcomplex-addr
8331 @itemx -mno-complex-addr
8332 @opindex mcomplex-addr
8333 @opindex mno-complex-addr
8334 Assume (or do not assume) that the use of a complex addressing mode is a
8335 win on this implementation of the i960.  Complex addressing modes may not
8336 be worthwhile on the K-series, but they definitely are on the C-series.
8337 The default is currently @option{-mcomplex-addr} for all processors except
8338 the CB and CC@.
8339
8340 @item -mcode-align
8341 @itemx -mno-code-align
8342 @opindex mcode-align
8343 @opindex mno-code-align
8344 Align code to 8-byte boundaries for faster fetching (or don't bother).
8345 Currently turned on by default for C-series implementations only.
8346
8347 @ignore
8348 @item -mclean-linkage
8349 @itemx -mno-clean-linkage
8350 @opindex mclean-linkage
8351 @opindex mno-clean-linkage
8352 These options are not fully implemented.
8353 @end ignore
8354
8355 @item -mic-compat
8356 @itemx -mic2.0-compat
8357 @itemx -mic3.0-compat
8358 @opindex mic-compat
8359 @opindex mic2.0-compat
8360 @opindex mic3.0-compat
8361 Enable compatibility with iC960 v2.0 or v3.0.
8362
8363 @item -masm-compat
8364 @itemx -mintel-asm
8365 @opindex masm-compat
8366 @opindex mintel-asm
8367 Enable compatibility with the iC960 assembler.
8368
8369 @item -mstrict-align
8370 @itemx -mno-strict-align
8371 @opindex mstrict-align
8372 @opindex mno-strict-align
8373 Do not permit (do permit) unaligned accesses.
8374
8375 @item -mold-align
8376 @opindex mold-align
8377 Enable structure-alignment compatibility with Intel's gcc release version
8378 1.3 (based on gcc 1.37).  This option implies @option{-mstrict-align}.
8379
8380 @item -mlong-double-64
8381 @opindex mlong-double-64
8382 Implement type @samp{long double} as 64-bit floating point numbers.
8383 Without the option @samp{long double} is implemented by 80-bit
8384 floating point numbers.  The only reason we have it because there is
8385 no 128-bit @samp{long double} support in @samp{fp-bit.c} yet.  So it
8386 is only useful for people using soft-float targets.  Otherwise, we
8387 should recommend against use of it.
8388
8389 @end table
8390
8391 @node DEC Alpha Options
8392 @subsection DEC Alpha Options
8393
8394 These @samp{-m} options are defined for the DEC Alpha implementations:
8395
8396 @table @gcctabopt
8397 @item -mno-soft-float
8398 @itemx -msoft-float
8399 @opindex mno-soft-float
8400 @opindex msoft-float
8401 Use (do not use) the hardware floating-point instructions for
8402 floating-point operations.  When @option{-msoft-float} is specified,
8403 functions in @file{libgcc.a} will be used to perform floating-point
8404 operations.  Unless they are replaced by routines that emulate the
8405 floating-point operations, or compiled in such a way as to call such
8406 emulations routines, these routines will issue floating-point
8407 operations.   If you are compiling for an Alpha without floating-point
8408 operations, you must ensure that the library is built so as not to call
8409 them.
8410
8411 Note that Alpha implementations without floating-point operations are
8412 required to have floating-point registers.
8413
8414 @item -mfp-reg
8415 @itemx -mno-fp-regs
8416 @opindex mfp-reg
8417 @opindex mno-fp-regs
8418 Generate code that uses (does not use) the floating-point register set.
8419 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
8420 register set is not used, floating point operands are passed in integer
8421 registers as if they were integers and floating-point results are passed
8422 in $0 instead of $f0.  This is a non-standard calling sequence, so any
8423 function with a floating-point argument or return value called by code
8424 compiled with @option{-mno-fp-regs} must also be compiled with that
8425 option.
8426
8427 A typical use of this option is building a kernel that does not use,
8428 and hence need not save and restore, any floating-point registers.
8429
8430 @item -mieee
8431 @opindex mieee
8432 The Alpha architecture implements floating-point hardware optimized for
8433 maximum performance.  It is mostly compliant with the IEEE floating
8434 point standard.  However, for full compliance, software assistance is
8435 required.  This option generates code fully IEEE compliant code
8436 @emph{except} that the @var{inexact-flag} is not maintained (see below).
8437 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
8438 defined during compilation.  The resulting code is less efficient but is
8439 able to correctly support denormalized numbers and exceptional IEEE
8440 values such as not-a-number and plus/minus infinity.  Other Alpha
8441 compilers call this option @option{-ieee_with_no_inexact}.
8442
8443 @item -mieee-with-inexact
8444 @opindex mieee-with-inexact
8445 This is like @option{-mieee} except the generated code also maintains
8446 the IEEE @var{inexact-flag}.  Turning on this option causes the
8447 generated code to implement fully-compliant IEEE math.  In addition to
8448 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
8449 macro.  On some Alpha implementations the resulting code may execute
8450 significantly slower than the code generated by default.  Since there is
8451 very little code that depends on the @var{inexact-flag}, you should
8452 normally not specify this option.  Other Alpha compilers call this
8453 option @option{-ieee_with_inexact}.
8454
8455 @item -mfp-trap-mode=@var{trap-mode}
8456 @opindex mfp-trap-mode
8457 This option controls what floating-point related traps are enabled.
8458 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
8459 The trap mode can be set to one of four values:
8460
8461 @table @samp
8462 @item n
8463 This is the default (normal) setting.  The only traps that are enabled
8464 are the ones that cannot be disabled in software (e.g., division by zero
8465 trap).
8466
8467 @item u
8468 In addition to the traps enabled by @samp{n}, underflow traps are enabled
8469 as well.
8470
8471 @item su
8472 Like @samp{su}, but the instructions are marked to be safe for software
8473 completion (see Alpha architecture manual for details).
8474
8475 @item sui
8476 Like @samp{su}, but inexact traps are enabled as well.
8477 @end table
8478
8479 @item -mfp-rounding-mode=@var{rounding-mode}
8480 @opindex mfp-rounding-mode
8481 Selects the IEEE rounding mode.  Other Alpha compilers call this option
8482 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
8483 of:
8484
8485 @table @samp
8486 @item n
8487 Normal IEEE rounding mode.  Floating point numbers are rounded towards
8488 the nearest machine number or towards the even machine number in case
8489 of a tie.
8490
8491 @item m
8492 Round towards minus infinity.
8493
8494 @item c
8495 Chopped rounding mode.  Floating point numbers are rounded towards zero.
8496
8497 @item d
8498 Dynamic rounding mode.  A field in the floating point control register
8499 (@var{fpcr}, see Alpha architecture reference manual) controls the
8500 rounding mode in effect.  The C library initializes this register for
8501 rounding towards plus infinity.  Thus, unless your program modifies the
8502 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
8503 @end table
8504
8505 @item -mtrap-precision=@var{trap-precision}
8506 @opindex mtrap-precision
8507 In the Alpha architecture, floating point traps are imprecise.  This
8508 means without software assistance it is impossible to recover from a
8509 floating trap and program execution normally needs to be terminated.
8510 GCC can generate code that can assist operating system trap handlers
8511 in determining the exact location that caused a floating point trap.
8512 Depending on the requirements of an application, different levels of
8513 precisions can be selected:
8514
8515 @table @samp
8516 @item p
8517 Program precision.  This option is the default and means a trap handler
8518 can only identify which program caused a floating point exception.
8519
8520 @item f
8521 Function precision.  The trap handler can determine the function that
8522 caused a floating point exception.
8523
8524 @item i
8525 Instruction precision.  The trap handler can determine the exact
8526 instruction that caused a floating point exception.
8527 @end table
8528
8529 Other Alpha compilers provide the equivalent options called
8530 @option{-scope_safe} and @option{-resumption_safe}.
8531
8532 @item -mieee-conformant
8533 @opindex mieee-conformant
8534 This option marks the generated code as IEEE conformant.  You must not
8535 use this option unless you also specify @option{-mtrap-precision=i} and either
8536 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
8537 is to emit the line @samp{.eflag 48} in the function prologue of the
8538 generated assembly file.  Under DEC Unix, this has the effect that
8539 IEEE-conformant math library routines will be linked in.
8540
8541 @item -mbuild-constants
8542 @opindex mbuild-constants
8543 Normally GCC examines a 32- or 64-bit integer constant to
8544 see if it can construct it from smaller constants in two or three
8545 instructions.  If it cannot, it will output the constant as a literal and
8546 generate code to load it from the data segment at runtime.
8547
8548 Use this option to require GCC to construct @emph{all} integer constants
8549 using code, even if it takes more instructions (the maximum is six).
8550
8551 You would typically use this option to build a shared library dynamic
8552 loader.  Itself a shared library, it must relocate itself in memory
8553 before it can find the variables and constants in its own data segment.
8554
8555 @item -malpha-as
8556 @itemx -mgas
8557 @opindex malpha-as
8558 @opindex mgas
8559 Select whether to generate code to be assembled by the vendor-supplied
8560 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
8561
8562 @item -mbwx
8563 @itemx -mno-bwx
8564 @itemx -mcix
8565 @itemx -mno-cix
8566 @itemx -mmax
8567 @itemx -mno-max
8568 @opindex mbwx
8569 @opindex mno-bwx
8570 @opindex mcix
8571 @opindex mno-cix
8572 @opindex mmax
8573 @opindex mno-max
8574 Indicate whether GCC should generate code to use the optional BWX,
8575 CIX, and MAX instruction sets.  The default is to use the instruction sets
8576 supported by the CPU type specified via @option{-mcpu=} option or that
8577 of the CPU on which GCC was built if none was specified.
8578
8579 @item -mcpu=@var{cpu_type}
8580 @opindex mcpu
8581 Set the instruction set, register set, and instruction scheduling
8582 parameters for machine type @var{cpu_type}.  You can specify either the
8583 @samp{EV} style name or the corresponding chip number.  GCC
8584 supports scheduling parameters for the EV4 and EV5 family of processors
8585 and will choose the default values for the instruction set from
8586 the processor you specify.  If you do not specify a processor type,
8587 GCC will default to the processor on which the compiler was built.
8588
8589 Supported values for @var{cpu_type} are
8590
8591 @table @samp
8592 @item ev4
8593 @itemx 21064
8594 Schedules as an EV4 and has no instruction set extensions.
8595
8596 @item ev5
8597 @itemx 21164
8598 Schedules as an EV5 and has no instruction set extensions.
8599
8600 @item ev56
8601 @itemx 21164a
8602 Schedules as an EV5 and supports the BWX extension.
8603
8604 @item pca56
8605 @itemx 21164pc
8606 @itemx 21164PC
8607 Schedules as an EV5 and supports the BWX and MAX extensions.
8608
8609 @item ev6
8610 @itemx 21264
8611 Schedules as an EV5 (until Digital releases the scheduling parameters
8612 for the EV6) and supports the BWX, CIX, and MAX extensions.
8613 @end table
8614
8615 @item -mmemory-latency=@var{time}
8616 @opindex mmemory-latency
8617 Sets the latency the scheduler should assume for typical memory
8618 references as seen by the application.  This number is highly
8619 dependent on the memory access patterns used by the application
8620 and the size of the external cache on the machine.
8621
8622 Valid options for @var{time} are
8623
8624 @table @samp
8625 @item @var{number}
8626 A decimal number representing clock cycles.
8627
8628 @item L1
8629 @itemx L2
8630 @itemx L3
8631 @itemx main
8632 The compiler contains estimates of the number of clock cycles for
8633 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
8634 (also called Dcache, Scache, and Bcache), as well as to main memory.
8635 Note that L3 is only valid for EV5.
8636
8637 @end table
8638 @end table
8639
8640 @node Clipper Options
8641 @subsection Clipper Options
8642
8643 These @samp{-m} options are defined for the Clipper implementations:
8644
8645 @table @gcctabopt
8646 @item -mc300
8647 @opindex mc300
8648 Produce code for a C300 Clipper processor.  This is the default.
8649
8650 @item -mc400
8651 @opindex mc400
8652 Produce code for a C400 Clipper processor, i.e.@: use floating point
8653 registers f8--f15.
8654 @end table
8655
8656 @node H8/300 Options
8657 @subsection H8/300 Options
8658
8659 These @samp{-m} options are defined for the H8/300 implementations:
8660
8661 @table @gcctabopt
8662 @item -mrelax
8663 @opindex mrelax
8664 Shorten some address references at link time, when possible; uses the
8665 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
8666 ld.info, Using ld}, for a fuller description.
8667
8668 @item -mh
8669 @opindex mh
8670 Generate code for the H8/300H@.
8671
8672 @item -ms
8673 @opindex ms
8674 Generate code for the H8/S@.
8675
8676 @item -ms2600
8677 @opindex ms2600
8678 Generate code for the H8/S2600.  This switch must be used with @option{-ms}.
8679
8680 @item -mint32
8681 @opindex mint32
8682 Make @code{int} data 32 bits by default.
8683
8684 @item -malign-300
8685 @opindex malign-300
8686 On the H8/300H and H8/S, use the same alignment rules as for the H8/300.
8687 The default for the H8/300H and H8/S is to align longs and floats on 4
8688 byte boundaries.
8689 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
8690 This option has no effect on the H8/300.
8691 @end table
8692
8693 @node SH Options
8694 @subsection SH Options
8695
8696 These @samp{-m} options are defined for the SH implementations:
8697
8698 @table @gcctabopt
8699 @item -m1
8700 @opindex m1
8701 Generate code for the SH1.
8702
8703 @item -m2
8704 @opindex m2
8705 Generate code for the SH2.
8706
8707 @item -m3
8708 @opindex m3
8709 Generate code for the SH3.
8710
8711 @item -m3e
8712 @opindex m3e
8713 Generate code for the SH3e.
8714
8715 @item -m4-nofpu
8716 @opindex m4-nofpu
8717 Generate code for the SH4 without a floating-point unit.
8718
8719 @item -m4-single-only
8720 @opindex m4-single-only
8721 Generate code for the SH4 with a floating-point unit that only
8722 supports single-precision arithmetic.
8723
8724 @item -m4-single
8725 @opindex m4-single
8726 Generate code for the SH4 assuming the floating-point unit is in
8727 single-precision mode by default.
8728
8729 @item -m4
8730 @opindex m4
8731 Generate code for the SH4.
8732
8733 @item -mb
8734 @opindex mb
8735 Compile code for the processor in big endian mode.
8736
8737 @item -ml
8738 @opindex ml
8739 Compile code for the processor in little endian mode.
8740
8741 @item -mdalign
8742 @opindex mdalign
8743 Align doubles at 64-bit boundaries.  Note that this changes the calling
8744 conventions, and thus some functions from the standard C library will
8745 not work unless you recompile it first with @option{-mdalign}.
8746
8747 @item -mrelax
8748 @opindex mrelax
8749 Shorten some address references at link time, when possible; uses the
8750 linker option @option{-relax}.
8751
8752 @item -mbigtable
8753 @opindex mbigtable
8754 Use 32-bit offsets in @code{switch} tables.  The default is to use
8755 16-bit offsets.
8756
8757 @item -mfmovd
8758 @opindex mfmovd
8759 Enable the use of the instruction @code{fmovd}.
8760
8761 @item -mhitachi
8762 @opindex mhitachi
8763 Comply with the calling conventions defined by Hitachi.
8764
8765 @item -mnomacsave
8766 @opindex mnomacsave
8767 Mark the @code{MAC} register as call-clobbered, even if
8768 @option{-mhitachi} is given.
8769
8770 @item -mieee
8771 @opindex mieee
8772 Increase IEEE-compliance of floating-point code.
8773
8774 @item -misize
8775 @opindex misize
8776 Dump instruction size and location in the assembly code.
8777
8778 @item -mpadstruct
8779 @opindex mpadstruct
8780 This option is deprecated.  It pads structures to multiple of 4 bytes,
8781 which is incompatible with the SH ABI@.
8782
8783 @item -mspace
8784 @opindex mspace
8785 Optimize for space instead of speed.  Implied by @option{-Os}.
8786
8787 @item -mprefergot
8788 @opindex mprefergot
8789 When generating position-independent code, emit function calls using
8790 the Global Offset Table instead of the Procedure Linkage Table.
8791
8792 @item -musermode
8793 @opindex musermode
8794 Generate a library function call to invalidate instruction cache
8795 entries, after fixing up a trampoline.  This library function call
8796 doesn't assume it can write to the whole memory address space.  This
8797 is the default when the target is @code{sh-*-linux*}.
8798 @end table
8799
8800 @node System V Options
8801 @subsection Options for System V
8802
8803 These additional options are available on System V Release 4 for
8804 compatibility with other compilers on those systems:
8805
8806 @table @gcctabopt
8807 @item -G
8808 @opindex G
8809 Create a shared object.
8810 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
8811
8812 @item -Qy
8813 @opindex Qy
8814 Identify the versions of each tool used by the compiler, in a
8815 @code{.ident} assembler directive in the output.
8816
8817 @item -Qn
8818 @opindex Qn
8819 Refrain from adding @code{.ident} directives to the output file (this is
8820 the default).
8821
8822 @item -YP,@var{dirs}
8823 @opindex YP
8824 Search the directories @var{dirs}, and no others, for libraries
8825 specified with @option{-l}.
8826
8827 @item -Ym,@var{dir}
8828 @opindex Ym
8829 Look in the directory @var{dir} to find the M4 preprocessor.
8830 The assembler uses this option.
8831 @c This is supposed to go with a -Yd for predefined M4 macro files, but
8832 @c the generic assembler that comes with Solaris takes just -Ym.
8833 @end table
8834
8835 @node TMS320C3x/C4x Options
8836 @subsection TMS320C3x/C4x Options
8837 @cindex TMS320C3x/C4x Options
8838
8839 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
8840
8841 @table @gcctabopt
8842
8843 @item -mcpu=@var{cpu_type}
8844 @opindex mcpu
8845 Set the instruction set, register set, and instruction scheduling
8846 parameters for machine type @var{cpu_type}.  Supported values for
8847 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
8848 @samp{c44}.  The default is @samp{c40} to generate code for the
8849 TMS320C40.
8850
8851 @item -mbig-memory
8852 @item -mbig
8853 @itemx -msmall-memory
8854 @itemx -msmall
8855 @opindex mbig-memory
8856 @opindex mbig
8857 @opindex msmall-memory
8858 @opindex msmall
8859 Generates code for the big or small memory model.  The small memory
8860 model assumed that all data fits into one 64K word page.  At run-time
8861 the data page (DP) register must be set to point to the 64K page
8862 containing the .bss and .data program sections.  The big memory model is
8863 the default and requires reloading of the DP register for every direct
8864 memory access.
8865
8866 @item -mbk
8867 @itemx -mno-bk
8868 @opindex mbk
8869 @opindex mno-bk
8870 Allow (disallow) allocation of general integer operands into the block
8871 count register BK@.
8872
8873 @item -mdb
8874 @itemx -mno-db
8875 @opindex mdb
8876 @opindex mno-db
8877 Enable (disable) generation of code using decrement and branch,
8878 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
8879 on the safe side, this is disabled for the C3x, since the maximum
8880 iteration count on the C3x is @math{2^23 + 1} (but who iterates loops more than
8881 @math{2^23} times on the C3x?).  Note that GCC will try to reverse a loop so
8882 that it can utilise the decrement and branch instruction, but will give
8883 up if there is more than one memory reference in the loop.  Thus a loop
8884 where the loop counter is decremented can generate slightly more
8885 efficient code, in cases where the RPTB instruction cannot be utilised.
8886
8887 @item -mdp-isr-reload
8888 @itemx -mparanoid
8889 @opindex mdp-isr-reload
8890 @opindex mparanoid
8891 Force the DP register to be saved on entry to an interrupt service
8892 routine (ISR), reloaded to point to the data section, and restored on
8893 exit from the ISR@.  This should not be required unless someone has
8894 violated the small memory model by modifying the DP register, say within
8895 an object library.
8896
8897 @item -mmpyi
8898 @itemx -mno-mpyi
8899 @opindex mmpyi
8900 @opindex mno-mpyi
8901 For the C3x use the 24-bit MPYI instruction for integer multiplies
8902 instead of a library call to guarantee 32-bit results.  Note that if one
8903 of the operands is a constant, then the multiplication will be performed
8904 using shifts and adds.  If the @option{-mmpyi} option is not specified for the C3x,
8905 then squaring operations are performed inline instead of a library call.
8906
8907 @item -mfast-fix
8908 @itemx -mno-fast-fix
8909 @opindex mfast-fix
8910 @opindex mno-fast-fix
8911 The C3x/C4x FIX instruction to convert a floating point value to an
8912 integer value chooses the nearest integer less than or equal to the
8913 floating point value rather than to the nearest integer.  Thus if the
8914 floating point number is negative, the result will be incorrectly
8915 truncated an additional code is necessary to detect and correct this
8916 case.  This option can be used to disable generation of the additional
8917 code required to correct the result.
8918
8919 @item -mrptb
8920 @itemx -mno-rptb
8921 @opindex mrptb
8922 @opindex mno-rptb
8923 Enable (disable) generation of repeat block sequences using the RPTB
8924 instruction for zero overhead looping.  The RPTB construct is only used
8925 for innermost loops that do not call functions or jump across the loop
8926 boundaries.  There is no advantage having nested RPTB loops due to the
8927 overhead required to save and restore the RC, RS, and RE registers.
8928 This is enabled by default with @option{-O2}.
8929
8930 @item -mrpts=@var{count}
8931 @itemx -mno-rpts
8932 @opindex mrpts
8933 @opindex mno-rpts
8934 Enable (disable) the use of the single instruction repeat instruction
8935 RPTS@.  If a repeat block contains a single instruction, and the loop
8936 count can be guaranteed to be less than the value @var{count}, GCC will
8937 emit a RPTS instruction instead of a RPTB@.  If no value is specified,
8938 then a RPTS will be emitted even if the loop count cannot be determined
8939 at compile time.  Note that the repeated instruction following RPTS does
8940 not have to be reloaded from memory each iteration, thus freeing up the
8941 CPU buses for operands.  However, since interrupts are blocked by this
8942 instruction, it is disabled by default.
8943
8944 @item -mloop-unsigned
8945 @itemx -mno-loop-unsigned
8946 @opindex mloop-unsigned
8947 @opindex mno-loop-unsigned
8948 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
8949 is @math{2^31 + 1} since these instructions test if the iteration count is
8950 negative to terminate the loop.  If the iteration count is unsigned
8951 there is a possibility than the @math{2^31 + 1} maximum iteration count may be
8952 exceeded.  This switch allows an unsigned iteration count.
8953
8954 @item -mti
8955 @opindex mti
8956 Try to emit an assembler syntax that the TI assembler (asm30) is happy
8957 with.  This also enforces compatibility with the API employed by the TI
8958 C3x C compiler.  For example, long doubles are passed as structures
8959 rather than in floating point registers.
8960
8961 @item -mregparm
8962 @itemx -mmemparm
8963 @opindex mregparm
8964 @opindex mmemparm
8965 Generate code that uses registers (stack) for passing arguments to functions.
8966 By default, arguments are passed in registers where possible rather
8967 than by pushing arguments on to the stack.
8968
8969 @item -mparallel-insns
8970 @itemx -mno-parallel-insns
8971 @opindex mparallel-insns
8972 @opindex mno-parallel-insns
8973 Allow the generation of parallel instructions.  This is enabled by
8974 default with @option{-O2}.
8975
8976 @item -mparallel-mpy
8977 @itemx -mno-parallel-mpy
8978 @opindex mparallel-mpy
8979 @opindex mno-parallel-mpy
8980 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
8981 provided @option{-mparallel-insns} is also specified.  These instructions have
8982 tight register constraints which can pessimize the code generation
8983 of large functions.
8984
8985 @end table
8986
8987 @node V850 Options
8988 @subsection V850 Options
8989 @cindex V850 Options
8990
8991 These @samp{-m} options are defined for V850 implementations:
8992
8993 @table @gcctabopt
8994 @item -mlong-calls
8995 @itemx -mno-long-calls
8996 @opindex mlong-calls
8997 @opindex mno-long-calls
8998 Treat all calls as being far away (near).  If calls are assumed to be
8999 far away, the compiler will always load the functions address up into a
9000 register, and call indirect through the pointer.
9001
9002 @item -mno-ep
9003 @itemx -mep
9004 @opindex mno-ep
9005 @opindex mep
9006 Do not optimize (do optimize) basic blocks that use the same index
9007 pointer 4 or more times to copy pointer into the @code{ep} register, and
9008 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
9009 option is on by default if you optimize.
9010
9011 @item -mno-prolog-function
9012 @itemx -mprolog-function
9013 @opindex mno-prolog-function
9014 @opindex mprolog-function
9015 Do not use (do use) external functions to save and restore registers at
9016 the prolog and epilog of a function.  The external functions are slower,
9017 but use less code space if more than one function saves the same number
9018 of registers.  The @option{-mprolog-function} option is on by default if
9019 you optimize.
9020
9021 @item -mspace
9022 @opindex mspace
9023 Try to make the code as small as possible.  At present, this just turns
9024 on the @option{-mep} and @option{-mprolog-function} options.
9025
9026 @item -mtda=@var{n}
9027 @opindex mtda
9028 Put static or global variables whose size is @var{n} bytes or less into
9029 the tiny data area that register @code{ep} points to.  The tiny data
9030 area can hold up to 256 bytes in total (128 bytes for byte references).
9031
9032 @item -msda=@var{n}
9033 @opindex msda
9034 Put static or global variables whose size is @var{n} bytes or less into
9035 the small data area that register @code{gp} points to.  The small data
9036 area can hold up to 64 kilobytes.
9037
9038 @item -mzda=@var{n}
9039 @opindex mzda
9040 Put static or global variables whose size is @var{n} bytes or less into
9041 the first 32 kilobytes of memory.
9042
9043 @item -mv850
9044 @opindex mv850
9045 Specify that the target processor is the V850.
9046
9047 @item -mbig-switch
9048 @opindex mbig-switch
9049 Generate code suitable for big switch tables.  Use this option only if
9050 the assembler/linker complain about out of range branches within a switch
9051 table.
9052 @end table
9053
9054 @node ARC Options
9055 @subsection ARC Options
9056 @cindex ARC Options
9057
9058 These options are defined for ARC implementations:
9059
9060 @table @gcctabopt
9061 @item -EL
9062 @opindex EL
9063 Compile code for little endian mode.  This is the default.
9064
9065 @item -EB
9066 @opindex EB
9067 Compile code for big endian mode.
9068
9069 @item -mmangle-cpu
9070 @opindex mmangle-cpu
9071 Prepend the name of the cpu to all public symbol names.
9072 In multiple-processor systems, there are many ARC variants with different
9073 instruction and register set characteristics.  This flag prevents code
9074 compiled for one cpu to be linked with code compiled for another.
9075 No facility exists for handling variants that are ``almost identical''.
9076 This is an all or nothing option.
9077
9078 @item -mcpu=@var{cpu}
9079 @opindex mcpu
9080 Compile code for ARC variant @var{cpu}.
9081 Which variants are supported depend on the configuration.
9082 All variants support @option{-mcpu=base}, this is the default.
9083
9084 @item -mtext=@var{text-section}
9085 @itemx -mdata=@var{data-section}
9086 @itemx -mrodata=@var{readonly-data-section}
9087 @opindex mtext
9088 @opindex mdata
9089 @opindex mrodata
9090 Put functions, data, and readonly data in @var{text-section},
9091 @var{data-section}, and @var{readonly-data-section} respectively
9092 by default.  This can be overridden with the @code{section} attribute.
9093 @xref{Variable Attributes}.
9094
9095 @end table
9096
9097 @node NS32K Options
9098 @subsection NS32K Options
9099 @cindex NS32K options
9100
9101 These are the @samp{-m} options defined for the 32000 series.  The default
9102 values for these options depends on which style of 32000 was selected when
9103 the compiler was configured; the defaults for the most common choices are
9104 given below.
9105
9106 @table @gcctabopt
9107 @item -m32032
9108 @itemx -m32032
9109 @opindex m32032
9110 @opindex m32032
9111 Generate output for a 32032.  This is the default
9112 when the compiler is configured for 32032 and 32016 based systems.
9113
9114 @item -m32332
9115 @itemx -m32332
9116 @opindex m32332
9117 @opindex m32332
9118 Generate output for a 32332.  This is the default
9119 when the compiler is configured for 32332-based systems.
9120
9121 @item -m32532
9122 @itemx -m32532
9123 @opindex m32532
9124 @opindex m32532
9125 Generate output for a 32532.  This is the default
9126 when the compiler is configured for 32532-based systems.
9127
9128 @item -m32081
9129 @opindex m32081
9130 Generate output containing 32081 instructions for floating point.
9131 This is the default for all systems.
9132
9133 @item -m32381
9134 @opindex m32381
9135 Generate output containing 32381 instructions for floating point.  This
9136 also implies @option{-m32081}.  The 32381 is only compatible with the 32332
9137 and 32532 cpus.  This is the default for the pc532-netbsd configuration.
9138
9139 @item -mmulti-add
9140 @opindex mmulti-add
9141 Try and generate multiply-add floating point instructions @code{polyF}
9142 and @code{dotF}.  This option is only available if the @option{-m32381}
9143 option is in effect.  Using these instructions requires changes to
9144 register allocation which generally has a negative impact on
9145 performance.  This option should only be enabled when compiling code
9146 particularly likely to make heavy use of multiply-add instructions.
9147
9148 @item -mnomulti-add
9149 @opindex mnomulti-add
9150 Do not try and generate multiply-add floating point instructions
9151 @code{polyF} and @code{dotF}.  This is the default on all platforms.
9152
9153 @item -msoft-float
9154 @opindex msoft-float
9155 Generate output containing library calls for floating point.
9156 @strong{Warning:} the requisite libraries may not be available.
9157
9158 @item -mnobitfield
9159 @opindex mnobitfield
9160 Do not use the bit-field instructions.  On some machines it is faster to
9161 use shifting and masking operations.  This is the default for the pc532.
9162
9163 @item -mbitfield
9164 @opindex mbitfield
9165 Do use the bit-field instructions.  This is the default for all platforms
9166 except the pc532.
9167
9168 @item -mrtd
9169 @opindex mrtd
9170 Use a different function-calling convention, in which functions
9171 that take a fixed number of arguments return pop their
9172 arguments on return with the @code{ret} instruction.
9173
9174 This calling convention is incompatible with the one normally
9175 used on Unix, so you cannot use it if you need to call libraries
9176 compiled with the Unix compiler.
9177
9178 Also, you must provide function prototypes for all functions that
9179 take variable numbers of arguments (including @code{printf});
9180 otherwise incorrect code will be generated for calls to those
9181 functions.
9182
9183 In addition, seriously incorrect code will result if you call a
9184 function with too many arguments.  (Normally, extra arguments are
9185 harmlessly ignored.)
9186
9187 This option takes its name from the 680x0 @code{rtd} instruction.
9188
9189
9190 @item -mregparam
9191 @opindex mregparam
9192 Use a different function-calling convention where the first two arguments
9193 are passed in registers.
9194
9195 This calling convention is incompatible with the one normally
9196 used on Unix, so you cannot use it if you need to call libraries
9197 compiled with the Unix compiler.
9198
9199 @item -mnoregparam
9200 @opindex mnoregparam
9201 Do not pass any arguments in registers.  This is the default for all
9202 targets.
9203
9204 @item -msb
9205 @opindex msb
9206 It is OK to use the sb as an index register which is always loaded with
9207 zero.  This is the default for the pc532-netbsd target.
9208
9209 @item -mnosb
9210 @opindex mnosb
9211 The sb register is not available for use or has not been initialized to
9212 zero by the run time system.  This is the default for all targets except
9213 the pc532-netbsd.  It is also implied whenever @option{-mhimem} or
9214 @option{-fpic} is set.
9215
9216 @item -mhimem
9217 @opindex mhimem
9218 Many ns32000 series addressing modes use displacements of up to 512MB@.
9219 If an address is above 512MB then displacements from zero can not be used.
9220 This option causes code to be generated which can be loaded above 512MB@.
9221 This may be useful for operating systems or ROM code.
9222
9223 @item -mnohimem
9224 @opindex mnohimem
9225 Assume code will be loaded in the first 512MB of virtual address space.
9226 This is the default for all platforms.
9227
9228
9229 @end table
9230
9231 @node AVR Options
9232 @subsection AVR Options
9233 @cindex AVR Options
9234
9235 These options are defined for AVR implementations:
9236
9237 @table @gcctabopt
9238 @item -mmcu=@var{mcu}
9239 @opindex mmcu
9240 Specify ATMEL AVR instruction set or MCU type.
9241
9242 Instruction set avr1 is for the minimal AVR core, not supported by the C
9243 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
9244 attiny11, attiny12, attiny15, attiny28).
9245
9246 Instruction set avr2 (default) is for the classic AVR core with up to
9247 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
9248 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
9249 at90c8534, at90s8535).
9250
9251 Instruction set avr3 is for the classic AVR core with up to 128K program
9252 memory space (MCU types: atmega103, atmega603).
9253
9254 Instruction set avr4 is for the enhanced AVR core with up to 8K program
9255 memory space (MCU types: atmega83, atmega85).
9256
9257 Instruction set avr5 is for the enhanced AVR core with up to 128K program
9258 memory space (MCU types: atmega161, atmega163, atmega32, at94k).
9259
9260 @item -msize
9261 @opindex msize
9262 Output instruction sizes to the asm file.
9263
9264 @item -minit-stack=@var{N}
9265 @opindex minit-stack
9266 Specify the initial stack address, which may be a symbol or numeric value,
9267 @samp{__stack} is the default.
9268
9269 @item -mno-interrupts
9270 @opindex mno-interrupts
9271 Generated code is not compatible with hardware interrupts.
9272 Code size will be smaller.
9273
9274 @item -mcall-prologues
9275 @opindex mcall-prologues
9276 Functions prologues/epilogues expanded as call to appropriate
9277 subroutines.  Code size will be smaller.
9278
9279 @item -mno-tablejump
9280 @opindex mno-tablejump
9281 Do not generate tablejump insns which sometimes increase code size.
9282
9283 @item -mtiny-stack
9284 @opindex mtiny-stack
9285 Change only the low 8 bits of the stack pointer.
9286 @end table
9287
9288 @node MCore Options
9289 @subsection MCore Options
9290 @cindex MCore options
9291
9292 These are the @samp{-m} options defined for the Motorola M*Core
9293 processors.
9294
9295 @table @gcctabopt
9296
9297 @item -mhardlit
9298 @itemx -mhardlit
9299 @itemx -mno-hardlit
9300 @opindex mhardlit
9301 @opindex mhardlit
9302 @opindex mno-hardlit
9303 Inline constants into the code stream if it can be done in two
9304 instructions or less.
9305
9306 @item -mdiv
9307 @itemx -mdiv
9308 @itemx -mno-div
9309 @opindex mdiv
9310 @opindex mdiv
9311 @opindex mno-div
9312 Use the divide instruction.  (Enabled by default).
9313
9314 @item -mrelax-immediate
9315 @itemx -mrelax-immediate
9316 @itemx -mno-relax-immediate
9317 @opindex mrelax-immediate
9318 @opindex mrelax-immediate
9319 @opindex mno-relax-immediate
9320 Allow arbitrary sized immediates in bit operations.
9321
9322 @item -mwide-bitfields
9323 @itemx -mwide-bitfields
9324 @itemx -mno-wide-bitfields
9325 @opindex mwide-bitfields
9326 @opindex mwide-bitfields
9327 @opindex mno-wide-bitfields
9328 Always treat bit-fields as int-sized.
9329
9330 @item -m4byte-functions
9331 @itemx -m4byte-functions
9332 @itemx -mno-4byte-functions
9333 @opindex m4byte-functions
9334 @opindex m4byte-functions
9335 @opindex mno-4byte-functions
9336 Force all functions to be aligned to a four byte boundary.
9337
9338 @item -mcallgraph-data
9339 @itemx -mcallgraph-data
9340 @itemx -mno-callgraph-data
9341 @opindex mcallgraph-data
9342 @opindex mcallgraph-data
9343 @opindex mno-callgraph-data
9344 Emit callgraph information.
9345
9346 @item -mslow-bytes
9347 @itemx -mslow-bytes
9348 @itemx -mno-slow-bytes
9349 @opindex mslow-bytes
9350 @opindex mslow-bytes
9351 @opindex mno-slow-bytes
9352 Prefer word access when reading byte quantities.
9353
9354 @item -mlittle-endian
9355 @itemx -mlittle-endian
9356 @itemx -mbig-endian
9357 @opindex mlittle-endian
9358 @opindex mlittle-endian
9359 @opindex mbig-endian
9360 Generate code for a little endian target.
9361
9362 @item -m210
9363 @itemx -m210
9364 @itemx -m340
9365 @opindex m210
9366 @opindex m210
9367 @opindex m340
9368 Generate code for the 210 processor.
9369 @end table
9370
9371 @node IA-64 Options
9372 @subsection IA-64 Options
9373 @cindex IA-64 Options
9374
9375 These are the @samp{-m} options defined for the Intel IA-64 architecture.
9376
9377 @table @gcctabopt
9378 @item -mbig-endian
9379 @opindex mbig-endian
9380 Generate code for a big endian target.  This is the default for HPUX@.
9381
9382 @item -mlittle-endian
9383 @opindex mlittle-endian
9384 Generate code for a little endian target.  This is the default for AIX5
9385 and Linux.
9386
9387 @item -mgnu-as
9388 @itemx -mno-gnu-as
9389 @opindex mgnu-as
9390 @opindex mno-gnu-as
9391 Generate (or don't) code for the GNU assembler.  This is the default.
9392 @c Also, this is the default if the configure option @option{--with-gnu-as}
9393 @c is used.
9394
9395 @item -mgnu-ld
9396 @itemx -mno-gnu-ld
9397 @opindex mgnu-ld
9398 @opindex mno-gnu-ld
9399 Generate (or don't) code for the GNU linker.  This is the default.
9400 @c Also, this is the default if the configure option @option{--with-gnu-ld}
9401 @c is used.
9402
9403 @item -mno-pic
9404 @opindex mno-pic
9405 Generate code that does not use a global pointer register.  The result
9406 is not position independent code, and violates the IA-64 ABI@.
9407
9408 @item -mvolatile-asm-stop
9409 @itemx -mno-volatile-asm-stop
9410 @opindex mvolatile-asm-stop
9411 @opindex mno-volatile-asm-stop
9412 Generate (or don't) a stop bit immediately before and after volatile asm
9413 statements.
9414
9415 @item -mb-step
9416 @opindex mb-step
9417 Generate code that works around Itanium B step errata.
9418
9419 @item -mregister-names
9420 @itemx -mno-register-names
9421 @opindex mregister-names
9422 @opindex mno-register-names
9423 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
9424 the stacked registers.  This may make assembler output more readable.
9425
9426 @item -mno-sdata
9427 @itemx -msdata
9428 @opindex mno-sdata
9429 @opindex msdata
9430 Disable (or enable) optimizations that use the small data section.  This may
9431 be useful for working around optimizer bugs.
9432
9433 @item -mconstant-gp
9434 @opindex mconstant-gp
9435 Generate code that uses a single constant global pointer value.  This is
9436 useful when compiling kernel code.
9437
9438 @item -mauto-pic
9439 @opindex mauto-pic
9440 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
9441 This is useful when compiling firmware code.
9442
9443 @item -minline-divide-min-latency
9444 @opindex minline-divide-min-latency
9445 Generate code for inline divides using the minimum latency algorithm.
9446
9447 @item -minline-divide-max-throughput
9448 @opindex minline-divide-max-throughput
9449 Generate code for inline divides using the maximum throughput algorithm.
9450
9451 @item -mno-dwarf2-asm
9452 @itemx -mdwarf2-asm
9453 @opindex mno-dwarf2-asm
9454 @opindex mdwarf2-asm
9455 Don't (or do) generate assembler code for the DWARF2 line number debugging
9456 info.  This may be useful when not using the GNU assembler.
9457
9458 @item -mfixed-range=@var{register-range}
9459 @opindex mfixed-range
9460 Generate code treating the given register range as fixed registers.
9461 A fixed register is one that the register allocator can not use.  This is
9462 useful when compiling kernel code.  A register range is specified as
9463 two registers separated by a dash.  Multiple register ranges can be
9464 specified separated by a comma.
9465 @end table
9466
9467 @node D30V Options
9468 @subsection D30V Options
9469 @cindex D30V Options
9470
9471 These @samp{-m} options are defined for D30V implementations:
9472
9473 @table @gcctabopt
9474 @item -mextmem
9475 @opindex mextmem
9476 Link the @samp{.text}, @samp{.data}, @samp{.bss}, @samp{.strings},
9477 @samp{.rodata}, @samp{.rodata1}, @samp{.data1} sections into external
9478 memory, which starts at location @code{0x80000000}.
9479
9480 @item -mextmemory
9481 @opindex mextmemory
9482 Same as the @option{-mextmem} switch.
9483
9484 @item -monchip
9485 @opindex monchip
9486 Link the @samp{.text} section into onchip text memory, which starts at
9487 location @code{0x0}.  Also link @samp{.data}, @samp{.bss},
9488 @samp{.strings}, @samp{.rodata}, @samp{.rodata1}, @samp{.data1} sections
9489 into onchip data memory, which starts at location @code{0x20000000}.
9490
9491 @item -mno-asm-optimize
9492 @itemx -masm-optimize
9493 @opindex mno-asm-optimize
9494 @opindex masm-optimize
9495 Disable (enable) passing @option{-O} to the assembler when optimizing.
9496 The assembler uses the @option{-O} option to automatically parallelize
9497 adjacent short instructions where possible.
9498
9499 @item -mbranch-cost=@var{n}
9500 @opindex mbranch-cost
9501 Increase the internal costs of branches to @var{n}.  Higher costs means
9502 that the compiler will issue more instructions to avoid doing a branch.
9503 The default is 2.
9504
9505 @item -mcond-exec=@var{n}
9506 @opindex mcond-exec
9507 Specify the maximum number of conditionally executed instructions that
9508 replace a branch.  The default is 4.
9509 @end table
9510
9511 @node S/390 and zSeries Options
9512 @subsection S/390 and zSeries Options
9513 @cindex S/390 and zSeries Options
9514
9515 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
9516
9517 @table @gcctabopt
9518 @item -mhard-float
9519 @itemx -msoft-float
9520 @opindex mhard-float
9521 @opindex msoft-float
9522 Use (do not use) the hardware floating-point instructions and registers
9523 for floating-point operations.  When @option{-msoft-float} is specified,
9524 functions in @file{libgcc.a} will be used to perform floating-point
9525 operations.  When @option{-mhard-float} is specified, the compiler
9526 generates IEEE floating-point instructions.  This is the default.
9527
9528 @item -mbackchain
9529 @itemx -mno-backchain
9530 @opindex mbackchain
9531 @opindex mno-backchain
9532 Generate (or do not generate) code which maintains an explicit 
9533 backchain within the stack frame that points to the caller's frame.
9534 This is currently needed to allow debugging.  The default is to
9535 generate the backchain.
9536
9537 @item -msmall-exec
9538 @itemx -mno-small-exec
9539 @opindex msmall-exec
9540 @opindex mno-small-exec
9541 Generate (or do not generate) code using the @code{bras} instruction 
9542 to do subroutine calls. 
9543 This only works reliably if the total executable size does not
9544 exceed 64k.  The default is to use the @code{basr} instruction instead,
9545 which does not have this limitation.
9546
9547 @item -m64
9548 @itemx -m31
9549 @opindex m64
9550 @opindex m31
9551 When @option{-m31} is specified, generate code compliant to the
9552 Linux for S/390 ABI@.  When @option{-m64} is specified, generate
9553 code compliant to the Linux for zSeries ABI@.  This allows GCC in
9554 particular to generate 64-bit instructions.  For the @samp{s390}
9555 targets, the default is @option{-m31}, while the @samp{s390x} 
9556 targets default to @option{-m64}.
9557
9558 @item -mmvcle
9559 @itemx -mno-mvcle
9560 @opindex mmvcle
9561 @opindex mno-mvcle
9562 Generate (or do not generate) code using the @code{mvcle} instruction 
9563 to perform block moves.  When @option{-mno-mvcle} is specifed,
9564 use a @code{mvc} loop instead.  This is the default.
9565
9566 @item -mdebug
9567 @itemx -mno-debug
9568 @opindex mdebug
9569 @opindex mno-debug
9570 Print (or do not print) additional debug information when compiling.
9571 The default is to not print debug information.
9572
9573 @end table
9574
9575 @node CRIS Options
9576 @subsection CRIS Options
9577 @cindex CRIS Options
9578
9579 These options are defined specifically for the CRIS ports.
9580
9581 @table @gcctabopt
9582 @item -march=@var{architecture-type}
9583 @itemx -mcpu=@var{architecture-type}
9584 @opindex march
9585 @opindex mcpu
9586 Generate code for the specified architecture.  The choices for
9587 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
9588 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX.
9589 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
9590 @samp{v10}.
9591
9592 @item -mtune=@var{architecture-type}
9593 @opindex mtune
9594 Tune to @var{architecture-type} everything applicable about the generated
9595 code, except for the ABI and the set of available instructions.  The
9596 choices for @var{architecture-type} are the same as for
9597 @option{-march=@var{architecture-type}}.
9598
9599 @item -mmax-stack-frame=@var{n}
9600 @opindex mmax-stack-frame
9601 Warn when the stack frame of a function exceeds @var{n} bytes.
9602
9603 @item -melinux-stacksize=@var{n}
9604 @opindex melinux-stacksize
9605 Only available with the @samp{cris-axis-aout} target.  Arranges for
9606 indications in the program to the kernel loader that the stack of the
9607 program should be set to @var{n} bytes.
9608
9609 @item -metrax4
9610 @itemx -metrax100
9611 @opindex metrax4
9612 @opindex metrax100
9613 The options @option{-metrax4} and @option{-metrax100} are synonyms for
9614 @option{-march=v3} and @option{-march=v8} respectively.
9615
9616 @item -mpdebug
9617 @opindex mpdebug
9618 Enable CRIS-specific verbose debug-related information in the assembly
9619 code.  This option also has the effect to turn off the @samp{#NO_APP}
9620 formatted-code indicator to the assembler at the beginning of the
9621 assembly file.
9622
9623 @item -mcc-init
9624 @opindex mcc-init
9625 Do not use condition-code results from previous instruction; always emit
9626 compare and test instructions before use of condition codes.
9627
9628 @item -mno-side-effects
9629 @opindex mno-side-effects
9630 Do not emit instructions with side-effects in addressing modes other than
9631 post-increment.
9632
9633 @item -mstack-align
9634 @itemx -mno-stack-align
9635 @itemx -mdata-align
9636 @itemx -mno-data-align
9637 @itemx -mconst-align
9638 @itemx -mno-const-align
9639 @opindex mstack-align
9640 @opindex mno-stack-align
9641 @opindex mdata-align
9642 @opindex mno-data-align
9643 @opindex mconst-align
9644 @opindex mno-const-align
9645 These options (no-options) arranges (eliminate arrangements) for the
9646 stack-frame, individual data and constants to be aligned for the maximum
9647 single data access size for the chosen CPU model.  The default is to
9648 arrange for 32-bit alignment.  ABI details such as structure layout are
9649 not affected by these options.
9650
9651 @item -m32-bit
9652 @itemx -m16-bit
9653 @itemx -m8-bit
9654 @opindex m32-bit
9655 @opindex m16-bit
9656 @opindex m8-bit
9657 Similar to the stack- data- and const-align options above, these options
9658 arrange for stack-frame, writable data and constants to all be 32-bit,
9659 16-bit or 8-bit aligned.  The default is 32-bit alignment.
9660
9661 @item -mno-prologue-epilogue
9662 @itemx -mprologue-epilogue
9663 @opindex mno-prologue-epilogue
9664 @opindex mprologue-epilogue
9665 With @option{-mno-prologue-epilogue}, the normal function prologue and
9666 epilogue that sets up the stack-frame are omitted and no return
9667 instructions or return sequences are generated in the code.  Use this
9668 option only together with visual inspection of the compiled code: no
9669 warnings or errors are generated when call-saved registers must be saved,
9670 or storage for local variable needs to be allocated.
9671
9672 @item -mno-gotplt
9673 @itemx -mgotplt
9674 @opindex mno-gotplt
9675 @opindex mgotplt
9676 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
9677 instruction sequences that load addresses for functions from the PLT part
9678 of the GOT rather than (traditional on other architectures) calls to the
9679 PLT.  The default is @option{-mgotplt}.
9680
9681 @item -maout
9682 @opindex maout
9683 Legacy no-op option only recognized with the cris-axis-aout target.
9684
9685 @item -melf
9686 @opindex melf
9687 Legacy no-op option only recognized with the cris-axis-elf and
9688 cris-axis-linux-gnu targets.
9689
9690 @item -melinux
9691 @opindex melinux
9692 Only recognized with the cris-axis-aout target, where it selects a
9693 GNU/linux-like multilib, include files and instruction set for
9694 @option{-march=v8}.
9695
9696 @item -mlinux
9697 @opindex mlinux
9698 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
9699
9700 @item -sim
9701 @opindex sim
9702 This option, recognized for the cris-axis-aout and cris-axis-elf arranges
9703 to link with input-output functions from a simulator library.  Code,
9704 initialized data and zero-initialized data are allocated consecutively.
9705
9706 @item -sim2
9707 @opindex sim2
9708 Like @option{-sim}, but pass linker options to locate initialized data at
9709 0x40000000 and zero-initialized data at 0x80000000.
9710 @end table
9711
9712 @node MMIX Options
9713 @subsection MMIX Options
9714 @cindex MMIX Options
9715
9716 These options are defined for the MMIX:
9717
9718 @table @code
9719 @item -mlibfuncs
9720 @itemx -mno-libfuncs
9721 Specify that intrinsic library functions are being compiled, passing all
9722 values in registers, no matter the size.
9723
9724 @item -mepsilon
9725 @itemx -mno-epsilon
9726 Generate floating-point comparison instructions that compare with respect
9727 to the @code{rE} epsilon register.
9728
9729 @item -mabi=mmixware
9730 @itemx -mabi=gnu
9731 Generate code that passes function parameters and return values that (in
9732 the called function) are seen as registers @code{$0} and up, as opposed to
9733 the GNU ABI which uses global registers @code{$231} and up.
9734
9735 @item -mzero-extend
9736 @item -mno-zero-extend
9737 When reading data from memory in sizes shorter than 64 bits, use (do not
9738 use) zero-extending load instructions by default, rather than
9739 sign-extending ones.
9740
9741 @item -mknuthdiv
9742 @itemx -mno-knuthdiv
9743 Make the result of a division yielding a remainder have the same sign as
9744 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
9745 remainder follows the sign of the dividend.  Both methods are
9746 arithmetically valid, the latter being almost exclusively used.
9747
9748 @item -mtoplevel-symbols
9749 @itemx -mno-toplevel-symbols
9750 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
9751 code can be used with the @code{PREFIX} assembly directive.
9752
9753 @item -melf
9754 Generate an executable in the ELF format, rather than the default
9755 @samp{mmo} format used by the @command{mmix} simulator.
9756 @end table
9757
9758 @node Code Gen Options
9759 @section Options for Code Generation Conventions
9760 @cindex code generation conventions
9761 @cindex options, code generation
9762 @cindex run-time options
9763
9764 These machine-independent options control the interface conventions
9765 used in code generation.
9766
9767 Most of them have both positive and negative forms; the negative form
9768 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
9769 one of the forms is listed---the one which is not the default.  You
9770 can figure out the other form by either removing @samp{no-} or adding
9771 it.
9772
9773 @table @gcctabopt
9774 @item -fexceptions
9775 @opindex fexceptions
9776 Enable exception handling.  Generates extra code needed to propagate
9777 exceptions.  For some targets, this implies GCC will generate frame
9778 unwind information for all functions, which can produce significant data
9779 size overhead, although it does not affect execution.  If you do not
9780 specify this option, GCC will enable it by default for languages like
9781 C++ which normally require exception handling, and disable it for
9782 languages like C that do not normally require it.  However, you may need
9783 to enable this option when compiling C code that needs to interoperate
9784 properly with exception handlers written in C++.  You may also wish to
9785 disable this option if you are compiling older C++ programs that don't
9786 use exception handling.
9787
9788 @item -fnon-call-exceptions
9789 @opindex fnon-call-exceptions
9790 Generate code that allows trapping instructions to throw exceptions.
9791 Note that this requires platform-specific runtime support that does
9792 not exist everywhere.  Moreover, it only allows @emph{trapping}
9793 instructions to throw exceptions, i.e.@: memory references or floating
9794 point instructions.  It does not allow exceptions to be thrown from
9795 arbitrary signal handlers such as @code{SIGALRM}.
9796
9797 @item -funwind-tables
9798 @opindex funwind-tables
9799 Similar to @option{-fexceptions}, except that it will just generate any needed
9800 static data, but will not affect the generated code in any other way.
9801 You will normally not enable this option; instead, a language processor
9802 that needs this handling would enable it on your behalf.
9803
9804 @item -fasynchronous-unwind-tables
9805 @opindex funwind-tables
9806 Generate unwind table in dwarf2 format, if supported by target machine.  The
9807 table is exact at each instruction boundary, so it can be used for stack
9808 unwinding from asynchronous events (such as debugger or garbage collector).
9809
9810 @item -fpcc-struct-return
9811 @opindex fpcc-struct-return
9812 Return ``short'' @code{struct} and @code{union} values in memory like
9813 longer ones, rather than in registers.  This convention is less
9814 efficient, but it has the advantage of allowing intercallability between
9815 GCC-compiled files and files compiled with other compilers.
9816
9817 The precise convention for returning structures in memory depends
9818 on the target configuration macros.
9819
9820 Short structures and unions are those whose size and alignment match
9821 that of some integer type.
9822
9823 @item -freg-struct-return
9824 @opindex freg-struct-return
9825 Return @code{struct} and @code{union} values in registers when possible.
9826 This is more efficient for small structures than
9827 @option{-fpcc-struct-return}.
9828
9829 If you specify neither @option{-fpcc-struct-return} nor
9830 @option{-freg-struct-return}, GCC defaults to whichever convention is
9831 standard for the target.  If there is no standard convention, GCC
9832 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
9833 the principal compiler.  In those cases, we can choose the standard, and
9834 we chose the more efficient register return alternative.
9835
9836 @item -fshort-enums
9837 @opindex fshort-enums
9838 Allocate to an @code{enum} type only as many bytes as it needs for the
9839 declared range of possible values.  Specifically, the @code{enum} type
9840 will be equivalent to the smallest integer type which has enough room.
9841
9842 @item -fshort-double
9843 @opindex fshort-double
9844 Use the same size for @code{double} as for @code{float}.
9845
9846 @item -fshared-data
9847 @opindex fshared-data
9848 Requests that the data and non-@code{const} variables of this
9849 compilation be shared data rather than private data.  The distinction
9850 makes sense only on certain operating systems, where shared data is
9851 shared between processes running the same program, while private data
9852 exists in one copy per process.
9853
9854 @item -fno-common
9855 @opindex fno-common
9856 In C, allocate even uninitialized global variables in the data section of the
9857 object file, rather than generating them as common blocks.  This has the
9858 effect that if the same variable is declared (without @code{extern}) in
9859 two different compilations, you will get an error when you link them.
9860 The only reason this might be useful is if you wish to verify that the
9861 program will work on other systems which always work this way.
9862
9863 @item -fno-ident
9864 @opindex fno-ident
9865 Ignore the @samp{#ident} directive.
9866
9867 @item -fno-gnu-linker
9868 @opindex fno-gnu-linker
9869 Do not output global initializations (such as C++ constructors and
9870 destructors) in the form used by the GNU linker (on systems where the GNU
9871 linker is the standard method of handling them).  Use this option when
9872 you want to use a non-GNU linker, which also requires using the
9873 @command{collect2} program to make sure the system linker includes
9874 constructors and destructors.  (@command{collect2} is included in the GCC
9875 distribution.)  For systems which @emph{must} use @command{collect2}, the
9876 compiler driver @command{gcc} is configured to do this automatically.
9877
9878 @item -finhibit-size-directive
9879 @opindex finhibit-size-directive
9880 Don't output a @code{.size} assembler directive, or anything else that
9881 would cause trouble if the function is split in the middle, and the
9882 two halves are placed at locations far apart in memory.  This option is
9883 used when compiling @file{crtstuff.c}; you should not need to use it
9884 for anything else.
9885
9886 @item -fverbose-asm
9887 @opindex fverbose-asm
9888 Put extra commentary information in the generated assembly code to
9889 make it more readable.  This option is generally only of use to those
9890 who actually need to read the generated assembly code (perhaps while
9891 debugging the compiler itself).
9892
9893 @option{-fno-verbose-asm}, the default, causes the
9894 extra information to be omitted and is useful when comparing two assembler
9895 files.
9896
9897 @item -fvolatile
9898 @opindex fvolatile
9899 Consider all memory references through pointers to be volatile.
9900
9901 @item -fvolatile-global
9902 @opindex fvolatile-global
9903 Consider all memory references to extern and global data items to
9904 be volatile.  GCC does not consider static data items to be volatile
9905 because of this switch.
9906
9907 @item -fvolatile-static
9908 @opindex fvolatile-static
9909 Consider all memory references to static data to be volatile.
9910
9911 @item -fpic
9912 @opindex fpic
9913 @cindex global offset table
9914 @cindex PIC
9915 Generate position-independent code (PIC) suitable for use in a shared
9916 library, if supported for the target machine.  Such code accesses all
9917 constant addresses through a global offset table (GOT)@.  The dynamic
9918 loader resolves the GOT entries when the program starts (the dynamic
9919 loader is not part of GCC; it is part of the operating system).  If
9920 the GOT size for the linked executable exceeds a machine-specific
9921 maximum size, you get an error message from the linker indicating that
9922 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
9923 instead.  (These maximums are 16k on the m88k, 8k on the Sparc, and 32k
9924 on the m68k and RS/6000.  The 386 has no such limit.)
9925
9926 Position-independent code requires special support, and therefore works
9927 only on certain machines.  For the 386, GCC supports PIC for System V
9928 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
9929 position-independent.
9930
9931 @item -fPIC
9932 @opindex fPIC
9933 If supported for the target machine, emit position-independent code,
9934 suitable for dynamic linking and avoiding any limit on the size of the
9935 global offset table.  This option makes a difference on the m68k, m88k,
9936 and the Sparc.
9937
9938 Position-independent code requires special support, and therefore works
9939 only on certain machines.
9940
9941 @item -ffixed-@var{reg}
9942 @opindex ffixed
9943 Treat the register named @var{reg} as a fixed register; generated code
9944 should never refer to it (except perhaps as a stack pointer, frame
9945 pointer or in some other fixed role).
9946
9947 @var{reg} must be the name of a register.  The register names accepted
9948 are machine-specific and are defined in the @code{REGISTER_NAMES}
9949 macro in the machine description macro file.
9950
9951 This flag does not have a negative form, because it specifies a
9952 three-way choice.
9953
9954 @item -fcall-used-@var{reg}
9955 @opindex fcall-used
9956 Treat the register named @var{reg} as an allocable register that is
9957 clobbered by function calls.  It may be allocated for temporaries or
9958 variables that do not live across a call.  Functions compiled this way
9959 will not save and restore the register @var{reg}.
9960
9961 It is an error to used this flag with the frame pointer or stack pointer.
9962 Use of this flag for other registers that have fixed pervasive roles in
9963 the machine's execution model will produce disastrous results.
9964
9965 This flag does not have a negative form, because it specifies a
9966 three-way choice.
9967
9968 @item -fcall-saved-@var{reg}
9969 @opindex fcall-saved
9970 Treat the register named @var{reg} as an allocable register saved by
9971 functions.  It may be allocated even for temporaries or variables that
9972 live across a call.  Functions compiled this way will save and restore
9973 the register @var{reg} if they use it.
9974
9975 It is an error to used this flag with the frame pointer or stack pointer.
9976 Use of this flag for other registers that have fixed pervasive roles in
9977 the machine's execution model will produce disastrous results.
9978
9979 A different sort of disaster will result from the use of this flag for
9980 a register in which function values may be returned.
9981
9982 This flag does not have a negative form, because it specifies a
9983 three-way choice.
9984
9985 @item -fpack-struct
9986 @opindex fpack-struct
9987 Pack all structure members together without holes.  Usually you would
9988 not want to use this option, since it makes the code suboptimal, and
9989 the offsets of structure members won't agree with system libraries.
9990
9991 @item -fcheck-memory-usage
9992 @opindex fcheck-memory-usage
9993 Generate extra code to check each memory access.  GCC will generate
9994 code that is suitable for a detector of bad memory accesses such as
9995 @file{Checker}.
9996
9997 Normally, you should compile all, or none, of your code with this option.
9998
9999 If you do mix code compiled with and without this option,
10000 you must ensure that all code that has side effects
10001 and that is called by code compiled with this option
10002 is, itself, compiled with this option.
10003 If you do not, you might get erroneous messages from the detector.
10004
10005 If you use functions from a library that have side-effects (such as
10006 @code{read}), you might not be able to recompile the library and
10007 specify this option.  In that case, you can enable the
10008 @option{-fprefix-function-name} option, which requests GCC to encapsulate
10009 your code and make other functions look as if they were compiled with
10010 @option{-fcheck-memory-usage}.  This is done by calling ``stubs'',
10011 which are provided by the detector.  If you cannot find or build
10012 stubs for every function you call, you might have to specify
10013 @option{-fcheck-memory-usage} without @option{-fprefix-function-name}.
10014
10015 If you specify this option, you can not use the @code{asm} or
10016 @code{__asm__} keywords in functions with memory checking enabled.  GCC
10017 cannot understand what the @code{asm} statement may do, and therefore
10018 cannot generate the appropriate code, so it will reject it.  However, if
10019 you specify the function attribute @code{no_check_memory_usage}
10020 (@pxref{Function Attributes}), GCC will disable memory checking within a
10021 function; you may use @code{asm} statements inside such functions.  You
10022 may have an inline expansion of a non-checked function within a checked
10023 function; in that case GCC will not generate checks for the inlined
10024 function's memory accesses.
10025
10026 If you move your @code{asm} statements to non-checked inline functions
10027 and they do access memory, you can add calls to the support code in your
10028 inline function, to indicate any reads, writes, or copies being done.
10029 These calls would be similar to those done in the stubs described above.
10030
10031 @item -fprefix-function-name
10032 @opindex fprefix-function-name
10033 Request GCC to add a prefix to the symbols generated for function names.
10034 GCC adds a prefix to the names of functions defined as well as
10035 functions called.  Code compiled with this option and code compiled
10036 without the option can't be linked together, unless stubs are used.
10037
10038 If you compile the following code with @option{-fprefix-function-name}
10039 @example
10040 extern void bar (int);
10041 void
10042 foo (int a)
10043 @{
10044   return bar (a + 5);
10045 @}
10046 @end example
10047
10048 @noindent
10049 GCC will compile the code as if it was written:
10050 @example
10051 extern void prefix_bar (int);
10052 void
10053 prefix_foo (int a)
10054 @{
10055   return prefix_bar (a + 5);
10056 @}
10057 @end example
10058 This option is designed to be used with @option{-fcheck-memory-usage}.
10059
10060 @item -finstrument-functions
10061 @opindex finstrument-functions
10062 Generate instrumentation calls for entry and exit to functions.  Just
10063 after function entry and just before function exit, the following
10064 profiling functions will be called with the address of the current
10065 function and its call site.  (On some platforms,
10066 @code{__builtin_return_address} does not work beyond the current
10067 function, so the call site information may not be available to the
10068 profiling functions otherwise.)
10069
10070 @example
10071 void __cyg_profile_func_enter (void *this_fn,
10072                                void *call_site);
10073 void __cyg_profile_func_exit  (void *this_fn,
10074                                void *call_site);
10075 @end example
10076
10077 The first argument is the address of the start of the current function,
10078 which may be looked up exactly in the symbol table.
10079
10080 This instrumentation is also done for functions expanded inline in other
10081 functions.  The profiling calls will indicate where, conceptually, the
10082 inline function is entered and exited.  This means that addressable
10083 versions of such functions must be available.  If all your uses of a
10084 function are expanded inline, this may mean an additional expansion of
10085 code size.  If you use @samp{extern inline} in your C code, an
10086 addressable version of such functions must be provided.  (This is
10087 normally the case anyways, but if you get lucky and the optimizer always
10088 expands the functions inline, you might have gotten away without
10089 providing static copies.)
10090
10091 A function may be given the attribute @code{no_instrument_function}, in
10092 which case this instrumentation will not be done.  This can be used, for
10093 example, for the profiling functions listed above, high-priority
10094 interrupt routines, and any functions from which the profiling functions
10095 cannot safely be called (perhaps signal handlers, if the profiling
10096 routines generate output or allocate memory).
10097
10098 @item -fstack-check
10099 @opindex fstack-check
10100 Generate code to verify that you do not go beyond the boundary of the
10101 stack.  You should specify this flag if you are running in an
10102 environment with multiple threads, but only rarely need to specify it in
10103 a single-threaded environment since stack overflow is automatically
10104 detected on nearly all systems if there is only one stack.
10105
10106 Note that this switch does not actually cause checking to be done; the
10107 operating system must do that.  The switch causes generation of code
10108 to ensure that the operating system sees the stack being extended.
10109
10110 @item -fstack-limit-register=@var{reg}
10111 @itemx -fstack-limit-symbol=@var{sym}
10112 @itemx -fno-stack-limit
10113 @opindex fstack-limit-register
10114 @opindex fstack-limit-symbol
10115 @opindex fno-stack-limit
10116 Generate code to ensure that the stack does not grow beyond a certain value,
10117 either the value of a register or the address of a symbol.  If the stack
10118 would grow beyond the value, a signal is raised.  For most targets,
10119 the signal is raised before the stack overruns the boundary, so
10120 it is possible to catch the signal without taking special precautions.
10121
10122 For instance, if the stack starts at absolute address @samp{0x80000000}
10123 and grows downwards, you can use the flags
10124 @option{-fstack-limit-symbol=__stack_limit} and
10125 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
10126 of 128KB@.  Note that this may only work with the GNU linker.
10127
10128 @cindex aliasing of parameters
10129 @cindex parameters, aliased
10130 @item -fargument-alias
10131 @itemx -fargument-noalias
10132 @itemx -fargument-noalias-global
10133 @opindex fargument-alias
10134 @opindex fargument-noalias
10135 @opindex fargument-noalias-global
10136 Specify the possible relationships among parameters and between
10137 parameters and global data.
10138
10139 @option{-fargument-alias} specifies that arguments (parameters) may
10140 alias each other and may alias global storage.@*
10141 @option{-fargument-noalias} specifies that arguments do not alias
10142 each other, but may alias global storage.@*
10143 @option{-fargument-noalias-global} specifies that arguments do not
10144 alias each other and do not alias global storage.
10145
10146 Each language will automatically use whatever option is required by
10147 the language standard.  You should not need to use these options yourself.
10148
10149 @item -fleading-underscore
10150 @opindex fleading-underscore
10151 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
10152 change the way C symbols are represented in the object file.  One use
10153 is to help link with legacy assembly code.
10154
10155 Be warned that you should know what you are doing when invoking this
10156 option, and that not all targets provide complete support for it.
10157 @end table
10158
10159 @c man end
10160
10161 @node Environment Variables
10162 @section Environment Variables Affecting GCC
10163 @cindex environment variables
10164
10165 @c man begin ENVIRONMENT
10166
10167 This section describes several environment variables that affect how GCC
10168 operates.  Some of them work by specifying directories or prefixes to use
10169 when searching for various kinds of files.  Some are used to specify other
10170 aspects of the compilation environment.
10171
10172 @ifclear INTERNALS
10173 Note that you can also specify places to search using options such as
10174 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
10175 take precedence over places specified using environment variables, which
10176 in turn take precedence over those specified by the configuration of GCC@.
10177
10178 @end ifclear
10179 @ifset INTERNALS
10180 Note that you can also specify places to search using options such as
10181 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
10182 take precedence over places specified using environment variables, which
10183 in turn take precedence over those specified by the configuration of GCC@.
10184 @xref{Driver}.
10185 @end ifset
10186
10187 @table @env
10188 @item LANG
10189 @itemx LC_CTYPE
10190 @c @itemx LC_COLLATE
10191 @itemx LC_MESSAGES
10192 @c @itemx LC_MONETARY
10193 @c @itemx LC_NUMERIC
10194 @c @itemx LC_TIME
10195 @itemx LC_ALL
10196 @findex LANG
10197 @findex LC_CTYPE
10198 @c @findex LC_COLLATE
10199 @findex LC_MESSAGES
10200 @c @findex LC_MONETARY
10201 @c @findex LC_NUMERIC
10202 @c @findex LC_TIME
10203 @findex LC_ALL
10204 @cindex locale
10205 These environment variables control the way that GCC uses
10206 localization information that allow GCC to work with different
10207 national conventions.  GCC inspects the locale categories
10208 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
10209 so.  These locale categories can be set to any value supported by your
10210 installation.  A typical value is @samp{en_UK} for English in the United
10211 Kingdom.
10212
10213 The @env{LC_CTYPE} environment variable specifies character
10214 classification.  GCC uses it to determine the character boundaries in
10215 a string; this is needed for some multibyte encodings that contain quote
10216 and escape characters that would otherwise be interpreted as a string
10217 end or escape.
10218
10219 The @env{LC_MESSAGES} environment variable specifies the language to
10220 use in diagnostic messages.
10221
10222 If the @env{LC_ALL} environment variable is set, it overrides the value
10223 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
10224 and @env{LC_MESSAGES} default to the value of the @env{LANG}
10225 environment variable.  If none of these variables are set, GCC
10226 defaults to traditional C English behavior.
10227
10228 @item TMPDIR
10229 @findex TMPDIR
10230 If @env{TMPDIR} is set, it specifies the directory to use for temporary
10231 files.  GCC uses temporary files to hold the output of one stage of
10232 compilation which is to be used as input to the next stage: for example,
10233 the output of the preprocessor, which is the input to the compiler
10234 proper.
10235
10236 @item GCC_EXEC_PREFIX
10237 @findex GCC_EXEC_PREFIX
10238 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
10239 names of the subprograms executed by the compiler.  No slash is added
10240 when this prefix is combined with the name of a subprogram, but you can
10241 specify a prefix that ends with a slash if you wish.
10242
10243 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
10244 an appropriate prefix to use based on the pathname it was invoked with.
10245
10246 If GCC cannot find the subprogram using the specified prefix, it
10247 tries looking in the usual places for the subprogram.
10248
10249 The default value of @env{GCC_EXEC_PREFIX} is
10250 @file{@var{prefix}/lib/gcc-lib/} where @var{prefix} is the value
10251 of @code{prefix} when you ran the @file{configure} script.
10252
10253 Other prefixes specified with @option{-B} take precedence over this prefix.
10254
10255 This prefix is also used for finding files such as @file{crt0.o} that are
10256 used for linking.
10257
10258 In addition, the prefix is used in an unusual way in finding the
10259 directories to search for header files.  For each of the standard
10260 directories whose name normally begins with @samp{/usr/local/lib/gcc-lib}
10261 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
10262 replacing that beginning with the specified prefix to produce an
10263 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
10264 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
10265 These alternate directories are searched first; the standard directories
10266 come next.
10267
10268 @item COMPILER_PATH
10269 @findex COMPILER_PATH
10270 The value of @env{COMPILER_PATH} is a colon-separated list of
10271 directories, much like @env{PATH}.  GCC tries the directories thus
10272 specified when searching for subprograms, if it can't find the
10273 subprograms using @env{GCC_EXEC_PREFIX}.
10274
10275 @item LIBRARY_PATH
10276 @findex LIBRARY_PATH
10277 The value of @env{LIBRARY_PATH} is a colon-separated list of
10278 directories, much like @env{PATH}.  When configured as a native compiler,
10279 GCC tries the directories thus specified when searching for special
10280 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
10281 using GCC also uses these directories when searching for ordinary
10282 libraries for the @option{-l} option (but directories specified with
10283 @option{-L} come first).
10284
10285 @item C_INCLUDE_PATH
10286 @itemx CPLUS_INCLUDE_PATH
10287 @itemx OBJC_INCLUDE_PATH
10288 @findex C_INCLUDE_PATH
10289 @findex CPLUS_INCLUDE_PATH
10290 @findex OBJC_INCLUDE_PATH
10291 @c @itemx OBJCPLUS_INCLUDE_PATH
10292 These environment variables pertain to particular languages.  Each
10293 variable's value is a colon-separated list of directories, much like
10294 @env{PATH}.  When GCC searches for header files, it tries the
10295 directories listed in the variable for the language you are using, after
10296 the directories specified with @option{-I} but before the standard header
10297 file directories.
10298
10299 @item DEPENDENCIES_OUTPUT
10300 @findex DEPENDENCIES_OUTPUT
10301 @cindex dependencies for make as output
10302 If this variable is set, its value specifies how to output dependencies
10303 for Make based on the header files processed by the compiler.  This
10304 output looks much like the output from the @option{-M} option
10305 (@pxref{Preprocessor Options}), but it goes to a separate file, and is
10306 in addition to the usual results of compilation.
10307
10308 The value of @env{DEPENDENCIES_OUTPUT} can be just a file name, in
10309 which case the Make rules are written to that file, guessing the target
10310 name from the source file name.  Or the value can have the form
10311 @samp{@var{file} @var{target}}, in which case the rules are written to
10312 file @var{file} using @var{target} as the target name.
10313
10314 @item LANG
10315 @findex LANG
10316 @cindex locale definition
10317 This variable is used to pass locale information to the compiler.  One way in
10318 which this information is used is to determine the character set to be used
10319 when character literals, string literals and comments are parsed in C and C++.
10320 When the compiler is configured to allow multibyte characters,
10321 the following values for @env{LANG} are recognized:
10322
10323 @table @samp
10324 @item C-JIS
10325 Recognize JIS characters.
10326 @item C-SJIS
10327 Recognize SJIS characters.
10328 @item C-EUCJP
10329 Recognize EUCJP characters.
10330 @end table
10331
10332 If @env{LANG} is not defined, or if it has some other value, then the
10333 compiler will use mblen and mbtowc as defined by the default locale to
10334 recognize and translate multibyte characters.
10335 @end table
10336
10337 @c man end
10338
10339 @node Running Protoize
10340 @section Running Protoize
10341
10342 The program @code{protoize} is an optional part of GCC@.  You can use
10343 it to add prototypes to a program, thus converting the program to ISO
10344 C in one respect.  The companion program @code{unprotoize} does the
10345 reverse: it removes argument types from any prototypes that are found.
10346
10347 When you run these programs, you must specify a set of source files as
10348 command line arguments.  The conversion programs start out by compiling
10349 these files to see what functions they define.  The information gathered
10350 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
10351
10352 After scanning comes actual conversion.  The specified files are all
10353 eligible to be converted; any files they include (whether sources or
10354 just headers) are eligible as well.
10355
10356 But not all the eligible files are converted.  By default,
10357 @code{protoize} and @code{unprotoize} convert only source and header
10358 files in the current directory.  You can specify additional directories
10359 whose files should be converted with the @option{-d @var{directory}}
10360 option.  You can also specify particular files to exclude with the
10361 @option{-x @var{file}} option.  A file is converted if it is eligible, its
10362 directory name matches one of the specified directory names, and its
10363 name within the directory has not been excluded.
10364
10365 Basic conversion with @code{protoize} consists of rewriting most
10366 function definitions and function declarations to specify the types of
10367 the arguments.  The only ones not rewritten are those for varargs
10368 functions.
10369
10370 @code{protoize} optionally inserts prototype declarations at the
10371 beginning of the source file, to make them available for any calls that
10372 precede the function's definition.  Or it can insert prototype
10373 declarations with block scope in the blocks where undeclared functions
10374 are called.
10375
10376 Basic conversion with @code{unprotoize} consists of rewriting most
10377 function declarations to remove any argument types, and rewriting
10378 function definitions to the old-style pre-ISO form.
10379
10380 Both conversion programs print a warning for any function declaration or
10381 definition that they can't convert.  You can suppress these warnings
10382 with @option{-q}.
10383
10384 The output from @code{protoize} or @code{unprotoize} replaces the
10385 original source file.  The original file is renamed to a name ending
10386 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
10387 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
10388 for DOS) file already exists, then the source file is simply discarded.
10389
10390 @code{protoize} and @code{unprotoize} both depend on GCC itself to
10391 scan the program and collect information about the functions it uses.
10392 So neither of these programs will work until GCC is installed.
10393
10394 Here is a table of the options you can use with @code{protoize} and
10395 @code{unprotoize}.  Each option works with both programs unless
10396 otherwise stated.
10397
10398 @table @code
10399 @item -B @var{directory}
10400 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
10401 usual directory (normally @file{/usr/local/lib}).  This file contains
10402 prototype information about standard system functions.  This option
10403 applies only to @code{protoize}.
10404
10405 @item -c @var{compilation-options}
10406 Use  @var{compilation-options} as the options when running @code{gcc} to
10407 produce the @samp{.X} files.  The special option @option{-aux-info} is
10408 always passed in addition, to tell @code{gcc} to write a @samp{.X} file.
10409
10410 Note that the compilation options must be given as a single argument to
10411 @code{protoize} or @code{unprotoize}.  If you want to specify several
10412 @code{gcc} options, you must quote the entire set of compilation options
10413 to make them a single word in the shell.
10414
10415 There are certain @code{gcc} arguments that you cannot use, because they
10416 would produce the wrong kind of output.  These include @option{-g},
10417 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
10418 the @var{compilation-options}, they are ignored.
10419
10420 @item -C
10421 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
10422 systems) instead of @samp{.c}.  This is convenient if you are converting
10423 a C program to C++.  This option applies only to @code{protoize}.
10424
10425 @item -g
10426 Add explicit global declarations.  This means inserting explicit
10427 declarations at the beginning of each source file for each function
10428 that is called in the file and was not declared.  These declarations
10429 precede the first function definition that contains a call to an
10430 undeclared function.  This option applies only to @code{protoize}.
10431
10432 @item -i @var{string}
10433 Indent old-style parameter declarations with the string @var{string}.
10434 This option applies only to @code{protoize}.
10435
10436 @code{unprotoize} converts prototyped function definitions to old-style
10437 function definitions, where the arguments are declared between the
10438 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
10439 uses five spaces as the indentation.  If you want to indent with just
10440 one space instead, use @option{-i " "}.
10441
10442 @item -k
10443 Keep the @samp{.X} files.  Normally, they are deleted after conversion
10444 is finished.
10445
10446 @item -l
10447 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
10448 a prototype declaration for each function in each block which calls the
10449 function without any declaration.  This option applies only to
10450 @code{protoize}.
10451
10452 @item -n
10453 Make no real changes.  This mode just prints information about the conversions
10454 that would have been done without @option{-n}.
10455
10456 @item -N
10457 Make no @samp{.save} files.  The original files are simply deleted.
10458 Use this option with caution.
10459
10460 @item -p @var{program}
10461 Use the program @var{program} as the compiler.  Normally, the name
10462 @file{gcc} is used.
10463
10464 @item -q
10465 Work quietly.  Most warnings are suppressed.
10466
10467 @item -v
10468 Print the version number, just like @option{-v} for @code{gcc}.
10469 @end table
10470
10471 If you need special compiler options to compile one of your program's
10472 source files, then you should generate that file's @samp{.X} file
10473 specially, by running @code{gcc} on that source file with the
10474 appropriate options and the option @option{-aux-info}.  Then run
10475 @code{protoize} on the entire set of files.  @code{protoize} will use
10476 the existing @samp{.X} file because it is newer than the source file.
10477 For example:
10478
10479 @example
10480 gcc -Dfoo=bar file1.c -aux-info file1.X
10481 protoize *.c
10482 @end example
10483
10484 @noindent
10485 You need to include the special files along with the rest in the
10486 @code{protoize} command, even though their @samp{.X} files already
10487 exist, because otherwise they won't get converted.
10488
10489 @xref{Protoize Caveats}, for more information on how to use
10490 @code{protoize} successfully.