OSDN Git Service

2001-05-22 Toon Moene <toon@moene.indiv.nluug.nl>
[pf3gnuchains/gcc-fork.git] / gcc / 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 make and distribute verbatim copies of this
12 manual provided the copyright notice and this permission notice are
13 preserved on all copies.
14
15 Permission is granted to copy and distribute modified versions of this
16 manual under the conditions for verbatim copying, provided also that the
17 entire resulting derived work is distributed under the terms of a
18 permission notice identical to this one.
19
20 Permission is granted to copy and distribute translations of this manual
21 into another language, under the above conditions for modified versions,
22 except that this permission notice may be included in translations
23 approved by the Free Software Foundation instead of in the original
24 English.
25 @c man end
26 @c Set file name and title for the man page.
27 @setfilename gcc
28 @settitle GNU project C and C++ compiler
29 @c man begin SYNOPSIS
30 gcc [@samp{-c}|@samp{-S}|@samp{-E}] [@samp{-std=}@var{standard}]
31     [@samp{-g}] [@samp{-pg}] [@samp{-O}@var{level}]
32     [@samp{-W}@var{warn}...] [@samp{-pedantic}]
33     [@samp{-I}@var{dir}...] [@samp{-L}@var{dir}...]
34     [@samp{-D}@var{macro}[=@var{defn}]...] [@samp{-U}@var{macro}]
35     [@samp{-f}@var{option}...] [@samp{-m}@var{machine-option}...]
36     [@samp{-o} @var{outfile}] @var{infile}...
37
38 Only the most useful options are listed here; see below for the
39 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
40 @c man end
41 @c man begin SEEALSO
42 cpp(1), gcov(1), g77(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
43 and the Info entries for @file{gcc}, @file{cpp}, @file{g77}, @file{as},
44 @file{ld}, @file{binutils} and @file{gdb}.
45 @c man end
46 @c man begin BUGS
47 For instructions on reporting bugs, see
48 @w{@uref{http://gcc.gnu.org/bugs.html}}.  Use of the @command{gccbug}
49 script to report bugs is recommended.
50 @c man end
51 @c man begin AUTHOR
52 See the Info entry for @file{gcc}, or
53 @w{@uref{http://gcc.gnu.org/thanks.html}}, for contributors to GCC.
54 @c man end
55 @end ignore
56
57 @node Invoking GCC
58 @chapter GCC Command Options
59 @cindex GCC command options
60 @cindex command options
61 @cindex options, GCC command
62
63 @c man begin DESCRIPTION
64
65 When you invoke GCC, it normally does preprocessing, compilation,
66 assembly and linking.  The ``overall options'' allow you to stop this
67 process at an intermediate stage.  For example, the @samp{-c} option
68 says not to run the linker.  Then the output consists of object files
69 output by the assembler.
70
71 Other options are passed on to one stage of processing.  Some options
72 control the preprocessor and others the compiler itself.  Yet other
73 options control the assembler and linker; most of these are not
74 documented here, since you rarely need to use any of them.
75
76 @cindex C compilation options
77 Most of the command line options that you can use with GCC are useful
78 for C programs; when an option is only useful with another language
79 (usually C++), the explanation says so explicitly.  If the description
80 for a particular option does not mention a source language, you can use
81 that option with all supported languages.
82
83 @cindex C++ compilation options
84 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
85 options for compiling C++ programs.
86
87 @cindex grouping options
88 @cindex options, grouping
89 The @command{gcc} program accepts options and file names as operands.  Many
90 options have multi-letter names; therefore multiple single-letter options
91 may @emph{not} be grouped: @samp{-dr} is very different from @w{@samp{-d
92 -r}}.
93
94 @cindex order of options
95 @cindex options, order
96 You can mix options and other arguments.  For the most part, the order
97 you use doesn't matter.  Order does matter when you use several options
98 of the same kind; for example, if you specify @samp{-L} more than once,
99 the directories are searched in the order specified.
100
101 Many options have long names starting with @samp{-f} or with
102 @samp{-W}---for example, @samp{-fforce-mem},
103 @samp{-fstrength-reduce}, @samp{-Wformat} and so on.  Most of
104 these have both positive and negative forms; the negative form of
105 @samp{-ffoo} would be @samp{-fno-foo}.  This manual documents
106 only one of these two forms, whichever one is not the default.
107
108 @c man end
109
110 @menu
111 * Option Summary::      Brief list of all options, without explanations.
112 * Overall Options::     Controlling the kind of output:
113                         an executable, object files, assembler files,
114                         or preprocessed source.
115 * Invoking G++::        Compiling C++ programs.
116 * C Dialect Options::   Controlling the variant of C language compiled.
117 * C++ Dialect Options:: Variations on C++.
118 * Objective-C Dialect Options:: Variations on Objective-C.
119 * Language Independent Options:: Controlling how diagnostics should be
120                         formatted.
121 * Warning Options::     How picky should the compiler be?
122 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
123 * Optimize Options::    How much optimization?
124 * Preprocessor Options:: Controlling header files and macro definitions.
125                          Also, getting dependency information for Make.
126 * Assembler Options::   Passing options to the assembler.
127 * Link Options::        Specifying libraries and so on.
128 * Directory Options::   Where to find header files and libraries.
129                         Where to find the compiler executable files.
130 * Spec Files::          How to pass switches to sub-processes.
131 * Target Options::      Running a cross-compiler, or an old version of GCC.
132 * Submodel Options::    Specifying minor hardware or convention variations,
133                         such as 68010 vs 68020.
134 * Code Gen Options::    Specifying conventions for function calls, data layout
135                         and register usage.
136 * Environment Variables:: Env vars that affect GCC.
137 * Running Protoize::    Automatically adding or removing function prototypes.
138 @end menu
139
140 @c man begin OPTIONS
141
142 @node Option Summary
143 @section Option Summary
144
145 Here is a summary of all the options, grouped by type.  Explanations are
146 in the following sections.
147
148 @table @emph
149 @item Overall Options
150 @xref{Overall Options,,Options Controlling the Kind of Output}.
151 @gccoptlist{
152 -c  -S  -E  -o @var{file}  -pipe  -pass-exit-codes  -x @var{language} @gol
153 -v  --target-help  --help}
154
155 @item C Language Options
156 @xref{C Dialect Options,,Options Controlling C Dialect}.
157 @gccoptlist{
158 -ansi  -std=@var{standard}  -fno-asm  -fno-builtin @gol
159 -fhosted  -ffreestanding @gol
160 -trigraphs  -traditional  -traditional-cpp @gol
161 -fallow-single-precision  -fcond-mismatch @gol
162 -fsigned-bitfields  -fsigned-char @gol
163 -funsigned-bitfields  -funsigned-char @gol
164 -fwritable-strings  -fshort-wchar}
165
166 @item C++ Language Options
167 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
168 @gccoptlist{
169 -fno-access-control  -fcheck-new  -fconserve-space @gol
170 -fno-const-strings  -fdollars-in-identifiers @gol
171 -fno-elide-constructors @gol
172 -fno-enforce-eh-specs  -fexternal-templates @gol
173 -falt-external-templates @gol
174 -ffor-scope  -fno-for-scope  -fno-gnu-keywords  -fhonor-std @gol
175 -fno-implicit-templates @gol
176 -fno-implicit-inline-templates @gol
177 -fno-implement-inlines  -fms-extensions @gol
178 -fno-nonansi-builtins  -fno-operator-names @gol
179 -fno-optional-diags  -fpermissive @gol
180 -frepo  -fno-rtti  -fstats  -ftemplate-depth-@var{n} @gol
181 -fuse-cxa-atexit  -fvtable-gc  -fno-weak  -nostdinc++ @gol
182 -fno-default-inline  -Wctor-dtor-privacy @gol
183 -Wnon-virtual-dtor  -Wreorder @gol
184 -Weffc++  -Wno-deprecated @gol
185 -Wno-non-template-friend  -Wold-style-cast @gol
186 -Woverloaded-virtual  -Wno-pmf-conversions @gol
187 -Wsign-promo  -Wsynth}
188
189 @item Objective-C Language Options
190 @xref{Objective-C Dialect Options,,Options Controlling Objective-C Dialect}.
191 @gccoptlist{
192 -fconstant-string-class=@var{class name} @gol
193 -fgnu-runtime  -fnext-runtime  -gen-decls
194 -Wno-protocol  -Wselector}
195
196 @item Language Independent Options
197 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
198 @gccoptlist{
199 -fmessage-length=@var{n}  @gol
200 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}}
201
202 @item Warning Options
203 @xref{Warning Options,,Options to Request or Suppress Warnings}.
204 @gccoptlist{
205 -fsyntax-only  -pedantic  -pedantic-errors @gol
206 -w  -W  -Wall  -Waggregate-return @gol
207 -Wcast-align  -Wcast-qual  -Wchar-subscripts  -Wcomment @gol
208 -Wconversion  -Wdisabled-optimization -Werror @gol
209 -Wfloat-equal  -Wformat  -Wformat=2 @gol
210 -Wformat-nonliteral -Wformat-security @gol
211 -Wid-clash-@var{len}  -Wimplicit -Wimplicit-int  @gol
212 -Wimplicit-function-declaration @gol
213 -Werror-implicit-function-declaration @gol
214 -Wimport  -Winline @gol
215 -Wlarger-than-@var{len}  -Wlong-long @gol
216 -Wmain  -Wmissing-braces  -Wmissing-declarations @gol
217 -Wmissing-format-attribute  -Wmissing-noreturn @gol
218 -Wmultichar  -Wno-format-extra-args -Wno-format-y2k @gol
219 -Wno-import  -Wpacked  -Wpadded @gol
220 -Wparentheses -Wpointer-arith  -Wredundant-decls @gol
221 -Wreturn-type  -Wsequence-point  -Wshadow @gol
222 -Wsign-compare  -Wswitch  -Wsystem-headers @gol
223 -Wtrigraphs  -Wundef  -Wuninitialized @gol
224 -Wunknown-pragmas  -Wunreachable-code @gol
225 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
226 -Wunused-value  -Wunused-variable  -Wwrite-strings}
227
228 @item C-only Warning Options
229 @gccoptlist{
230 -Wbad-function-cast -Wmissing-prototypes -Wnested-externs @gol
231 -Wstrict-prototypes -Wtraditional}
232
233 @item Debugging Options
234 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
235 @gccoptlist{
236 -a  -ax  -d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
237 -fdump-unnumbered -fdump-translation-unit=@var{file} @gol
238 -fdump-class-layout=@var{file}  -fmem-report  -fpretend-float @gol
239 -fprofile-arcs  -ftest-coverage  -ftime-report @gol
240 -g  -g@var{level}  -gcoff  -gdwarf  -gdwarf-1  -gdwarf-1+  -gdwarf-2 @gol
241 -ggdb  -gstabs  -gstabs+  -gxcoff  -gxcoff+ @gol
242 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
243 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
244 -save-temps  -time}
245
246 @item Optimization Options
247 @xref{Optimize Options,,Options that Control Optimization}.
248 @gccoptlist{
249 -falign-functions=@var{n}  -falign-jumps=@var{n} @gol
250 -falign-labels=@var{n}  -falign-loops=@var{n}  @gol
251 -fbranch-probabilities  -fcaller-saves @gol
252 -fcse-follow-jumps  -fcse-skip-blocks  -fdata-sections  -fdce @gol
253 -fdelayed-branch  -fdelete-null-pointer-checks @gol
254 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
255 -fforce-addr  -fforce-mem  -ffunction-sections  -fgcse  -fgcse-lm -fgcse-sm @gol
256 -finline-functions  -finline-limit=@var{n}  -fkeep-inline-functions @gol
257 -fkeep-static-consts  -fmove-all-movables @gol
258 -fno-default-inline  -fno-defer-pop @gol
259 -fno-function-cse   -fno-guess-branch-probability @gol
260 -fno-inline  -fno-math-errno  -fno-peephole @gol
261 -funsafe-math-optimizations -fno-trapping-math @gol
262 -fomit-frame-pointer  -foptimize-register-move @gol
263 -foptimize-sibling-calls  -freduce-all-givs @gol
264 -fregmove  -frename-registers @gol
265 -frerun-cse-after-loop  -frerun-loop-opt @gol
266 -fschedule-insns  -fschedule-insns2 @gol
267 -fsingle-precision-constant  -fssa @gol
268 -fstrength-reduce  -fstrict-aliasing  -fthread-jumps  -ftrapv @gol
269 -funroll-all-loops  -funroll-loops  @gol
270 --param @var{name}=@var{value}
271 -O  -O0  -O1  -O2  -O3  -Os}
272
273 @item Preprocessor Options
274 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
275 @gccoptlist{
276 -$  -A@var{question}=@var{answer}  -A-@var{question}@r{[}=@var{answer}@r{]} @gol
277 -C  -dD  -dI  -dM  -dN @gol
278 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
279 -idirafter @var{dir} @gol
280 -include @var{file}  -imacros @var{file} @gol
281 -iprefix @var{file}  -iwithprefix @var{dir} @gol
282 -iwithprefixbefore @var{dir}  -isystem @var{dir} -isystem-c++ @var{dir} @gol
283 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  -P  -remap @gol
284 -trigraphs  -undef  -U@var{macro}  -Wp\,@var{option}}
285
286 @item Assembler Option
287 @xref{Assembler Options,,Passing Options to the Assembler}.
288 @gccoptlist{
289 -Wa\,@var{option}}
290
291 @item Linker Options
292 @xref{Link Options,,Options for Linking}.
293 @gccoptlist{
294 @var{object-file-name}  -l@var{library} @gol
295 -nostartfiles  -nodefaultlibs  -nostdlib @gol
296 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
297 -Wl\,@var{option}  -Xlinker @var{option} @gol
298 -u @var{symbol}}
299
300 @item Directory Options
301 @xref{Directory Options,,Options for Directory Search}.
302 @gccoptlist{
303 -B@var{prefix}  -I@var{dir}  -I-  -L@var{dir}  -specs=@var{file}}
304
305 @item Target Options
306 @c I wrote this xref this way to avoid overfull hbox. -- rms
307 @xref{Target Options}.
308 @gccoptlist{
309 -b @var{machine}  -V @var{version}}
310
311 @item Machine Dependent Options
312 @xref{Submodel Options,,Hardware Models and Configurations}.
313 @emph{M680x0 Options}
314 @gccoptlist{
315 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
316 -m68060  -mcpu32 -m5200  -m68881  -mbitfield  -mc68000  -mc68020   @gol
317 -mfpa -mnobitfield  -mrtd  -mshort  -msoft-float  -mpcrel @gol
318 -malign-int -mstrict-align}
319
320 @emph{M68hc1x Options}
321 @gccoptlist{
322 -m6811  -m6812  -m68hc11  -m68hc12 @gol
323 -mauto-incdec  -mshort  -msoft-reg-count=@var{count}}
324
325 @emph{VAX Options}
326 @gccoptlist{
327 -mg  -mgnu  -munix}
328
329 @emph{SPARC Options}
330 @gccoptlist{
331 -mcpu=@var{cpu type} @gol
332 -mtune=@var{cpu type} @gol
333 -mcmodel=@var{code model} @gol
334 -m32  -m64 @gol
335 -mapp-regs  -mbroken-saverestore  -mcypress @gol
336 -mepilogue -mfaster-structs -mflat @gol
337 -mfpu  -mhard-float  -mhard-quad-float @gol
338 -mimpure-text  -mlive-g0  -mno-app-regs @gol
339 -mno-epilogue -mno-faster-structs -mno-flat  -mno-fpu @gol
340 -mno-impure-text -mno-stack-bias  -mno-unaligned-doubles @gol
341 -msoft-float  -msoft-quad-float  -msparclite  -mstack-bias @gol
342 -msupersparc  -munaligned-doubles  -mv8}
343
344 @emph{Convex Options}
345 @gccoptlist{
346 -mc1  -mc2  -mc32  -mc34  -mc38 @gol
347 -margcount  -mnoargcount @gol
348 -mlong32  -mlong64 @gol
349 -mvolatile-cache  -mvolatile-nocache}
350
351 @emph{AMD29K Options}
352 @gccoptlist{
353 -m29000  -m29050  -mbw  -mnbw  -mdw  -mndw @gol
354 -mlarge  -mnormal  -msmall @gol
355 -mkernel-registers  -mno-reuse-arg-regs @gol
356 -mno-stack-check  -mno-storem-bug @gol
357 -mreuse-arg-regs  -msoft-float  -mstack-check @gol
358 -mstorem-bug  -muser-registers}
359
360 @emph{ARM Options}
361 @gccoptlist{
362 -mapcs-frame -mno-apcs-frame @gol
363 -mapcs-26 -mapcs-32 @gol
364 -mapcs-stack-check -mno-apcs-stack-check @gol
365 -mapcs-float -mno-apcs-float @gol
366 -mapcs-reentrant -mno-apcs-reentrant @gol
367 -msched-prolog -mno-sched-prolog @gol
368 -mlittle-endian -mbig-endian -mwords-little-endian @gol
369 -malignment-traps -mno-alignment-traps @gol
370 -msoft-float -mhard-float -mfpe @gol
371 -mthumb-interwork -mno-thumb-interwork @gol
372 -mcpu= -march= -mfpe=  @gol
373 -mstructure-size-boundary= @gol
374 -mbsd -mxopen -mno-symrename @gol
375 -mabort-on-noreturn @gol
376 -mlong-calls -mno-long-calls @gol
377 -mnop-fun-dllimport -mno-nop-fun-dllimport @gol
378 -msingle-pic-base -mno-single-pic-base @gol
379 -mpic-register=}
380
381 @emph{Thumb Options}
382 @gccoptlist{
383 -mtpcs-frame -mno-tpcs-frame @gol
384 -mtpcs-leaf-frame -mno-tpcs-leaf-frame @gol
385 -mlittle-endian  -mbig-endian @gol
386 -mthumb-interwork -mno-thumb-interwork @gol
387 -mstructure-size-boundary= @gol
388 -mnop-fun-dllimport -mno-nop-fun-dllimport @gol
389 -mcallee-super-interworking -mno-callee-super-interworking @gol
390 -mcaller-super-interworking -mno-caller-super-interworking @gol
391 -msingle-pic-base -mno-single-pic-base @gol
392 -mpic-register=}
393
394 @emph{MN10200 Options}
395 @gccoptlist{
396 -mrelax}
397
398 @emph{MN10300 Options}
399 @gccoptlist{
400 -mmult-bug @gol
401 -mno-mult-bug @gol
402 -mam33 @gol
403 -mno-am33 @gol
404 -mrelax}
405
406 @emph{M32R/D Options}
407 @gccoptlist{
408 -mcode-model=@var{model type}  -msdata=@var{sdata type} @gol
409 -G @var{num}}
410
411 @emph{M88K Options}
412 @gccoptlist{
413 -m88000  -m88100  -m88110  -mbig-pic @gol
414 -mcheck-zero-division  -mhandle-large-shift @gol
415 -midentify-revision  -mno-check-zero-division @gol
416 -mno-ocs-debug-info  -mno-ocs-frame-position @gol
417 -mno-optimize-arg-area  -mno-serialize-volatile @gol
418 -mno-underscores  -mocs-debug-info @gol
419 -mocs-frame-position  -moptimize-arg-area @gol
420 -mserialize-volatile  -mshort-data-@var{num}  -msvr3 @gol
421 -msvr4  -mtrap-large-shift  -muse-div-instruction @gol
422 -mversion-03.00  -mwarn-passed-structs}
423
424 @emph{RS/6000 and PowerPC Options}
425 @gccoptlist{
426 -mcpu=@var{cpu type} @gol
427 -mtune=@var{cpu type} @gol
428 -mpower  -mno-power  -mpower2  -mno-power2 @gol
429 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
430 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
431 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
432 -mnew-mnemonics  -mold-mnemonics @gol
433 -mfull-toc   -mminimal-toc  -mno-fop-in-toc  -mno-sum-in-toc @gol
434 -m64  -m32  -mxl-call  -mno-xl-call  -mthreads  -mpe @gol
435 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
436 -mstring  -mno-string  -mupdate  -mno-update @gol
437 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
438 -mstrict-align  -mno-strict-align  -mrelocatable @gol
439 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
440 -mtoc  -mno-toc -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
441 -mcall-aix  -mcall-sysv  -mprototype  -mno-prototype @gol
442 -msim  -mmvme  -mads  -myellowknife  -memb -msdata @gol
443 -msdata=@var{opt}  -mvxworks -G @var{num}}
444
445 @emph{RT Options}
446 @gccoptlist{
447 -mcall-lib-mul  -mfp-arg-in-fpregs  -mfp-arg-in-gregs @gol
448 -mfull-fp-blocks  -mhc-struct-return  -min-line-mul @gol
449 -mminimum-fp-blocks  -mnohc-struct-return}
450
451 @emph{MIPS Options}
452 @gccoptlist{
453 -mabicalls  -mcpu=@var{cpu type}
454 -membedded-data  -muninit-const-in-rodata @gol
455 -membedded-pic  -mfp32  -mfp64  -mgas  -mgp32  -mgp64 @gol
456 -mgpopt  -mhalf-pic  -mhard-float  -mint64  -mips1 @gol
457 -mips2  -mips3 -mips4 -mlong64  -mlong32 -mlong-calls  -mmemcpy @gol
458 -mmips-as  -mmips-tfile  -mno-abicalls @gol
459 -mno-embedded-data  -mno-uninit-const-in-rodata  -mno-embedded-pic @gol
460 -mno-gpopt  -mno-long-calls @gol
461 -mno-memcpy  -mno-mips-tfile  -mno-rnames  -mno-stats @gol
462 -mrnames  -msoft-float @gol
463 -m4650  -msingle-float  -mmad @gol
464 -mstats  -EL  -EB  -G @var{num}  -nocpp @gol
465 -mabi=32 -mabi=n32 -mabi=64 -mabi=eabi @gol
466 -mfix7000 -mno-crt0}
467
468 @emph{i386 Options}
469 @gccoptlist{
470 -mcpu=@var{cpu type} -march=@var{cpu type} @gol
471 -mintel-syntax -mieee-fp  -mno-fancy-math-387 @gol
472 -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib @gol
473 -mno-wide-multiply  -mrtd  -malign-double @gol
474 -mpreferred-stack-boundary=@var{num} @gol
475 -mthreads -mno-align-stringops -minline-all-stringops @gol
476 -mpush-args -maccumulate-outgoing-args -m128bit-long-double @gol
477 -m96bit-long-double -mregparm=@var{num} -momit-leaf-frame-pointer}
478
479 @emph{HPPA Options}
480 @gccoptlist{
481 -march=@var{architecture type} @gol
482 -mbig-switch  -mdisable-fpregs  -mdisable-indexing   @gol
483 -mfast-indirect-calls -mgas  -mjump-in-delay   @gol
484 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
485 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
486 -mno-jump-in-delay  -mno-long-load-store   @gol
487 -mno-portable-runtime  -mno-soft-float @gol
488 -mno-space-regs  -msoft-float  -mpa-risc-1-0   @gol
489 -mpa-risc-1-1  -mpa-risc-2-0 -mportable-runtime @gol
490 -mschedule=@var{cpu type}  -mspace-regs}
491
492 @emph{Intel 960 Options}
493 @gccoptlist{
494 -m@var{cpu type}  -masm-compat  -mclean-linkage @gol
495 -mcode-align  -mcomplex-addr  -mleaf-procedures @gol
496 -mic-compat  -mic2.0-compat  -mic3.0-compat @gol
497 -mintel-asm  -mno-clean-linkage  -mno-code-align @gol
498 -mno-complex-addr  -mno-leaf-procedures @gol
499 -mno-old-align  -mno-strict-align  -mno-tail-call @gol
500 -mnumerics  -mold-align  -msoft-float  -mstrict-align @gol
501 -mtail-call}
502
503 @emph{DEC Alpha Options}
504 @gccoptlist{
505 -mfp-regs  -mno-fp-regs -mno-soft-float  -msoft-float @gol
506 -malpha-as -mgas @gol
507 -mieee  -mieee-with-inexact  -mieee-conformant @gol
508 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
509 -mtrap-precision=@var{mode}  -mbuild-constants @gol
510 -mcpu=@var{cpu type} @gol
511 -mbwx -mno-bwx -mcix -mno-cix -mmax -mno-max @gol
512 -mmemory-latency=@var{time}}
513
514 @emph{Clipper Options}
515 @gccoptlist{
516 -mc300  -mc400}
517
518 @emph{H8/300 Options}
519 @gccoptlist{
520 -mrelax  -mh -ms -mint32  -malign-300}
521
522 @emph{SH Options}
523 @gccoptlist{
524 -m1  -m2  -m3  -m3e @gol
525 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
526 -mb  -ml  -mdalign  -mrelax @gol
527 -mbigtable  -mfmovd  -mhitachi  -mnomacsave @gol
528 -misize  -mpadstruct  -mspace @gol
529 -mprefergot
530 -musermode}
531
532 @emph{System V Options}
533 @gccoptlist{
534 -Qy  -Qn  -YP\,@var{paths}  -Ym\,@var{dir}}
535
536 @emph{ARC Options}
537 @gccoptlist{
538 -EB  -EL @gol
539 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text section} @gol
540 -mdata=@var{data section}  -mrodata=@var{readonly data section}}
541
542 @emph{TMS320C3x/C4x Options}
543 @gccoptlist{
544 -mcpu=@var{cpu} -mbig -msmall -mregparm -mmemparm @gol
545 -mfast-fix -mmpyi -mbk -mti -mdp-isr-reload @gol
546 -mrpts=@var{count}  -mrptb -mdb -mloop-unsigned @gol
547 -mparallel-insns -mparallel-mpy -mpreserve-float}
548
549 @emph{V850 Options}
550 @gccoptlist{
551 -mlong-calls -mno-long-calls -mep -mno-ep @gol
552 -mprolog-function -mno-prolog-function -mspace @gol
553 -mtda=@var{n} -msda=@var{n} -mzda=@var{n} @gol
554 -mv850 -mbig-switch}
555
556 @emph{NS32K Options}
557 @gccoptlist{
558 -m32032 -m32332 -m32532 -m32081 -m32381 -mmult-add -mnomult-add @gol
559 -msoft-float -mrtd -mnortd -mregparam -mnoregparam -msb -mnosb @gol
560 -mbitfield -mnobitfield -mhimem -mnohimem}
561
562 @emph{AVR Options}
563 @gccoptlist{
564 -mmcu=@var{mcu} -msize -minit-stack=@var{n} -mno-interrupts @gol
565 -mcall-prologues -mno-tablejump -mtiny-stack}
566
567 @emph{MCore Options}
568 @gccoptlist{
569 -mhardlit -mno-hardlit -mdiv -mno-div -mrelax-immediates  @gol
570 -mno-relax-immediates -mwide-bitfields -mno-wide-bitfields @gol
571 -m4byte-functions -mno-4byte-functions -mcallgraph-data @gol
572 -mno-callgraph-data -mslow-bytes -mno-slow-bytes -mno-lsim @gol
573 -mlittle-endian -mbig-endian -m210 -m340 -mstack-increment}
574
575 @emph{IA-64 Options}
576 @gccoptlist{
577 -mbig-endian -mlittle-endian -mgnu-as -mgnu-ld -mno-pic @gol
578 -mvolatile-asm-stop -mb-step -mregister-names -mno-sdata @gol
579 -mconstant-gp -mauto-pic -minline-divide-min-latency @gol
580 -minline-divide-max-throughput -mno-dwarf2-asm @gol
581 -mfixed-range=@var{register range}}
582
583 @item Code Generation Options
584 @xref{Code Gen Options,,Options for Code Generation Conventions}.
585 @gccoptlist{
586 -fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
587 -fexceptions  -funwind-tables  -ffixed-@var{reg} @gol
588 -finhibit-size-directive  -finstrument-functions @gol
589 -fcheck-memory-usage  -fprefix-function-name @gol
590 -fno-common  -fno-ident  -fno-gnu-linker @gol
591 -fpcc-struct-return  -fpic  -fPIC @gol
592 -freg-struct-return  -fshared-data  -fshort-enums @gol
593 -fshort-double  -fvolatile  -fvolatile-global -fvolatile-static @gol
594 -fverbose-asm  -fpack-struct  -fstack-check @gol
595 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
596 -fargument-alias  -fargument-noalias @gol
597 -fargument-noalias-global @gol
598 -fleading-underscore}
599 @end table
600
601 @menu
602 * Overall Options::     Controlling the kind of output:
603                         an executable, object files, assembler files,
604                         or preprocessed source.
605 * C Dialect Options::   Controlling the variant of C language compiled.
606 * C++ Dialect Options:: Variations on C++.
607 * Objective-C Dialect Options:: Variations on Objective-C.
608 * Language Independent Options:: Controlling how diagnostics should be
609                         formatted.
610 * Warning Options::     How picky should the compiler be?
611 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
612 * Optimize Options::    How much optimization?
613 * Preprocessor Options:: Controlling header files and macro definitions.
614                          Also, getting dependency information for Make.
615 * Assembler Options::   Passing options to the assembler.
616 * Link Options::        Specifying libraries and so on.
617 * Directory Options::   Where to find header files and libraries.
618                         Where to find the compiler executable files.
619 * Spec Files::          How to pass switches to sub-processes.
620 * Target Options::      Running a cross-compiler, or an old version of GCC.
621 @end menu
622
623 @node Overall Options
624 @section Options Controlling the Kind of Output
625
626 Compilation can involve up to four stages: preprocessing, compilation
627 proper, assembly and linking, always in that order.  The first three
628 stages apply to an individual source file, and end by producing an
629 object file; linking combines all the object files (those newly
630 compiled, and those specified as input) into an executable file.
631
632 @cindex file name suffix
633 For any given input file, the file name suffix determines what kind of
634 compilation is done:
635
636 @table @gcctabopt
637 @item @var{file}.c
638 C source code which must be preprocessed.
639
640 @item @var{file}.i
641 C source code which should not be preprocessed.
642
643 @item @var{file}.ii
644 C++ source code which should not be preprocessed.
645
646 @item @var{file}.m
647 Objective-C source code.  Note that you must link with the library
648 @file{libobjc.a} to make an Objective-C program work.
649
650 @item @var{file}.mi
651 Objective-C source code which should not be preprocessed.
652
653 @item @var{file}.h
654 C header file (not to be compiled or linked).
655
656 @item @var{file}.cc
657 @itemx @var{file}.cp
658 @itemx @var{file}.cxx
659 @itemx @var{file}.cpp
660 @itemx @var{file}.c++
661 @itemx @var{file}.C
662 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
663 the last two letters must both be literally @samp{x}.  Likewise,
664 @samp{.C} refers to a literal capital C.
665
666 @item @var{file}.f
667 @itemx @var{file}.for
668 @itemx @var{file}.FOR
669 Fortran source code which should not be preprocessed.
670
671 @item @var{file}.F
672 @itemx @var{file}.fpp
673 @itemx @var{file}.FPP
674 Fortran source code which must be preprocessed (with the traditional
675 preprocessor).
676
677 @item @var{file}.r
678 Fortran source code which must be preprocessed with a RATFOR
679 preprocessor (not included with GCC).
680
681 @xref{Overall Options,,Options Controlling the Kind of Output, g77,
682 Using and Porting GNU Fortran}, for more details of the handling of
683 Fortran input files.
684
685 @c FIXME: Descriptions of Java file types.
686 @c @var{file}.java
687 @c @var{file}.class
688 @c @var{file}.zip
689 @c @var{file}.jar
690
691 @c GCC also knows about some suffixes for languages not yet included:
692 @c Ada:
693 @c @var{file}.ads
694 @c @var{file}.adb
695 @c @var{file}.ada
696 @c Pascal:
697 @c @var{file}.p
698 @c @var{file}.pas
699
700 @item @var{file}.ch
701 @itemx @var{file}.chi
702 CHILL source code (preprocessed with the traditional preprocessor).
703
704 @item @var{file}.s
705 Assembler code.
706
707 @item @var{file}.S
708 Assembler code which must be preprocessed.
709
710 @item @var{other}
711 An object file to be fed straight into linking.
712 Any file name with no recognized suffix is treated this way.
713 @end table
714
715 You can specify the input language explicitly with the @samp{-x} option:
716
717 @table @gcctabopt
718 @item -x @var{language}
719 Specify explicitly the @var{language} for the following input files
720 (rather than letting the compiler choose a default based on the file
721 name suffix).  This option applies to all following input files until
722 the next @samp{-x} option.  Possible values for @var{language} are:
723 @example
724 c  c-header  cpp-output
725 c++  c++-cpp-output
726 objective-c  objc-cpp-output
727 assembler  assembler-with-cpp
728 f77  f77-cpp-input  ratfor
729 java  chill
730 @end example
731 @c Also f77-version, for internal use only.
732
733 @item -x none
734 Turn off any specification of a language, so that subsequent files are
735 handled according to their file name suffixes (as they are if @samp{-x}
736 has not been used at all).
737
738 @item -pass-exit-codes
739 Normally the @command{gcc} program will exit with the code of 1 if any
740 phase of the compiler returns a non-success return code.  If you specify
741 @samp{-pass-exit-codes}, the @command{gcc} program will instead return with
742 numerically highest error produced by any phase that returned an error
743 indication.
744 @end table
745
746 If you only want some of the stages of compilation, you can use
747 @samp{-x} (or filename suffixes) to tell @command{gcc} where to start, and
748 one of the options @samp{-c}, @samp{-S}, or @samp{-E} to say where
749 @command{gcc} is to stop.  Note that some combinations (for example,
750 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
751
752 @table @gcctabopt
753 @item -c
754 Compile or assemble the source files, but do not link.  The linking
755 stage simply is not done.  The ultimate output is in the form of an
756 object file for each source file.
757
758 By default, the object file name for a source file is made by replacing
759 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
760
761 Unrecognized input files, not requiring compilation or assembly, are
762 ignored.
763
764 @item -S
765 Stop after the stage of compilation proper; do not assemble.  The output
766 is in the form of an assembler code file for each non-assembler input
767 file specified.
768
769 By default, the assembler file name for a source file is made by
770 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
771
772 Input files that don't require compilation are ignored.
773
774 @item -E
775 Stop after the preprocessing stage; do not run the compiler proper.  The
776 output is in the form of preprocessed source code, which is sent to the
777 standard output.
778
779 Input files which don't require preprocessing are ignored.
780
781 @cindex output file option
782 @item -o @var{file}
783 Place output in file @var{file}.  This applies regardless to whatever
784 sort of output is being produced, whether it be an executable file,
785 an object file, an assembler file or preprocessed C code.
786
787 Since only one output file can be specified, it does not make sense to
788 use @samp{-o} when compiling more than one input file, unless you are
789 producing an executable file as output.
790
791 If @samp{-o} is not specified, the default is to put an executable file
792 in @file{a.out}, the object file for @file{@var{source}.@var{suffix}} in
793 @file{@var{source}.o}, its assembler file in @file{@var{source}.s}, and
794 all preprocessed C source on standard output.@refill
795
796 @item -v
797 Print (on standard error output) the commands executed to run the stages
798 of compilation.  Also print the version number of the compiler driver
799 program and of the preprocessor and the compiler proper.
800
801 @item -pipe
802 Use pipes rather than temporary files for communication between the
803 various stages of compilation.  This fails to work on some systems where
804 the assembler is unable to read from a pipe; but the GNU assembler has
805 no trouble.
806
807 @item --help
808 Print (on the standard output) a description of the command line options
809 understood by @command{gcc}.  If the @option{-v} option is also specified
810 then @option{--help} will also be passed on to the various processes
811 invoked by @command{gcc}, so that they can display the command line options
812 they accept.  If the @option{-W} option is also specified then command
813 line options which have no documentation associated with them will also
814 be displayed.
815
816 @item --target-help
817 Print (on the standard output) a description of target specific command
818 line options for each tool.
819 @end table
820
821 @node Invoking G++
822 @section Compiling C++ Programs
823
824 @cindex suffixes for C++ source
825 @cindex C++ source file suffixes
826 C++ source files conventionally use one of the suffixes @samp{.C},
827 @samp{.cc}, @samp{.cpp}, @samp{.c++}, @samp{.cp}, or @samp{.cxx};
828 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
829 files with these names and compiles them as C++ programs even if you
830 call the compiler the same way as for compiling C programs (usually with
831 the name @command{gcc}).
832
833 @findex g++
834 @findex c++
835 However, C++ programs often require class libraries as well as a
836 compiler that understands the C++ language---and under some
837 circumstances, you might want to compile programs from standard input,
838 or otherwise without a suffix that flags them as C++ programs.
839 @command{g++} is a program that calls GCC with the default language
840 set to C++, and automatically specifies linking against the C++
841 library.  On many systems, @command{g++} is also
842 installed with the name @command{c++}.
843
844 @cindex invoking @command{g++}
845 When you compile C++ programs, you may specify many of the same
846 command-line options that you use for compiling programs in any
847 language; or command-line options meaningful for C and related
848 languages; or options that are meaningful only for C++ programs.
849 @xref{C Dialect Options,,Options Controlling C Dialect}, for
850 explanations of options for languages related to C.
851 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
852 explanations of options that are meaningful only for C++ programs.
853
854 @node C Dialect Options
855 @section Options Controlling C Dialect
856 @cindex dialect options
857 @cindex language dialect options
858 @cindex options, dialect
859
860 The following options control the dialect of C (or languages derived
861 from C, such as C++ and Objective C) that the compiler accepts:
862
863 @table @gcctabopt
864 @cindex ANSI support
865 @cindex ISO support
866 @item -ansi
867 In C mode, support all ISO C89 programs.  In C++ mode,
868 remove GNU extensions that conflict with ISO C++.
869
870 This turns off certain features of GCC that are incompatible with ISO
871 C (when compiling C code), or of standard C++ (when compiling C++ code),
872 such as the @code{asm} and @code{typeof} keywords, and
873 predefined macros such as @code{unix} and @code{vax} that identify the
874 type of system you are using.  It also enables the undesirable and
875 rarely used ISO trigraph feature.  For the C compiler,
876 it disables recognition of C++ style @samp{//} comments as well as
877 the @code{inline} keyword.
878
879 The alternate keywords @code{__asm__}, @code{__extension__},
880 @code{__inline__} and @code{__typeof__} continue to work despite
881 @samp{-ansi}.  You would not want to use them in an ISO C program, of
882 course, but it is useful to put them in header files that might be included
883 in compilations done with @samp{-ansi}.  Alternate predefined macros
884 such as @code{__unix__} and @code{__vax__} are also available, with or
885 without @samp{-ansi}.
886
887 The @samp{-ansi} option does not cause non-ISO programs to be
888 rejected gratuitously.  For that, @samp{-pedantic} is required in
889 addition to @samp{-ansi}.  @xref{Warning Options}.
890
891 The macro @code{__STRICT_ANSI__} is predefined when the @samp{-ansi}
892 option is used.  Some header files may notice this macro and refrain
893 from declaring certain functions or defining certain macros that the
894 ISO standard doesn't call for; this is to avoid interfering with any
895 programs that might use these names for other things.
896
897 Functions which would normally be builtin but do not have semantics
898 defined by ISO C (such as @code{alloca} and @code{ffs}) are not builtin
899 functions with @samp{-ansi} is used.  @xref{Other Builtins,,Other
900 built-in functions provided by GNU CC}, for details of the functions
901 affected.
902
903 @item -std=
904 Determine the language standard.  A value for this option must be provided;
905 possible values are
906
907 @table @samp
908 @item iso9899:1990
909 Same as @option{-ansi}
910
911 @item iso9899:199409
912 ISO C as modified in amend. 1
913
914 @item iso9899:1999
915 ISO C99.  Note that this standard is not yet fully supported; see
916 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.
917
918 @item c89
919 same as @option{-std=iso9899:1990}
920
921 @item c99
922 same as @option{-std=iso9899:1999}
923
924 @item gnu89
925 default, iso9899:1990 + gnu extensions
926
927 @item gnu99
928 iso9899:1999 + gnu extensions
929
930 @item iso9899:199x
931 same as @option{-std=iso9899:1999}, deprecated
932
933 @item c9x
934 same as @option{-std=iso9899:1999}, deprecated
935
936 @item gnu9x
937 same as @option{-std=gnu99}, deprecated
938
939 @end table
940
941 Even when this option is not specified, you can still use some of the
942 features of newer standards in so far as they do not conflict with
943 previous C standards.  For example, you may use @code{__restrict__} even
944 when @option{-std=c99} is not specified.
945
946 The @option{-std} options specifying some version of ISO C have the same
947 effects as @option{-ansi}, except that features that were not in ISO C89
948 but are in the specified version (for example, @samp{//} comments and
949 the @code{inline} keyword in ISO C99) are not disabled.
950
951 @xref{Standards,,Language Standards Supported by GCC}, for details of
952 these standard versions.
953
954 @item -fno-asm
955 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
956 keyword, so that code can use these words as identifiers.  You can use
957 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
958 instead.  @samp{-ansi} implies @samp{-fno-asm}.
959
960 In C++, this switch only affects the @code{typeof} keyword, since
961 @code{asm} and @code{inline} are standard keywords.  You may want to
962 use the @samp{-fno-gnu-keywords} flag instead, which has the same
963 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
964 switch only affects the @code{asm} and @code{typeof} keywords, since
965 @code{inline} is a standard keyword in ISO C99.
966
967 @item -fno-builtin
968 @cindex builtin functions
969 Don't recognize builtin functions that do not begin with
970 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
971 functions provided by GNU CC}, for details of the functions affected,
972 including those which are not builtin functions when @option{-ansi} or
973 @option{-std} options for strict ISO C conformance are used because they
974 do not have an ISO standard meaning.
975
976 GCC normally generates special code to handle certain builtin functions
977 more efficiently; for instance, calls to @code{alloca} may become single
978 instructions that adjust the stack directly, and calls to @code{memcpy}
979 may become inline copy loops.  The resulting code is often both smaller
980 and faster, but since the function calls no longer appear as such, you
981 cannot set a breakpoint on those calls, nor can you change the behavior
982 of the functions by linking with a different library.
983
984 @item -fhosted
985 @cindex hosted environment
986
987 Assert that compilation takes place in a hosted environment.  This implies
988 @samp{-fbuiltin}.  A hosted environment is one in which the
989 entire standard library is available, and in which @code{main} has a return
990 type of @code{int}.  Examples are nearly everything except a kernel.
991 This is equivalent to @samp{-fno-freestanding}.
992
993 @item -ffreestanding
994 @cindex hosted environment
995
996 Assert that compilation takes place in a freestanding environment.  This
997 implies @samp{-fno-builtin}.  A freestanding environment
998 is one in which the standard library may not exist, and program startup may
999 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1000 This is equivalent to @samp{-fno-hosted}.
1001
1002 @xref{Standards,,Language Standards Supported by GCC}, for details of
1003 freestanding and hosted environments.
1004
1005 @item -trigraphs
1006 Support ISO C trigraphs.  You don't want to know about this
1007 brain-damage.  The @option{-ansi} option (and @option{-std} options for
1008 strict ISO C conformance) implies @option{-trigraphs}.
1009
1010 @cindex traditional C language
1011 @cindex C language, traditional
1012 @item -traditional
1013 Attempt to support some aspects of traditional C compilers.
1014 Specifically:
1015
1016 @itemize @bullet
1017 @item
1018 All @code{extern} declarations take effect globally even if they
1019 are written inside of a function definition.  This includes implicit
1020 declarations of functions.
1021
1022 @item
1023 The newer keywords @code{typeof}, @code{inline}, @code{signed}, @code{const}
1024 and @code{volatile} are not recognized.  (You can still use the
1025 alternative keywords such as @code{__typeof__}, @code{__inline__}, and
1026 so on.)
1027
1028 @item
1029 Comparisons between pointers and integers are always allowed.
1030
1031 @item
1032 Integer types @code{unsigned short} and @code{unsigned char} promote
1033 to @code{unsigned int}.
1034
1035 @item
1036 Out-of-range floating point literals are not an error.
1037
1038 @item
1039 Certain constructs which ISO regards as a single invalid preprocessing
1040 number, such as @samp{0xe-0xd}, are treated as expressions instead.
1041
1042 @item
1043 String ``constants'' are not necessarily constant; they are stored in
1044 writable space, and identical looking constants are allocated
1045 separately.  (This is the same as the effect of
1046 @samp{-fwritable-strings}.)
1047
1048 @cindex @code{longjmp} and automatic variables
1049 @item
1050 All automatic variables not declared @code{register} are preserved by
1051 @code{longjmp}.  Ordinarily, GNU C follows ISO C: automatic variables
1052 not declared @code{volatile} may be clobbered.
1053
1054 @item
1055 @kindex \x
1056 @kindex \a
1057 @cindex escape sequences, traditional
1058 The character escape sequences @samp{\x} and @samp{\a} evaluate as the
1059 literal characters @samp{x} and @samp{a} respectively.  Without
1060 @w{@samp{-traditional}}, @samp{\x} is a prefix for the hexadecimal
1061 representation of a character, and @samp{\a} produces a bell.
1062 @end itemize
1063
1064 You may wish to use @samp{-fno-builtin} as well as @samp{-traditional}
1065 if your program uses names that are normally GNU C builtin functions for
1066 other purposes of its own.
1067
1068 You cannot use @samp{-traditional} if you include any header files that
1069 rely on ISO C features.  Some vendors are starting to ship systems with
1070 ISO C header files and you cannot use @samp{-traditional} on such
1071 systems to compile files that include any system headers.
1072
1073 The @samp{-traditional} option also enables @samp{-traditional-cpp},
1074 which is described next.
1075
1076 @item -traditional-cpp
1077 Attempt to support some aspects of traditional C preprocessors.
1078 Specifically:
1079
1080 @itemize @bullet
1081 @item
1082 Comments convert to nothing at all, rather than to a space.  This allows
1083 traditional token concatenation.
1084
1085 @item
1086 In a preprocessing directive, the @samp{#} symbol must appear as the first
1087 character of a line.
1088
1089 @item
1090 Macro arguments are recognized within string constants in a macro
1091 definition (and their values are stringified, though without additional
1092 quote marks, when they appear in such a context).  The preprocessor
1093 always considers a string constant to end at a newline.
1094
1095 @item
1096 @cindex detecting @w{@samp{-traditional}}
1097 The predefined macro @code{__STDC__} is not defined when you use
1098 @samp{-traditional}, but @code{__GNUC__} is (since the GNU extensions
1099 which @code{__GNUC__} indicates are not affected by
1100 @samp{-traditional}).  If you need to write header files that work
1101 differently depending on whether @samp{-traditional} is in use, by
1102 testing both of these predefined macros you can distinguish four
1103 situations: GNU C, traditional GNU C, other ISO C compilers, and other
1104 old C compilers.  The predefined macro @code{__STDC_VERSION__} is also
1105 not defined when you use @samp{-traditional}.  @xref{Standard
1106 Predefined,,Standard Predefined Macros,cpp.info,The C Preprocessor},
1107 for more discussion of these and other predefined macros.
1108
1109 @item
1110 @cindex string constants vs newline
1111 @cindex newline vs string constants
1112 The preprocessor considers a string constant to end at a newline (unless
1113 the newline is escaped with @samp{\}).  (Without @w{@samp{-traditional}},
1114 string constants can contain the newline character as typed.)
1115 @end itemize
1116
1117 @item -fcond-mismatch
1118 Allow conditional expressions with mismatched types in the second and
1119 third arguments.  The value of such an expression is void.  This option
1120 is not supported for C++.
1121
1122 @item -funsigned-char
1123 Let the type @code{char} be unsigned, like @code{unsigned char}.
1124
1125 Each kind of machine has a default for what @code{char} should
1126 be.  It is either like @code{unsigned char} by default or like
1127 @code{signed char} by default.
1128
1129 Ideally, a portable program should always use @code{signed char} or
1130 @code{unsigned char} when it depends on the signedness of an object.
1131 But many programs have been written to use plain @code{char} and
1132 expect it to be signed, or expect it to be unsigned, depending on the
1133 machines they were written for.  This option, and its inverse, let you
1134 make such a program work with the opposite default.
1135
1136 The type @code{char} is always a distinct type from each of
1137 @code{signed char} or @code{unsigned char}, even though its behavior
1138 is always just like one of those two.
1139
1140 @item -fsigned-char
1141 Let the type @code{char} be signed, like @code{signed char}.
1142
1143 Note that this is equivalent to @samp{-fno-unsigned-char}, which is
1144 the negative form of @samp{-funsigned-char}.  Likewise, the option
1145 @samp{-fno-signed-char} is equivalent to @samp{-funsigned-char}.
1146
1147 You may wish to use @samp{-fno-builtin} as well as @samp{-traditional}
1148 if your program uses names that are normally GNU C builtin functions for
1149 other purposes of its own.
1150
1151 You cannot use @samp{-traditional} if you include any header files that
1152 rely on ISO C features.  Some vendors are starting to ship systems with
1153 ISO C header files and you cannot use @samp{-traditional} on such
1154 systems to compile files that include any system headers.
1155
1156 @item -fsigned-bitfields
1157 @itemx -funsigned-bitfields
1158 @itemx -fno-signed-bitfields
1159 @itemx -fno-unsigned-bitfields
1160 These options control whether a bitfield is signed or unsigned, when the
1161 declaration does not use either @code{signed} or @code{unsigned}.  By
1162 default, such a bitfield is signed, because this is consistent: the
1163 basic integer types such as @code{int} are signed types.
1164
1165 However, when @samp{-traditional} is used, bitfields are all unsigned
1166 no matter what.
1167
1168 @item -fwritable-strings
1169 Store string constants in the writable data segment and don't uniquize
1170 them.  This is for compatibility with old programs which assume they can
1171 write into string constants.  The option @samp{-traditional} also has
1172 this effect.
1173
1174 Writing into string constants is a very bad idea; ``constants'' should
1175 be constant.
1176
1177 @item -fallow-single-precision
1178 Do not promote single precision math operations to double precision,
1179 even when compiling with @samp{-traditional}.
1180
1181 Traditional K&R C promotes all floating point operations to double
1182 precision, regardless of the sizes of the operands.   On the
1183 architecture for which you are compiling, single precision may be faster
1184 than double precision.   If you must use @samp{-traditional}, but want
1185 to use single precision operations when the operands are single
1186 precision, use this option.   This option has no effect when compiling
1187 with ISO or GNU C conventions (the default).
1188
1189 @item -fshort-wchar
1190 Override the underlying type for @samp{wchar_t} to be @samp{short
1191 unsigned int} instead of the default for the target.  This option is
1192 useful for building programs to run under WINE.
1193 @end table
1194
1195 @node C++ Dialect Options
1196 @section Options Controlling C++ Dialect
1197
1198 @cindex compiler options, C++
1199 @cindex C++ options, command line
1200 @cindex options, C++
1201 This section describes the command-line options that are only meaningful
1202 for C++ programs; but you can also use most of the GNU compiler options
1203 regardless of what language your program is in.  For example, you
1204 might compile a file @code{firstClass.C} like this:
1205
1206 @example
1207 g++ -g -frepo -O -c firstClass.C
1208 @end example
1209
1210 @noindent
1211 In this example, only @samp{-frepo} is an option meant
1212 only for C++ programs; you can use the other options with any
1213 language supported by GCC.
1214
1215 Here is a list of options that are @emph{only} for compiling C++ programs:
1216
1217 @table @gcctabopt
1218 @item -fno-access-control
1219 Turn off all access checking.  This switch is mainly useful for working
1220 around bugs in the access control code.
1221
1222 @item -fcheck-new
1223 Check that the pointer returned by @code{operator new} is non-null
1224 before attempting to modify the storage allocated.  The current Working
1225 Paper requires that @code{operator new} never return a null pointer, so
1226 this check is normally unnecessary.
1227
1228 An alternative to using this option is to specify that your
1229 @code{operator new} does not throw any exceptions; if you declare it
1230 @samp{throw()}, g++ will check the return value.  See also @samp{new
1231 (nothrow)}.
1232
1233 @item -fconserve-space
1234 Put uninitialized or runtime-initialized global variables into the
1235 common segment, as C does.  This saves space in the executable at the
1236 cost of not diagnosing duplicate definitions.  If you compile with this
1237 flag and your program mysteriously crashes after @code{main()} has
1238 completed, you may have an object that is being destroyed twice because
1239 two definitions were merged.
1240
1241 This option is no longer useful on most targets, now that support has
1242 been added for putting variables into BSS without making them common.
1243
1244 @item -fno-const-strings
1245 Give string constants type @code{char *} instead of type @code{const
1246 char *}.  By default, G++ uses type @code{const char *} as required by
1247 the standard.  Even if you use @samp{-fno-const-strings}, you cannot
1248 actually modify the value of a string constant, unless you also use
1249 @samp{-fwritable-strings}.
1250
1251 This option might be removed in a future release of G++.  For maximum
1252 portability, you should structure your code so that it works with
1253 string constants that have type @code{const char *}.
1254
1255 @item -fdollars-in-identifiers
1256 Accept @samp{$} in identifiers.  You can also explicitly prohibit use of
1257 @samp{$} with the option @samp{-fno-dollars-in-identifiers}.  (GNU C allows
1258 @samp{$} by default on most target systems, but there are a few exceptions.)
1259 Traditional C allowed the character @samp{$} to form part of
1260 identifiers.  However, ISO C and C++ forbid @samp{$} in identifiers.
1261
1262 @item -fno-elide-constructors
1263 The C++ standard allows an implementation to omit creating a temporary
1264 which is only used to initialize another object of the same type.
1265 Specifying this option disables that optimization, and forces g++ to
1266 call the copy constructor in all cases.
1267
1268 @item -fno-enforce-eh-specs
1269 Don't check for violation of exception specifications at runtime.  This
1270 option violates the C++ standard, but may be useful for reducing code
1271 size in production builds, much like defining @samp{NDEBUG}.  The compiler
1272 will still optimize based on the exception specifications.
1273
1274 @item -fexternal-templates
1275 Cause template instantiations to obey @samp{#pragma interface} and
1276 @samp{implementation}; template instances are emitted or not according
1277 to the location of the template definition.  @xref{Template
1278 Instantiation}, for more information.
1279
1280 This option is deprecated.
1281
1282 @item -falt-external-templates
1283 Similar to -fexternal-templates, but template instances are emitted or
1284 not according to the place where they are first instantiated.
1285 @xref{Template Instantiation}, for more information.
1286
1287 This option is deprecated.
1288
1289 @item -ffor-scope
1290 @itemx -fno-for-scope
1291 If -ffor-scope is specified, the scope of variables declared in
1292 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1293 as specified by the C++ standard.
1294 If -fno-for-scope is specified, the scope of variables declared in
1295 a @i{for-init-statement} extends to the end of the enclosing scope,
1296 as was the case in old versions of gcc, and other (traditional)
1297 implementations of C++.
1298
1299 The default if neither flag is given to follow the standard,
1300 but to allow and give a warning for old-style code that would
1301 otherwise be invalid, or have different behavior.
1302
1303 @item -fno-gnu-keywords
1304 Do not recognize @code{typeof} as a keyword, so that code can use this
1305 word as an identifier. You can use the keyword @code{__typeof__} instead.
1306 @samp{-ansi} implies @samp{-fno-gnu-keywords}.
1307
1308 @item -fhonor-std
1309 Treat the @code{namespace std} as a namespace, instead of ignoring
1310 it. For compatibility with earlier versions of g++, the compiler will,
1311 by default, ignore @code{namespace-declarations},
1312 @code{using-declarations}, @code{using-directives}, and
1313 @code{namespace-names}, if they involve @code{std}.
1314
1315 @item -fno-implicit-templates
1316 Never emit code for non-inline templates which are instantiated
1317 implicitly (i.e. by use); only emit code for explicit instantiations.
1318 @xref{Template Instantiation}, for more information.
1319
1320 @item -fno-implicit-inline-templates
1321 Don't emit code for implicit instantiations of inline templates, either.
1322 The default is to handle inlines differently so that compiles with and
1323 without optimization will need the same set of explicit instantiations.
1324
1325 @item -fno-implement-inlines
1326 To save space, do not emit out-of-line copies of inline functions
1327 controlled by @samp{#pragma implementation}.  This will cause linker
1328 errors if these functions are not inlined everywhere they are called.
1329
1330 @item -fms-extensions
1331 Disable pedantic warnings about constructs used in MFC, such as implicit
1332 int and getting a pointer to member function via non-standard syntax.
1333
1334 @item -fno-nonansi-builtins
1335 Disable builtin declarations of functions that are not mandated by
1336 ANSI/ISO C.  These include @code{ffs}, @code{alloca}, @code{_exit},
1337 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1338
1339 @item -fno-operator-names
1340 Do not treat the operator name keywords @code{and}, @code{bitand},
1341 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1342 synonyms as keywords.
1343
1344 @item -fno-optional-diags
1345 Disable diagnostics that the standard says a compiler does not need to
1346 issue.  Currently, the only such diagnostic issued by g++ is the one for
1347 a name having multiple meanings within a class.
1348
1349 @item -fpermissive
1350 Downgrade messages about nonconformant code from errors to warnings.  By
1351 default, g++ effectively sets @samp{-pedantic-errors} without
1352 @samp{-pedantic}; this option reverses that.  This behavior and this
1353 option are superseded by @samp{-pedantic}, which works as it does for GNU C.
1354
1355 @item -frepo
1356 Enable automatic template instantiation.  This option also implies
1357 @samp{-fno-implicit-templates}.  @xref{Template Instantiation}, for more
1358 information.
1359
1360 @item -fno-rtti
1361 Disable generation of information about every class with virtual
1362 functions for use by the C++ runtime type identification features
1363 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1364 of the language, you can save some space by using this flag.  Note that
1365 exception handling uses the same information, but it will generate it as
1366 needed.
1367
1368 @item -fstats
1369 Emit statistics about front-end processing at the end of the compilation.
1370 This information is generally only useful to the G++ development team.
1371
1372 @item -ftemplate-depth-@var{n}
1373 Set the maximum instantiation depth for template classes to @var{n}.
1374 A limit on the template instantiation depth is needed to detect
1375 endless recursions during template class instantiation. ANSI/ISO C++
1376 conforming programs must not rely on a maximum depth greater than 17.
1377
1378 @item -fuse-cxa-atexit
1379 Register destructors for objects with static storage duration with the
1380 @code{__cxa_atexit} function rather than the @code{atexit} function.
1381 This option is required for fully standards-compliant handling of static
1382 destructors, but will only work if your C library supports
1383 @code{__cxa_atexit}.
1384
1385 @item -fvtable-gc
1386 Emit special relocations for vtables and virtual function references
1387 so that the linker can identify unused virtual functions and zero out
1388 vtable slots that refer to them.  This is most useful with
1389 @samp{-ffunction-sections} and @samp{-Wl,--gc-sections}, in order to
1390 also discard the functions themselves.
1391
1392 This optimization requires GNU as and GNU ld.  Not all systems support
1393 this option.  @samp{-Wl,--gc-sections} is ignored without @samp{-static}.
1394
1395 @item -fno-weak
1396 Do not use weak symbol support, even if it is provided by the linker.
1397 By default, G++ will use weak symbols if they are available.  This
1398 option exists only for testing, and should not be used by end-users;
1399 it will result in inferior code and has no benefits.  This option may
1400 be removed in a future release of G++.
1401
1402 @item -nostdinc++
1403 Do not search for header files in the standard directories specific to
1404 C++, but do still search the other standard directories.  (This option
1405 is used when building the C++ library.)
1406 @end table
1407
1408 In addition, these optimization, warning, and code generation options
1409 have meanings only for C++ programs:
1410
1411 @table @gcctabopt
1412 @item -fno-default-inline
1413 Do not assume @samp{inline} for functions defined inside a class scope.
1414 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1415 functions will have linkage like inline functions; they just won't be
1416 inlined by default.
1417
1418 @item -Wctor-dtor-privacy (C++ only)
1419 Warn when a class seems unusable, because all the constructors or
1420 destructors in a class are private and the class has no friends or
1421 public static member functions.
1422
1423 @item -Wnon-virtual-dtor (C++ only)
1424 Warn when a class declares a non-virtual destructor that should probably
1425 be virtual, because it looks like the class will be used polymorphically.
1426
1427 @item -Wreorder (C++ only)
1428 @cindex reordering, warning
1429 @cindex warning for reordering of member initializers
1430 Warn when the order of member initializers given in the code does not
1431 match the order in which they must be executed.  For instance:
1432
1433 @smallexample
1434 struct A @{
1435   int i;
1436   int j;
1437   A(): j (0), i (1) @{ @}
1438 @};
1439 @end smallexample
1440
1441 Here the compiler will warn that the member initializers for @samp{i}
1442 and @samp{j} will be rearranged to match the declaration order of the
1443 members.
1444 @end table
1445
1446 The following @samp{-W@dots{}} options are not affected by @samp{-Wall}.
1447
1448 @table @gcctabopt
1449 @item -Weffc++ (C++ only)
1450 Warn about violations of various style guidelines from Scott Meyers'
1451 @cite{Effective C++} books.  If you use this option, you should be aware
1452 that the standard library headers do not obey all of these guidelines;
1453 you can use @samp{grep -v} to filter out those warnings.
1454
1455 @item -Wno-deprecated (C++ only)
1456 Do not warn about usage of deprecated features. @xref{Deprecated Features}.
1457
1458 @item -Wno-non-template-friend (C++ only)
1459 Disable warnings when non-templatized friend functions are declared
1460 within a template. With the advent of explicit template specification
1461 support in g++, if the name of the friend is an unqualified-id (ie,
1462 @samp{friend foo(int)}), the C++ language specification demands that the
1463 friend declare or define an ordinary, nontemplate function. (Section
1464 14.5.3). Before g++ implemented explicit specification, unqualified-ids
1465 could be interpreted as a particular specialization of a templatized
1466 function. Because this non-conforming behavior is no longer the default
1467 behavior for g++, @samp{-Wnon-template-friend} allows the compiler to
1468 check existing code for potential trouble spots, and is on by default.
1469 This new compiler behavior can be turned off with
1470 @samp{-Wno-non-template-friend} which keeps the conformant compiler code
1471 but disables the helpful warning.
1472
1473 @item -Wold-style-cast (C++ only)
1474 Warn if an old-style (C-style) cast is used within a C++ program.  The
1475 new-style casts (@samp{static_cast}, @samp{reinterpret_cast}, and
1476 @samp{const_cast}) are less vulnerable to unintended effects, and much
1477 easier to grep for.
1478
1479 @item -Woverloaded-virtual (C++ only)
1480 @cindex overloaded virtual fn, warning
1481 @cindex warning for overloaded virtual fn
1482 Warn when a function declaration hides virtual functions from a
1483 base class.  For example, in:
1484
1485 @smallexample
1486 struct A @{
1487   virtual void f();
1488 @};
1489
1490 struct B: public A @{
1491   void f(int);
1492 @};
1493 @end smallexample
1494
1495 the @code{A} class version of @code{f} is hidden in @code{B}, and code
1496 like this:
1497
1498 @smallexample
1499 B* b;
1500 b->f();
1501 @end smallexample
1502
1503 will fail to compile.
1504
1505 @item -Wno-pmf-conversions (C++ only)
1506 Disable the diagnostic for converting a bound pointer to member function
1507 to a plain pointer.
1508
1509 @item -Wsign-promo (C++ only)
1510 Warn when overload resolution chooses a promotion from unsigned or
1511 enumeral type to a signed type over a conversion to an unsigned type of
1512 the same size.  Previous versions of g++ would try to preserve
1513 unsignedness, but the standard mandates the current behavior.
1514
1515 @item -Wsynth (C++ only)
1516 @cindex warning for synthesized methods
1517 @cindex synthesized methods, warning
1518 Warn when g++'s synthesis behavior does not match that of cfront.  For
1519 instance:
1520
1521 @smallexample
1522 struct A @{
1523   operator int ();
1524   A& operator = (int);
1525 @};
1526
1527 main ()
1528 @{
1529   A a,b;
1530   a = b;
1531 @}
1532 @end smallexample
1533
1534 In this example, g++ will synthesize a default @samp{A& operator =
1535 (const A&);}, while cfront will use the user-defined @samp{operator =}.
1536 @end table
1537
1538 @node Objective-C Dialect Options
1539 @section Options Controlling Objective-C Dialect
1540
1541 @cindex compiler options, Objective-C
1542 @cindex Objective-C options, command line
1543 @cindex options, Objective-C
1544 This section describes the command-line options that are only meaningful
1545 for Objective-C programs; but you can also use most of the GNU compiler
1546 options regardless of what language your program is in.  For example,
1547 you might compile a file @code{some_class.m} like this:
1548
1549 @example
1550 gcc -g -fgnu-runtime -O -c some_class.m
1551 @end example
1552
1553 @noindent
1554 In this example, only @samp{-fgnu-runtime} is an option meant only for
1555 Objective-C programs; you can use the other options with any language
1556 supported by GCC.
1557
1558 Here is a list of options that are @emph{only} for compiling Objective-C
1559 programs:
1560
1561 @table @gcctabopt
1562 @item -fconstant-string-class=@var{class name}
1563 Use @var{class name} as the name of the class to instantiate for each
1564 literal string specified with the syntax @code{@@"..."}.  The default
1565 class name is @code{NXConstantString}.
1566
1567 @item -fgnu-runtime
1568 Generate object code compatible with the standard GNU Objective-C
1569 runtime.  This is the default for most types of systems.
1570
1571 @item -fnext-runtime
1572 Generate output compatible with the NeXT runtime.  This is the default
1573 for NeXT-based systems, including Darwin and Mac OS X.
1574
1575 @item -gen-decls
1576 Dump interface declarations for all classes seen in the source file to a
1577 file named @file{@var{sourcename}.decl}.
1578
1579 @item -Wno-protocol
1580 Do not warn if methods required by a protocol are not implemented
1581 in the class adopting it.
1582
1583 @item -Wselector
1584 Warn if a selector has multiple methods of different types defined.
1585
1586 @c not documented because only avail via -Wp
1587 @c @item -print-objc-runtime-info
1588
1589 @end table
1590
1591 @node Language Independent Options
1592 @section Options to Control Diagnostic Messages Formatting
1593 @cindex options to control diagnostics formatting
1594 @cindex diagnostic messages
1595 @cindex message formatting
1596
1597 Traditionally, diagnostic messages have been formatted irrespective of
1598 the output device's aspect (e.g. its width, ...).  The options described
1599 below can be used to control the diagnostic messages formatting
1600 algorithm, e.g. how many characters per line, how often source location
1601 information should be reported.  Right now, only the C++ front-end can
1602 honor these options.  However it is expected, in the near future, that
1603 the remaining front-ends would be able to digest them correctly.
1604
1605 @table @gcctabopt
1606 @item -fmessage-length=@var{n}
1607 Try to format error messages so that they fit on lines of about @var{n}
1608 characters.  The default is 72 characters for g++ and 0 for the rest of
1609 the front-ends supported by GCC.  If @var{n} is zero, then no
1610 line-wrapping will be done; each error message will appear on a single
1611 line.
1612
1613 @item -fdiagnostics-show-location=once
1614 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
1615 reporter to emit @emph{once} source location information; that is, in
1616 case the message is too long to fit on a single physical line and has to
1617 be wrapped, the source location won't be emitted (as prefix) again,
1618 over and over, in subsequent continuation lines.  This is the default
1619 behaviour.
1620
1621 @item -fdiagnostics-show-location=every-line
1622 Only meaningful in line-wrapping mode.  Instructs the diagnostic
1623 messages reporter to emit the same source location information (as
1624 prefix) for physical lines that result from the process of breaking a
1625 a message which is too long to fit on a single line.
1626
1627 @end table
1628
1629 @node Warning Options
1630 @section Options to Request or Suppress Warnings
1631 @cindex options to control warnings
1632 @cindex warning messages
1633 @cindex messages, warning
1634 @cindex suppressing warnings
1635
1636 Warnings are diagnostic messages that report constructions which
1637 are not inherently erroneous but which are risky or suggest there
1638 may have been an error.
1639
1640 You can request many specific warnings with options beginning @samp{-W},
1641 for example @samp{-Wimplicit} to request warnings on implicit
1642 declarations.  Each of these specific warning options also has a
1643 negative form beginning @samp{-Wno-} to turn off warnings;
1644 for example, @samp{-Wno-implicit}.  This manual lists only one of the
1645 two forms, whichever is not the default.
1646
1647 These options control the amount and kinds of warnings produced by GCC:
1648
1649 @table @gcctabopt
1650 @cindex syntax checking
1651 @item -fsyntax-only
1652 Check the code for syntax errors, but don't do anything beyond that.
1653
1654 @item -pedantic
1655 Issue all the warnings demanded by strict ISO C and ISO C++;
1656 reject all programs that use forbidden extensions, and some other
1657 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
1658 version of the ISO C standard specified by any @samp{-std} option used.
1659
1660 Valid ISO C and ISO C++ programs should compile properly with or without
1661 this option (though a rare few will require @option{-ansi} or a
1662 @option{-std} option specifying the required version of ISO C).  However,
1663 without this option, certain GNU extensions and traditional C and C++
1664 features are supported as well.  With this option, they are rejected.
1665
1666 @samp{-pedantic} does not cause warning messages for use of the
1667 alternate keywords whose names begin and end with @samp{__}.  Pedantic
1668 warnings are also disabled in the expression that follows
1669 @code{__extension__}.  However, only system header files should use
1670 these escape routes; application programs should avoid them.
1671 @xref{Alternate Keywords}.
1672
1673 Some users try to use @samp{-pedantic} to check programs for strict ISO
1674 C conformance.  They soon find that it does not do quite what they want:
1675 it finds some non-ISO practices, but not all---only those for which
1676 ISO C @emph{requires} a diagnostic, and some others for which
1677 diagnostics have been added.
1678
1679 A feature to report any failure to conform to ISO C might be useful in
1680 some instances, but would require considerable additional work and would
1681 be quite different from @samp{-pedantic}.  We don't have plans to
1682 support such a feature in the near future.
1683
1684 Where the standard specified with @option{-std} represents a GNU
1685 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
1686 corresponding @dfn{base standard}, the version of ISO C on which the GNU
1687 extended dialect is based.  Warnings from @option{-pedantic} are given
1688 where they are required by the base standard.  (It would not make sense
1689 for such warnings to be given only for features not in the specified GNU
1690 C dialect, since by definition the GNU dialects of C include all
1691 features the compiler supports with the given option, and there would be
1692 nothing to warn about.)
1693
1694 @item -pedantic-errors
1695 Like @samp{-pedantic}, except that errors are produced rather than
1696 warnings.
1697
1698 @item -w
1699 Inhibit all warning messages.
1700
1701 @item -Wno-import
1702 Inhibit warning messages about the use of @samp{#import}.
1703
1704 @item -Wchar-subscripts
1705 Warn if an array subscript has type @code{char}.  This is a common cause
1706 of error, as programmers often forget that this type is signed on some
1707 machines.
1708
1709 @item -Wcomment
1710 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
1711 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
1712
1713 @item -Wformat
1714 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
1715 the arguments supplied have types appropriate to the format string
1716 specified, and that the conversions specified in the format string make
1717 sense.  This includes standard functions, and others specified by format
1718 attributes (@pxref{Function Attributes}), in the @code{printf},
1719 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
1720 not in the C standard) families.
1721
1722 The formats are checked against the format features supported by GNU
1723 libc version 2.2.  These include all ISO C89 and C99 features, as well
1724 as features from the Single Unix Specification and some BSD and GNU
1725 extensions.  Other library implementations may not support all these
1726 features; GCC does not support warning about features that go beyond a
1727 particular library's limitations.  However, if @samp{-pedantic} is used
1728 with @samp{-Wformat}, warnings will be given about format features not
1729 in the selected standard version (but not for @code{strfmon} formats,
1730 since those are not in any version of the C standard).  @xref{C Dialect
1731 Options,,Options Controlling C Dialect}.
1732
1733 @samp{-Wformat} is included in @samp{-Wall}.  For more control over some
1734 aspects of format checking, the options @samp{-Wno-format-y2k},
1735 @samp{-Wno-format-extra-args}, @samp{-Wformat-nonliteral},
1736 @samp{-Wformat-security} and @samp{-Wformat=2} are available, but are
1737 not included in @samp{-Wall}.
1738
1739 @item -Wno-format-y2k
1740 If @samp{-Wformat} is specified, do not warn about @code{strftime}
1741 formats which may yield only a two-digit year.
1742
1743 @item -Wno-format-extra-args
1744 If @samp{-Wformat} is specified, do not warn about excess arguments to a
1745 @code{printf} or @code{scanf} format function.  The C standard specifies
1746 that such arguments are ignored.
1747
1748 @item -Wformat-nonliteral
1749 If @samp{-Wformat} is specified, also warn if the format string is not a
1750 string literal and so cannot be checked, unless the format function
1751 takes its format arguments as a @code{va_list}.
1752
1753 @item -Wformat-security
1754 If @samp{-Wformat} is specified, also warn about uses of format
1755 functions that represent possible security problems.  At present, this
1756 warns about calls to @code{printf} and @code{scanf} functions where the
1757 format string is not a string literal and there are no format arguments,
1758 as in @code{printf (foo);}.  This may be a security hole if the format
1759 string came from untrusted input and contains @samp{%n}.  (This is
1760 currently a subset of what @samp{-Wformat-nonliteral} warns about, but
1761 in future warnings may be added to @samp{-Wformat-security} that are not
1762 included in @samp{-Wformat-nonliteral}.)
1763
1764 @item -Wformat=2
1765 Enable @samp{-Wformat} plus format checks not included in
1766 @samp{-Wformat}.  Currently equivalent to @samp{-Wformat
1767 -Wformat-nonliteral -Wformat-security}.
1768
1769 @item -Wimplicit-int
1770 Warn when a declaration does not specify a type.
1771
1772 @item -Wimplicit-function-declaration
1773 @itemx -Werror-implicit-function-declaration
1774 Give a warning (or error) whenever a function is used before being
1775 declared.
1776
1777 @item -Wimplicit
1778 Same as @samp{-Wimplicit-int} and @samp{-Wimplicit-function-}@*
1779 @samp{declaration}.
1780
1781 @item -Wmain
1782 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
1783 function with external linkage, returning int, taking either zero
1784 arguments, two, or three arguments of appropriate types.
1785
1786 @item -Wmissing-braces
1787 Warn if an aggregate or union initializer is not fully bracketed.  In
1788 the following example, the initializer for @samp{a} is not fully
1789 bracketed, but that for @samp{b} is fully bracketed.
1790
1791 @smallexample
1792 int a[2][2] = @{ 0, 1, 2, 3 @};
1793 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
1794 @end smallexample
1795
1796 @item -Wmultichar
1797 Warn if a multicharacter constant (@samp{'FOOF'}) is used.  Usually they
1798 indicate a typo in the user's code, as they have implementation-defined
1799 values, and should not be used in portable code.
1800
1801 @item -Wparentheses
1802 Warn if parentheses are omitted in certain contexts, such
1803 as when there is an assignment in a context where a truth value
1804 is expected, or when operators are nested whose precedence people
1805 often get confused about.
1806
1807 Also warn about constructions where there may be confusion to which
1808 @code{if} statement an @code{else} branch belongs.  Here is an example of
1809 such a case:
1810
1811 @smallexample
1812 @{
1813   if (a)
1814     if (b)
1815       foo ();
1816   else
1817     bar ();
1818 @}
1819 @end smallexample
1820
1821 In C, every @code{else} branch belongs to the innermost possible @code{if}
1822 statement, which in this example is @code{if (b)}.  This is often not
1823 what the programmer expected, as illustrated in the above example by
1824 indentation the programmer chose.  When there is the potential for this
1825 confusion, GNU C will issue a warning when this flag is specified.
1826 To eliminate the warning, add explicit braces around the innermost
1827 @code{if} statement so there is no way the @code{else} could belong to
1828 the enclosing @code{if}.  The resulting code would look like this:
1829
1830 @smallexample
1831 @{
1832   if (a)
1833     @{
1834       if (b)
1835         foo ();
1836       else
1837         bar ();
1838     @}
1839 @}
1840 @end smallexample
1841
1842 @item -Wsequence-point
1843 Warn about code that may have undefined semantics because of violations
1844 of sequence point rules in the C standard.
1845
1846 The C standard defines the order in which expressions in a C program are
1847 evaluated in terms of @dfn{sequence points}, which represent a partial
1848 ordering between the execution of parts of the program: those executed
1849 before the sequence point, and those executed after it.  These occur
1850 after the evaluation of a full expression (one which is not part of a
1851 larger expression), after the evaluation of the first operand of a
1852 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
1853 function is called (but after the evaluation of its arguments and the
1854 expression denoting the called function), and in certain other places.
1855 Other than as expressed by the sequence point rules, the order of
1856 evaluation of subexpressions of an expression is not specified.  All
1857 these rules describe only a partial order rather than a total order,
1858 since, for example, if two functions are called within one expression
1859 with no sequence point between them, the order in which the functions
1860 are called is not specified.  However, the standards committee have
1861 ruled that function calls do not overlap.
1862
1863 It is not specified when between sequence points modifications to the
1864 values of objects take effect.  Programs whose behavior depends on this
1865 have undefined behavior; the C standard specifies that ``Between the
1866 previous and next sequence point an object shall have its stored value
1867 modified at most once by the evaluation of an expression.  Furthermore,
1868 the prior value shall be read only to determine the value to be
1869 stored.''.  If a program breaks these rules, the results on any
1870 particular implementation are entirely unpredictable.
1871
1872 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
1873 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
1874 diagnosed by this option, and it may give an occasional false positive
1875 result, but in general it has been found fairly effective at detecting
1876 this sort of problem in programs.
1877
1878 The present implementation of this option only works for C programs.  A
1879 future implementation may also work for C++ programs.
1880
1881 There is some controversy over the precise meaning of the sequence point
1882 rules in subtle cases.  Alternative formal definitions may be found in
1883 Clive Feather's ``Annex S''
1884 @w{@uref{http://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/n925.htm}} and in
1885 Michael Norrish's thesis
1886 @w{@uref{http://www.cl.cam.ac.uk/users/mn200/PhD/thesis-report.ps.gz}}.
1887 Other discussions are by Raymond Mak
1888 @w{@uref{http://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/n926.htm}} and
1889 D. Hugh Redelmeier
1890 @w{@uref{http://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/n927.htm}}.
1891
1892 @item -Wreturn-type
1893 Warn whenever a function is defined with a return-type that defaults to
1894 @code{int}.  Also warn about any @code{return} statement with no
1895 return-value in a function whose return-type is not @code{void}.
1896
1897 For C++, a function without return type always produces a diagnostic
1898 message, even when @samp{-Wno-return-type} is specified. The only
1899 exceptions are @samp{main} and functions defined in system headers.
1900
1901 @item -Wswitch
1902 Warn whenever a @code{switch} statement has an index of enumeral type
1903 and lacks a @code{case} for one or more of the named codes of that
1904 enumeration.  (The presence of a @code{default} label prevents this
1905 warning.)  @code{case} labels outside the enumeration range also
1906 provoke warnings when this option is used.
1907
1908 @item -Wtrigraphs
1909 Warn if any trigraphs are encountered that might change the meaning of
1910 the program (trigraphs within comments are not warned about).
1911
1912 @item -Wunused-function
1913 Warn whenever a static function is declared but not defined or a
1914 non\-inline static function is unused.
1915
1916 @item -Wunused-label
1917 Warn whenever a label is declared but not used.
1918
1919 To suppress this warning use the @samp{unused} attribute
1920 (@pxref{Variable Attributes}).
1921
1922 @item -Wunused-parameter
1923 Warn whenever a function parameter is unused aside from its declaration.
1924
1925 To suppress this warning use the @samp{unused} attribute
1926 (@pxref{Variable Attributes}).
1927
1928 @item -Wunused-variable
1929 Warn whenever a local variable or non-constant static variable is unused
1930 aside from its declaration
1931
1932 To suppress this warning use the @samp{unused} attribute
1933 (@pxref{Variable Attributes}).
1934
1935 @item -Wunused-value
1936 Warn whenever a statement computes a result that is explicitly not used.
1937
1938 To suppress this warning cast the expression to @samp{void}.
1939
1940 @item -Wunused
1941 All all the above @samp{-Wunused} options combined.
1942
1943 In order to get a warning about an unused function parameter, you must
1944 either specify @samp{-W -Wunused} or separately specify
1945 @samp{-Wunused-parameter}.
1946
1947 @item -Wuninitialized
1948 Warn if an automatic variable is used without first being initialized or
1949 if a variable may be clobbered by a @code{setjmp} call.
1950
1951 These warnings are possible only in optimizing compilation,
1952 because they require data flow information that is computed only
1953 when optimizing.  If you don't specify @samp{-O}, you simply won't
1954 get these warnings.
1955
1956 These warnings occur only for variables that are candidates for
1957 register allocation.  Therefore, they do not occur for a variable that
1958 is declared @code{volatile}, or whose address is taken, or whose size
1959 is other than 1, 2, 4 or 8 bytes.  Also, they do not occur for
1960 structures, unions or arrays, even when they are in registers.
1961
1962 Note that there may be no warning about a variable that is used only
1963 to compute a value that itself is never used, because such
1964 computations may be deleted by data flow analysis before the warnings
1965 are printed.
1966
1967 These warnings are made optional because GCC is not smart
1968 enough to see all the reasons why the code might be correct
1969 despite appearing to have an error.  Here is one example of how
1970 this can happen:
1971
1972 @smallexample
1973 @{
1974   int x;
1975   switch (y)
1976     @{
1977     case 1: x = 1;
1978       break;
1979     case 2: x = 4;
1980       break;
1981     case 3: x = 5;
1982     @}
1983   foo (x);
1984 @}
1985 @end smallexample
1986
1987 @noindent
1988 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
1989 always initialized, but GCC doesn't know this.  Here is
1990 another common case:
1991
1992 @smallexample
1993 @{
1994   int save_y;
1995   if (change_y) save_y = y, y = new_y;
1996   @dots{}
1997   if (change_y) y = save_y;
1998 @}
1999 @end smallexample
2000
2001 @noindent
2002 This has no bug because @code{save_y} is used only if it is set.
2003
2004 @cindex @code{longjmp} warnings
2005 This option also warns when a non-volatile automatic variable might be
2006 changed by a call to @code{longjmp}.  These warnings as well are possible
2007 only in optimizing compilation.
2008
2009 The compiler sees only the calls to @code{setjmp}.  It cannot know
2010 where @code{longjmp} will be called; in fact, a signal handler could
2011 call it at any point in the code.  As a result, you may get a warning
2012 even when there is in fact no problem because @code{longjmp} cannot
2013 in fact be called at the place which would cause a problem.
2014
2015 Some spurious warnings can be avoided if you declare all the functions
2016 you use that never return as @code{noreturn}.  @xref{Function
2017 Attributes}.
2018
2019 @item -Wreorder (C++ only)
2020 @cindex reordering, warning
2021 @cindex warning for reordering of member initializers
2022 Warn when the order of member initializers given in the code does not
2023 match the order in which they must be executed.  For instance:
2024
2025 @item -Wunknown-pragmas
2026 @cindex warning for unknown pragmas
2027 @cindex unknown pragmas, warning
2028 @cindex pragmas, warning of unknown
2029 Warn when a #pragma directive is encountered which is not understood by
2030 GCC.  If this command line option is used, warnings will even be issued
2031 for unknown pragmas in system header files.  This is not the case if
2032 the warnings were only enabled by the @samp{-Wall} command line option.
2033
2034 @item -Wall
2035 All of the above @samp{-W} options combined.  This enables all the
2036 warnings about constructions that some users consider questionable, and
2037 that are easy to avoid (or modify to prevent the warning), even in
2038 conjunction with macros.
2039
2040 @item -Wsystem-headers
2041 @cindex warnings from system headers
2042 @cindex system headers, warnings from
2043 Print warning messages for constructs found in system header files.
2044 Warnings from system headers are normally suppressed, on the assumption
2045 that they usually do not indicate real problems and would only make the
2046 compiler output harder to read.  Using this command line option tells
2047 GCC to emit warnings from system headers as if they occurred in user
2048 code.  However, note that using @samp{-Wall} in conjunction with this
2049 option will @emph{not} warn about unknown pragmas in system
2050 headers---for that, @samp{-Wunknown-pragmas} must also be used.
2051 @end table
2052
2053 The following @samp{-W@dots{}} options are not implied by @samp{-Wall}.
2054 Some of them warn about constructions that users generally do not
2055 consider questionable, but which occasionally you might wish to check
2056 for; others warn about constructions that are necessary or hard to avoid
2057 in some cases, and there is no simple way to modify the code to suppress
2058 the warning.
2059
2060 @table @gcctabopt
2061 @item -W
2062 Print extra warning messages for these events:
2063
2064 @itemize @bullet
2065 @item
2066 A function can return either with or without a value.  (Falling
2067 off the end of the function body is considered returning without
2068 a value.)  For example, this function would evoke such a
2069 warning:
2070
2071 @smallexample
2072 @group
2073 foo (a)
2074 @{
2075   if (a > 0)
2076     return a;
2077 @}
2078 @end group
2079 @end smallexample
2080
2081 @item
2082 An expression-statement or the left-hand side of a comma expression
2083 contains no side effects.
2084 To suppress the warning, cast the unused expression to void.
2085 For example, an expression such as @samp{x[i,j]} will cause a warning,
2086 but @samp{x[(void)i,j]} will not.
2087
2088 @item
2089 An unsigned value is compared against zero with @samp{<} or @samp{<=}.
2090
2091 @item
2092 A comparison like @samp{x<=y<=z} appears; this is equivalent to
2093 @samp{(x<=y ? 1 : 0) <= z}, which is a different interpretation from
2094 that of ordinary mathematical notation.
2095
2096 @item
2097 Storage-class specifiers like @code{static} are not the first things in
2098 a declaration.  According to the C Standard, this usage is obsolescent.
2099
2100 @item
2101 The return type of a function has a type qualifier such as @code{const}.
2102 Such a type qualifier has no effect, since the value returned by a
2103 function is not an lvalue.  (But don't warn about the GNU extension of
2104 @code{volatile void} return types.  That extension will be warned about
2105 if @samp{-pedantic} is specified.)
2106
2107 @item
2108 If @samp{-Wall} or @samp{-Wunused} is also specified, warn about unused
2109 arguments.
2110
2111 @item
2112 A comparison between signed and unsigned values could produce an
2113 incorrect result when the signed value is converted to unsigned.
2114 (But don't warn if @samp{-Wno-sign-compare} is also specified.)
2115
2116 @item
2117 An aggregate has a partly bracketed initializer.
2118 For example, the following code would evoke such a warning,
2119 because braces are missing around the initializer for @code{x.h}:
2120
2121 @smallexample
2122 struct s @{ int f, g; @};
2123 struct t @{ struct s h; int i; @};
2124 struct t x = @{ 1, 2, 3 @};
2125 @end smallexample
2126
2127 @item
2128 An aggregate has an initializer which does not initialize all members.
2129 For example, the following code would cause such a warning, because
2130 @code{x.h} would be implicitly initialized to zero:
2131
2132 @smallexample
2133 struct s @{ int f, g, h; @};
2134 struct s x = @{ 3, 4 @};
2135 @end smallexample
2136 @end itemize
2137
2138 @item -Wfloat-equal
2139 Warn if floating point values are used in equality comparisons.
2140
2141 The idea behind this is that sometimes it is convenient (for the
2142 programmer) to consider floating-point values as approximations to
2143 infinitely precise real numbers.  If you are doing this, then you need
2144 to compute (by analysing the code, or in some other way) the maximum or
2145 likely maximum error that the computation introduces, and allow for it
2146 when performing comparisons (and when producing output, but that's a
2147 different problem).  In particular, instead of testing for equality, you
2148 would check to see whether the two values have ranges that overlap; and
2149 this is done with the relational operators, so equality comparisons are
2150 probably mistaken.
2151
2152 @item -Wtraditional (C only)
2153 Warn about certain constructs that behave differently in traditional and
2154 ISO C.  Also warn about ISO C constructs that have no traditional C
2155 equivalent, and/or problematic constructs which should be avoided.
2156
2157 @itemize @bullet
2158 @item
2159 Macro parameters that appear within string literals in the macro body.
2160 In traditional C macro replacement takes place within string literals,
2161 but does not in ISO C.
2162
2163 @item
2164 In traditional C, some preprocessor directives did not exist.
2165 Traditional preprocessors would only consider a line to be a directive
2166 if the @samp{#} appeared in column 1 on the line.  Therefore
2167 @samp{-Wtraditional} warns about directives that traditional C
2168 understands but would ignore because the @samp{#} does not appear as the
2169 first character on the line.  It also suggests you hide directives like
2170 @samp{#pragma} not understood by traditional C by indenting them.  Some
2171 traditional implementations would not recognise @samp{#elif}, so it
2172 suggests avoiding it altogether.
2173
2174 @item
2175 A function-like macro that appears without arguments.
2176
2177 @item
2178 The unary plus operator.
2179
2180 @item
2181 The `U' integer constant suffix, or the `F' or `L' floating point
2182 constant suffixes.  (Traditonal C does support the `L' suffix on integer
2183 constants.)  Note, these suffixes appear in macros defined in the system
2184 headers of most modern systems, e.g. the _MIN/_MAX macros in limits.h.
2185 Use of these macros in user code might normally lead to spurious
2186 warnings, however gcc's integrated preprocessor has enough context to
2187 avoid warning in these cases.
2188
2189 @item
2190 A function declared external in one block and then used after the end of
2191 the block.
2192
2193 @item
2194 A @code{switch} statement has an operand of type @code{long}.
2195
2196 @item
2197 A non-@code{static} function declaration follows a @code{static} one.
2198 This construct is not accepted by some traditional C compilers.
2199
2200 @item
2201 The ISO type of an integer constant has a different width or
2202 signedness from its traditional type.  This warning is only issued if
2203 the base of the constant is ten.  I.e. hexadecimal or octal values, which
2204 typically represent bit patterns, are not warned about.
2205
2206 @item
2207 Usage of ISO string concatenation is detected.
2208
2209 @item
2210 Initialization of automatic aggregates.
2211
2212 @item
2213 Identifier conflicts with labels.  Traditional C lacks a separate
2214 namespace for labels.
2215
2216 @item
2217 Initialization of unions.  If the initializer is zero, the warning is
2218 omitted.  This is done under the assumption that the zero initializer in
2219 user code appears conditioned on e.g. @code{__STDC__} to avoid missing
2220 initializer warnings and relies on default initialization to zero in the
2221 traditional C case.
2222
2223 @item
2224 Conversions by prototypes between fixed/floating point values and vice
2225 versa.  The absence of these prototypes when compiling with traditional
2226 C would cause serious problems.  This is a subset of the possible
2227 conversion warnings, for the full set use @samp{-Wconversion}.
2228 @end itemize
2229
2230 @item -Wundef
2231 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
2232
2233 @item -Wshadow
2234 Warn whenever a local variable shadows another local variable, parameter or
2235 global variable or whenever a built-in function is shadowed.
2236
2237 @item -Wid-clash-@var{len}
2238 Warn whenever two distinct identifiers match in the first @var{len}
2239 characters.  This may help you prepare a program that will compile
2240 with certain obsolete, brain-damaged compilers.
2241
2242 @item -Wlarger-than-@var{len}
2243 Warn whenever an object of larger than @var{len} bytes is defined.
2244
2245 @item -Wpointer-arith
2246 Warn about anything that depends on the ``size of'' a function type or
2247 of @code{void}.  GNU C assigns these types a size of 1, for
2248 convenience in calculations with @code{void *} pointers and pointers
2249 to functions.
2250
2251 @item -Wbad-function-cast (C only)
2252 Warn whenever a function call is cast to a non-matching type.
2253 For example, warn if @code{int malloc()} is cast to @code{anything *}.
2254
2255 @item -Wcast-qual
2256 Warn whenever a pointer is cast so as to remove a type qualifier from
2257 the target type.  For example, warn if a @code{const char *} is cast
2258 to an ordinary @code{char *}.
2259
2260 @item -Wcast-align
2261 Warn whenever a pointer is cast such that the required alignment of the
2262 target is increased.  For example, warn if a @code{char *} is cast to
2263 an @code{int *} on machines where integers can only be accessed at
2264 two- or four-byte boundaries.
2265
2266 @item -Wwrite-strings
2267 Give string constants the type @code{const char[@var{length}]} so that
2268 copying the address of one into a non-@code{const} @code{char *}
2269 pointer will get a warning.  These warnings will help you find at
2270 compile time code that can try to write into a string constant, but
2271 only if you have been very careful about using @code{const} in
2272 declarations and prototypes.  Otherwise, it will just be a nuisance;
2273 this is why we did not make @samp{-Wall} request these warnings.
2274
2275 @item -Wconversion
2276 Warn if a prototype causes a type conversion that is different from what
2277 would happen to the same argument in the absence of a prototype.  This
2278 includes conversions of fixed point to floating and vice versa, and
2279 conversions changing the width or signedness of a fixed point argument
2280 except when the same as the default promotion.
2281
2282 Also, warn if a negative integer constant expression is implicitly
2283 converted to an unsigned type.  For example, warn about the assignment
2284 @code{x = -1} if @code{x} is unsigned.  But do not warn about explicit
2285 casts like @code{(unsigned) -1}.
2286
2287 @item -Wsign-compare
2288 @cindex warning for comparison of signed and unsigned values
2289 @cindex comparison of signed and unsigned values, warning
2290 @cindex signed and unsigned values, comparison warning
2291 Warn when a comparison between signed and unsigned values could produce
2292 an incorrect result when the signed value is converted to unsigned.
2293 This warning is also enabled by @samp{-W}; to get the other warnings
2294 of @samp{-W} without this warning, use @samp{-W -Wno-sign-compare}.
2295
2296 @item -Waggregate-return
2297 Warn if any functions that return structures or unions are defined or
2298 called.  (In languages where you can return an array, this also elicits
2299 a warning.)
2300
2301 @item -Wstrict-prototypes (C only)
2302 Warn if a function is declared or defined without specifying the
2303 argument types.  (An old-style function definition is permitted without
2304 a warning if preceded by a declaration which specifies the argument
2305 types.)
2306
2307 @item -Wmissing-prototypes (C only)
2308 Warn if a global function is defined without a previous prototype
2309 declaration.  This warning is issued even if the definition itself
2310 provides a prototype.  The aim is to detect global functions that fail
2311 to be declared in header files.
2312
2313 @item -Wmissing-declarations
2314 Warn if a global function is defined without a previous declaration.
2315 Do so even if the definition itself provides a prototype.
2316 Use this option to detect global functions that are not declared in
2317 header files.
2318
2319 @item -Wmissing-noreturn
2320 Warn about functions which might be candidates for attribute @code{noreturn}.
2321 Note these are only possible candidates, not absolute ones.  Care should
2322 be taken to manually verify functions actually do not ever return before
2323 adding the @code{noreturn} attribute, otherwise subtle code generation
2324 bugs could be introduced.  You will not get a warning for @code{main} in
2325 hosted C environments.
2326
2327 @item -Wmissing-format-attribute
2328 If @samp{-Wformat} is enabled, also warn about functions which might be
2329 candidates for @code{format} attributes.  Note these are only possible
2330 candidates, not absolute ones.  GCC will guess that @code{format}
2331 attributes might be appropriate for any function that calls a function
2332 like @code{vprintf} or @code{vscanf}, but this might not always be the
2333 case, and some functions for which @code{format} attributes are
2334 appropriate may not be detected.  This option has no effect unless
2335 @samp{-Wformat} is enabled (possibly by @samp{-Wall}).
2336
2337 @item -Wpacked
2338 Warn if a structure is given the packed attribute, but the packed
2339 attribute has no effect on the layout or size of the structure.
2340 Such structures may be mis-aligned for little benefit.  For
2341 instance, in this code, the variable @code{f.x} in @code{struct bar}
2342 will be misaligned even though @code{struct bar} does not itself
2343 have the packed attribute:
2344
2345 @smallexample
2346 @group
2347 struct foo @{
2348   int x;
2349   char a, b, c, d;
2350 @} __attribute__((packed));
2351 struct bar @{
2352   char z;
2353   struct foo f;
2354 @};
2355 @end group
2356 @end smallexample
2357
2358 @item -Wpadded
2359 Warn if padding is included in a structure, either to align an element
2360 of the structure or to align the whole structure.  Sometimes when this
2361 happens it is possible to rearrange the fields of the structure to
2362 reduce the padding and so make the structure smaller.
2363
2364 @item -Wredundant-decls
2365 Warn if anything is declared more than once in the same scope, even in
2366 cases where multiple declaration is valid and changes nothing.
2367
2368 @item -Wnested-externs (C only)
2369 Warn if an @code{extern} declaration is encountered within a function.
2370
2371 @item -Wunreachable-code
2372 Warn if the compiler detects that code will never be executed.
2373
2374 This option is intended to warn when the compiler detects that at
2375 least a whole line of source code will never be executed, because
2376 some condition is never satisfied or because it is after a
2377 procedure that never returns.
2378
2379 It is possible for this option to produce a warning even though there
2380 are circumstances under which part of the affected line can be executed,
2381 so care should be taken when removing apparently-unreachable code.
2382
2383 For instance, when a function is inlined, a warning may mean that the
2384 line is unreachable in only one inlined copy of the function.
2385
2386 This option is not made part of @samp{-Wall} because in a debugging
2387 version of a program there is often substantial code which checks
2388 correct functioning of the program and is, hopefully, unreachable
2389 because the program does work.  Another common use of unreachable
2390 code is to provide behaviour which is selectable at compile-time.
2391
2392 @item -Winline
2393 Warn if a function can not be inlined and it was declared as inline.
2394
2395 @item -Wlong-long
2396 Warn if @samp{long long} type is used.  This is default.  To inhibit
2397 the warning messages, use @samp{-Wno-long-long}.  Flags
2398 @samp{-Wlong-long} and @samp{-Wno-long-long} are taken into account
2399 only when @samp{-pedantic} flag is used.
2400
2401 @item -Wdisabled-optimization
2402 Warn if a requested optimization pass is disabled.  This warning does
2403 not generally indicate that there is anything wrong with your code; it
2404 merely indicates that GCC's optimizers were unable to handle the code
2405 effectively.  Often, the problem is that your code is too big or too
2406 complex; GCC will refuse to optimize programs when the optimization
2407 itself is likely to take inordinate amounts of time.
2408
2409 @item -Werror
2410 Make all warnings into errors.
2411 @end table
2412
2413 @node Debugging Options
2414 @section Options for Debugging Your Program or GCC
2415 @cindex options, debugging
2416 @cindex debugging information options
2417
2418 GCC has various special options that are used for debugging
2419 either your program or GCC:
2420
2421 @table @gcctabopt
2422 @item -g
2423 Produce debugging information in the operating system's native format
2424 (stabs, COFF, XCOFF, or DWARF).  GDB can work with this debugging
2425 information.
2426
2427 On most systems that use stabs format, @samp{-g} enables use of extra
2428 debugging information that only GDB can use; this extra information
2429 makes debugging work better in GDB but will probably make other debuggers
2430 crash or
2431 refuse to read the program.  If you want to control for certain whether
2432 to generate the extra information, use @samp{-gstabs+}, @samp{-gstabs},
2433 @samp{-gxcoff+}, @samp{-gxcoff}, @samp{-gdwarf-1+}, or @samp{-gdwarf-1}
2434 (see below).
2435
2436 Unlike most other C compilers, GCC allows you to use @samp{-g} with
2437 @samp{-O}.  The shortcuts taken by optimized code may occasionally
2438 produce surprising results: some variables you declared may not exist
2439 at all; flow of control may briefly move where you did not expect it;
2440 some statements may not be executed because they compute constant
2441 results or their values were already at hand; some statements may
2442 execute in different places because they were moved out of loops.
2443
2444 Nevertheless it proves possible to debug optimized output.  This makes
2445 it reasonable to use the optimizer for programs that might have bugs.
2446
2447 The following options are useful when GCC is generated with the
2448 capability for more than one debugging format.
2449
2450 @item -ggdb
2451 Produce debugging information for use by GDB.  This means to use the
2452 most expressive format available (DWARF 2, stabs, or the native format
2453 if neither of those are supported), including GDB extensions if at all
2454 possible.
2455
2456 @item -gstabs
2457 Produce debugging information in stabs format (if that is supported),
2458 without GDB extensions.  This is the format used by DBX on most BSD
2459 systems.  On MIPS, Alpha and System V Release 4 systems this option
2460 produces stabs debugging output which is not understood by DBX or SDB.
2461 On System V Release 4 systems this option requires the GNU assembler.
2462
2463 @item -gstabs+
2464 Produce debugging information in stabs format (if that is supported),
2465 using GNU extensions understood only by the GNU debugger (GDB).  The
2466 use of these extensions is likely to make other debuggers crash or
2467 refuse to read the program.
2468
2469 @item -gcoff
2470 Produce debugging information in COFF format (if that is supported).
2471 This is the format used by SDB on most System V systems prior to
2472 System V Release 4.
2473
2474 @item -gxcoff
2475 Produce debugging information in XCOFF format (if that is supported).
2476 This is the format used by the DBX debugger on IBM RS/6000 systems.
2477
2478 @item -gxcoff+
2479 Produce debugging information in XCOFF format (if that is supported),
2480 using GNU extensions understood only by the GNU debugger (GDB).  The
2481 use of these extensions is likely to make other debuggers crash or
2482 refuse to read the program, and may cause assemblers other than the GNU
2483 assembler (GAS) to fail with an error.
2484
2485 @item -gdwarf
2486 Produce debugging information in DWARF version 1 format (if that is
2487 supported).  This is the format used by SDB on most System V Release 4
2488 systems.
2489
2490 @item -gdwarf+
2491 Produce debugging information in DWARF version 1 format (if that is
2492 supported), using GNU extensions understood only by the GNU debugger
2493 (GDB).  The use of these extensions is likely to make other debuggers
2494 crash or refuse to read the program.
2495
2496 @item -gdwarf-2
2497 Produce debugging information in DWARF version 2 format (if that is
2498 supported).  This is the format used by DBX on IRIX 6.
2499
2500 @item -g@var{level}
2501 @itemx -ggdb@var{level}
2502 @itemx -gstabs@var{level}
2503 @itemx -gcoff@var{level}
2504 @itemx -gxcoff@var{level}
2505 @itemx -gdwarf@var{level}
2506 @itemx -gdwarf-2@var{level}
2507 Request debugging information and also use @var{level} to specify how
2508 much information.  The default level is 2.
2509
2510 Level 1 produces minimal information, enough for making backtraces in
2511 parts of the program that you don't plan to debug.  This includes
2512 descriptions of functions and external variables, but no information
2513 about local variables and no line numbers.
2514
2515 Level 3 includes extra information, such as all the macro definitions
2516 present in the program.  Some debuggers support macro expansion when
2517 you use @samp{-g3}.
2518
2519 @cindex @code{prof}
2520 @item -p
2521 Generate extra code to write profile information suitable for the
2522 analysis program @code{prof}.  You must use this option when compiling
2523 the source files you want data about, and you must also use it when
2524 linking.
2525
2526 @cindex @code{gprof}
2527 @item -pg
2528 Generate extra code to write profile information suitable for the
2529 analysis program @code{gprof}.  You must use this option when compiling
2530 the source files you want data about, and you must also use it when
2531 linking.
2532
2533 @cindex @code{tcov}
2534 @item -a
2535 Generate extra code to write profile information for basic blocks, which will
2536 record the number of times each basic block is executed, the basic block start
2537 address, and the function name containing the basic block.  If @samp{-g} is
2538 used, the line number and filename of the start of the basic block will also be
2539 recorded.  If not overridden by the machine description, the default action is
2540 to append to the text file @file{bb.out}.
2541
2542 This data could be analyzed by a program like @code{tcov}.  Note,
2543 however, that the format of the data is not what @code{tcov} expects.
2544 Eventually GNU @code{gprof} should be extended to process this data.
2545
2546 @item -Q
2547 Makes the compiler print out each function name as it is compiled, and
2548 print some statistics about each pass when it finishes.
2549
2550 @item -ftime-report
2551 Makes the compiler print some statistics about the time consumed by each
2552 pass when it finishes.
2553
2554 @item -fmem-report
2555 Makes the compiler print some statistics about permanent memory
2556 allocation when it finishes.
2557
2558 @item -ax
2559 Generate extra code to profile basic blocks.  Your executable will
2560 produce output that is a superset of that produced when @samp{-a} is
2561 used.  Additional output is the source and target address of the basic
2562 blocks where a jump takes place, the number of times a jump is executed,
2563 and (optionally) the complete sequence of basic blocks being executed.
2564 The output is appended to file @file{bb.out}.
2565
2566 You can examine different profiling aspects without recompilation.  Your
2567 executable will read a list of function names from file @file{bb.in}.
2568 Profiling starts when a function on the list is entered and stops when
2569 that invocation is exited.  To exclude a function from profiling, prefix
2570 its name with `-'.  If a function name is not unique, you can
2571 disambiguate it by writing it in the form
2572 @samp{/path/filename.d:functionname}.  Your executable will write the
2573 available paths and filenames in file @file{bb.out}.
2574
2575 Several function names have a special meaning:
2576 @table @code
2577 @item __bb_jumps__
2578 Write source, target and frequency of jumps to file @file{bb.out}.
2579 @item __bb_hidecall__
2580 Exclude function calls from frequency count.
2581 @item __bb_showret__
2582 Include function returns in frequency count.
2583 @item __bb_trace__
2584 Write the sequence of basic blocks executed to file @file{bbtrace.gz}.
2585 The file will be compressed using the program @samp{gzip}, which must
2586 exist in your @env{PATH}.  On systems without the @samp{popen}
2587 function, the file will be named @file{bbtrace} and will not be
2588 compressed.  @strong{Profiling for even a few seconds on these systems
2589 will produce a very large file.}  Note: @code{__bb_hidecall__} and
2590 @code{__bb_showret__} will not affect the sequence written to
2591 @file{bbtrace.gz}.
2592 @end table
2593
2594 Here's a short example using different profiling parameters
2595 in file @file{bb.in}.  Assume function @code{foo} consists of basic blocks
2596 1 and 2 and is called twice from block 3 of function @code{main}.  After
2597 the calls, block 3 transfers control to block 4 of @code{main}.
2598
2599 With @code{__bb_trace__} and @code{main} contained in file @file{bb.in},
2600 the following sequence of blocks is written to file @file{bbtrace.gz}:
2601 0 3 1 2 1 2 4.  The return from block 2 to block 3 is not shown, because
2602 the return is to a point inside the block and not to the top.  The
2603 block address 0 always indicates, that control is transferred
2604 to the trace from somewhere outside the observed functions.  With
2605 @samp{-foo} added to @file{bb.in}, the blocks of function
2606 @code{foo} are removed from the trace, so only 0 3 4 remains.
2607
2608 With @code{__bb_jumps__} and @code{main} contained in file @file{bb.in},
2609 jump frequencies will be written to file @file{bb.out}.  The
2610 frequencies are obtained by constructing a trace of blocks
2611 and incrementing a counter for every neighbouring pair of blocks
2612 in the trace.  The trace 0 3 1 2 1 2 4 displays the following
2613 frequencies:
2614
2615 @example
2616 Jump from block 0x0 to block 0x3 executed 1 time(s)
2617 Jump from block 0x3 to block 0x1 executed 1 time(s)
2618 Jump from block 0x1 to block 0x2 executed 2 time(s)
2619 Jump from block 0x2 to block 0x1 executed 1 time(s)
2620 Jump from block 0x2 to block 0x4 executed 1 time(s)
2621 @end example
2622
2623 With @code{__bb_hidecall__}, control transfer due to call instructions
2624 is removed from the trace, that is the trace is cut into three parts: 0
2625 3 4, 0 1 2 and 0 1 2.  With @code{__bb_showret__}, control transfer due
2626 to return instructions is added to the trace.  The trace becomes: 0 3 1
2627 2 3 1 2 3 4.  Note, that this trace is not the same, as the sequence
2628 written to @file{bbtrace.gz}.  It is solely used for counting jump
2629 frequencies.
2630
2631 @item -fprofile-arcs
2632 Instrument @dfn{arcs} during compilation.  For each function of your
2633 program, GCC creates a program flow graph, then finds a spanning tree
2634 for the graph.  Only arcs that are not on the spanning tree have to be
2635 instrumented: the compiler adds code to count the number of times that these
2636 arcs are executed.  When an arc is the only exit or only entrance to a
2637 block, the instrumentation code can be added to the block; otherwise, a
2638 new basic block must be created to hold the instrumentation code.
2639
2640 Since not every arc in the program must be instrumented, programs
2641 compiled with this option run faster than programs compiled with
2642 @samp{-a}, which adds instrumentation code to every basic block in the
2643 program.  The tradeoff: since @code{gcov} does not have
2644 execution counts for all branches, it must start with the execution
2645 counts for the instrumented branches, and then iterate over the program
2646 flow graph until the entire graph has been solved.  Hence, @code{gcov}
2647 runs a little more slowly than a program which uses information from
2648 @samp{-a}.
2649
2650 @samp{-fprofile-arcs} also makes it possible to estimate branch
2651 probabilities, and to calculate basic block execution counts.  In
2652 general, basic block execution counts do not give enough information to
2653 estimate all branch probabilities.  When the compiled program exits, it
2654 saves the arc execution counts to a file called
2655 @file{@var{sourcename}.da}.  Use the compiler option
2656 @samp{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
2657 Control Optimization}) when recompiling, to optimize using estimated
2658 branch probabilities.
2659
2660 @need 2000
2661 @item -ftest-coverage
2662 Create data files for the @code{gcov} code-coverage utility
2663 (@pxref{Gcov,, @code{gcov}: a GCC Test Coverage Program}).
2664 The data file names begin with the name of your source file:
2665
2666 @table @gcctabopt
2667 @item @var{sourcename}.bb
2668 A mapping from basic blocks to line numbers, which @code{gcov} uses to
2669 associate basic block execution counts with line numbers.
2670
2671 @item @var{sourcename}.bbg
2672 A list of all arcs in the program flow graph.  This allows @code{gcov}
2673 to reconstruct the program flow graph, so that it can compute all basic
2674 block and arc execution counts from the information in the
2675 @code{@var{sourcename}.da} file (this last file is the output from
2676 @samp{-fprofile-arcs}).
2677 @end table
2678
2679 @item -d@var{letters}
2680 Says to make debugging dumps during compilation at times specified by
2681 @var{letters}.  This is used for debugging the compiler.  The file names
2682 for most of the dumps are made by appending a pass number and a word to
2683 the source file name (e.g.  @file{foo.c.00.rtl} or @file{foo.c.01.sibling}).
2684 Here are the possible letters for use in @var{letters}, and their meanings:
2685
2686 @table @samp
2687 @item A
2688 Annotate the assembler output with miscellaneous debugging information.
2689 @item b
2690 Dump after computing branch probabilities, to @file{@var{file}.11.bp}.
2691 @item B
2692 Dump after block reordering, to @file{@var{file}.26.bbro}.
2693 @item c
2694 Dump after instruction combination, to the file @file{@var{file}.14.combine}.
2695 @item C
2696 Dump after the first if conversion, to the file @file{@var{file}.15.ce}.
2697 @item d
2698 Dump after delayed branch scheduling, to @file{@var{file}.29.dbr}.
2699 @item D
2700 Dump all macro definitions, at the end of preprocessing, in addition to
2701 normal output.
2702 @item e
2703 Dump after SSA optimizations, to @file{@var{file}.05.ssa} and
2704 @file{@var{file}.06.ussa}.
2705 @item E
2706 Dump after the second if conversion, to @file{@var{file}.24.ce2}.
2707 @item f
2708 Dump after life analysis, to @file{@var{file}.13.life}.
2709 @item F
2710 Dump after purging @code{ADDRESSOF} codes, to @file{@var{file}.04.addressof}.
2711 @item g
2712 Dump after global register allocation, to @file{@var{file}.19.greg}.
2713 @item o
2714 Dump after post-reload CSE and other optimizations, to @file{@var{file}.20.postreload}.
2715 @item G
2716 Dump after GCSE, to @file{@var{file}.08.gcse}.
2717 @item i
2718 Dump after sibling call optimizations, to @file{@var{file}.01.sibling}.
2719 @item j
2720 Dump after the first jump optimization, to @file{@var{file}.02.jump}.
2721 @item J
2722 Dump after the last jump optimization, to @file{@var{file}.27.jump2}.
2723 @item k
2724 Dump after conversion from registers to stack, to @file{@var{file}.29.stack}.
2725 @item l
2726 Dump after local register allocation, to @file{@var{file}.18.lreg}.
2727 @item L
2728 Dump after loop optimization, to @file{@var{file}.09.loop}.
2729 @item M
2730 Dump after performing the machine dependent reorganisation pass, to
2731 @file{@var{file}.28.mach}.
2732 @item n
2733 Dump after register renumbering, to @file{@var{file}.23.rnreg}.
2734 @item N
2735 Dump after the register move pass, to @file{@var{file}.16.regmove}.
2736 @item r
2737 Dump after RTL generation, to @file{@var{file}.00.rtl}.
2738 @item R
2739 Dump after the second instruction scheduling pass, to
2740 @file{@var{file}.25.sched2}.
2741 @item s
2742 Dump after CSE (including the jump optimization that sometimes follows
2743 CSE), to @file{@var{file}.03.cse}.
2744 @item S
2745 Dump after the first instruction scheduling pass, to
2746 @file{@var{file}.17.sched}.
2747 @item t
2748 Dump after the second CSE pass (including the jump optimization that
2749 sometimes follows CSE), to @file{@var{file}.10.cse2}.
2750 @item w
2751 Dump after the second flow pass, to @file{@var{file}.21.flow2}.
2752 @item X
2753 Dump after dead code elimination, to @file{@var{file}.06.dce}.
2754 @item z
2755 Dump after the peephole pass, to @file{@var{file}.22.peephole2}.
2756 @item a
2757 Produce all the dumps listed above.
2758 @item m
2759 Print statistics on memory usage, at the end of the run, to
2760 standard error.
2761 @item p
2762 Annotate the assembler output with a comment indicating which
2763 pattern and alternative was used.  The length of each instruction is
2764 also printed.
2765 @item P
2766 Dump the RTL in the assembler output as a comment before each instruction.
2767 Also turns on @samp{-dp} annotation.
2768 @item v
2769 For each of the other indicated dump files (except for
2770 @file{@var{file}.00.rtl}), dump a representation of the control flow graph
2771 suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
2772 @item x
2773 Just generate RTL for a function instead of compiling it.  Usually used
2774 with @samp{r}.
2775 @item y
2776 Dump debugging information during parsing, to standard error.
2777 @end table
2778
2779 @item -fdump-unnumbered
2780 When doing debugging dumps (see -d option above), suppress instruction
2781 numbers and line number note output.  This makes it more feasible to
2782 use diff on debugging dumps for compiler invocations with different
2783 options, in particular with and without -g.
2784
2785 @item -fdump-translation-unit=@var{file} (C and C++ only)
2786 Dump a representation of the tree structure for the entire translation
2787 unit to @var{file}.
2788
2789 @item -fdump-class_layout=@var{file} (C++ only)
2790 @item -fdump-class_layout (C++ only)
2791 Dump a representation of each class's heirarchy to @var{file}, or
2792 @code{stderr} if not specified.
2793
2794 @item -fpretend-float
2795 When running a cross-compiler, pretend that the target machine uses the
2796 same floating point format as the host machine.  This causes incorrect
2797 output of the actual floating constants, but the actual instruction
2798 sequence will probably be the same as GCC would make when running on
2799 the target machine.
2800
2801 @item -save-temps
2802 Store the usual ``temporary'' intermediate files permanently; place them
2803 in the current directory and name them based on the source file.  Thus,
2804 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
2805 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
2806 preprocessed @file{foo.i} output file even though the compiler now
2807 normally uses an integrated preprocessor.
2808
2809 @item -time
2810 Report the CPU time taken by each subprocess in the compilation
2811 sequence.  For C source files, this is the compiler proper and assembler
2812 (plus the linker if linking is done).  The output looks like this:
2813
2814 @smallexample
2815 # cc1 0.12 0.01
2816 # as 0.00 0.01
2817 @end smallexample
2818
2819 The first number on each line is the ``user time,'' that is time spent
2820 executing the program itself.  The second number is ``system time,''
2821 time spent executing operating system routines on behalf of the program.
2822 Both numbers are in seconds.
2823
2824 @item -print-file-name=@var{library}
2825 Print the full absolute name of the library file @var{library} that
2826 would be used when linking---and don't do anything else.  With this
2827 option, GCC does not compile or link anything; it just prints the
2828 file name.
2829
2830 @item -print-prog-name=@var{program}
2831 Like @samp{-print-file-name}, but searches for a program such as @samp{cpp}.
2832
2833 @item -print-libgcc-file-name
2834 Same as @samp{-print-file-name=libgcc.a}.
2835
2836 This is useful when you use @samp{-nostdlib} or @samp{-nodefaultlibs}
2837 but you do want to link with @file{libgcc.a}.  You can do
2838
2839 @example
2840 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
2841 @end example
2842
2843 @item -print-search-dirs
2844 Print the name of the configured installation directory and a list of
2845 program and library directories gcc will search---and don't do anything else.
2846
2847 This is useful when gcc prints the error message
2848 @samp{installation problem, cannot exec cpp0: No such file or directory}.
2849 To resolve this you either need to put @file{cpp0} and the other compiler
2850 components where gcc expects to find them, or you can set the environment
2851 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
2852 Don't forget the trailing '/'.
2853 @xref{Environment Variables}.
2854
2855 @item -dumpmachine
2856 Print the compiler's target machine (for example,
2857 @samp{i686-pc-linux-gnu})---and don't do anything else.
2858
2859 @item -dumpversion
2860 Print the compiler version (for example, @samp{3.0})---and don't do
2861 anything else.
2862
2863 @item -dumpspecs
2864 Print the compiler's built-in specs---and don't do anything else.  (This
2865 is used when GCC itself is being built.)  @xref{Spec Files}.
2866 @end table
2867
2868 @node Optimize Options
2869 @section Options That Control Optimization
2870 @cindex optimize options
2871 @cindex options, optimization
2872
2873 These options control various sorts of optimizations:
2874
2875 @table @gcctabopt
2876 @item -O
2877 @itemx -O1
2878 Optimize.  Optimizing compilation takes somewhat more time, and a lot
2879 more memory for a large function.
2880
2881 Without @samp{-O}, the compiler's goal is to reduce the cost of
2882 compilation and to make debugging produce the expected results.
2883 Statements are independent: if you stop the program with a breakpoint
2884 between statements, you can then assign a new value to any variable or
2885 change the program counter to any other statement in the function and
2886 get exactly the results you would expect from the source code.
2887
2888 Without @samp{-O}, the compiler only allocates variables declared
2889 @code{register} in registers.  The resulting compiled code is a little
2890 worse than produced by PCC without @samp{-O}.
2891
2892 With @samp{-O}, the compiler tries to reduce code size and execution
2893 time.
2894
2895 When you specify @samp{-O}, the compiler turns on @samp{-fthread-jumps}
2896 and @samp{-fdefer-pop} on all machines.  The compiler turns on
2897 @samp{-fdelayed-branch} on machines that have delay slots, and
2898 @samp{-fomit-frame-pointer} on machines that can support debugging even
2899 without a frame pointer.  On some machines the compiler also turns
2900 on other flags.@refill
2901
2902 @item -O2
2903 Optimize even more.  GCC performs nearly all supported optimizations
2904 that do not involve a space-speed tradeoff.  The compiler does not
2905 perform loop unrolling or function inlining when you specify @samp{-O2}.
2906 As compared to @samp{-O}, this option increases both compilation time
2907 and the performance of the generated code.
2908
2909 @samp{-O2} turns on all optional optimizations except for loop unrolling,
2910 function inlining, and register renaming.  It also turns on the
2911 @samp{-fforce-mem} option on all machines and frame pointer elimination
2912 on machines where doing so does not interfere with debugging.
2913
2914 @item -O3
2915 Optimize yet more.  @samp{-O3} turns on all optimizations specified by
2916 @samp{-O2} and also turns on the @samp{-finline-functions} and
2917 @samp{-frename-registers} options.
2918
2919 @item -O0
2920 Do not optimize.
2921
2922 @item -Os
2923 Optimize for size.  @samp{-Os} enables all @samp{-O2} optimizations that
2924 do not typically increase code size.  It also performs further
2925 optimizations designed to reduce code size.
2926
2927 If you use multiple @samp{-O} options, with or without level numbers,
2928 the last such option is the one that is effective.
2929 @end table
2930
2931 Options of the form @samp{-f@var{flag}} specify machine-independent
2932 flags.  Most flags have both positive and negative forms; the negative
2933 form of @samp{-ffoo} would be @samp{-fno-foo}.  In the table below,
2934 only one of the forms is listed---the one which is not the default.
2935 You can figure out the other form by either removing @samp{no-} or
2936 adding it.
2937
2938 @table @gcctabopt
2939 @item -ffloat-store
2940 Do not store floating point variables in registers, and inhibit other
2941 options that might change whether a floating point value is taken from a
2942 register or memory.
2943
2944 @cindex floating point precision
2945 This option prevents undesirable excess precision on machines such as
2946 the 68000 where the floating registers (of the 68881) keep more
2947 precision than a @code{double} is supposed to have.  Similarly for the
2948 x86 architecture.  For most programs, the excess precision does only
2949 good, but a few programs rely on the precise definition of IEEE floating
2950 point.  Use @samp{-ffloat-store} for such programs, after modifying
2951 them to store all pertinent intermediate computations into variables.
2952
2953 @item -fno-default-inline
2954 Do not make member functions inline by default merely because they are
2955 defined inside the class scope (C++ only).  Otherwise, when you specify
2956 @w{@samp{-O}}, member functions defined inside class scope are compiled
2957 inline by default; i.e., you don't need to add @samp{inline} in front of
2958 the member function name.
2959
2960 @item -fno-defer-pop
2961 Always pop the arguments to each function call as soon as that function
2962 returns.  For machines which must pop arguments after a function call,
2963 the compiler normally lets arguments accumulate on the stack for several
2964 function calls and pops them all at once.
2965
2966 @item -fforce-mem
2967 Force memory operands to be copied into registers before doing
2968 arithmetic on them.  This produces better code by making all memory
2969 references potential common subexpressions.  When they are not common
2970 subexpressions, instruction combination should eliminate the separate
2971 register-load.  The @samp{-O2} option turns on this option.
2972
2973 @item -fforce-addr
2974 Force memory address constants to be copied into registers before
2975 doing arithmetic on them.  This may produce better code just as
2976 @samp{-fforce-mem} may.
2977
2978 @item -fomit-frame-pointer
2979 Don't keep the frame pointer in a register for functions that
2980 don't need one.  This avoids the instructions to save, set up and
2981 restore frame pointers; it also makes an extra register available
2982 in many functions.  @strong{It also makes debugging impossible on
2983 some machines.}
2984
2985 @ifset INTERNALS
2986 On some machines, such as the Vax, this flag has no effect, because
2987 the standard calling sequence automatically handles the frame pointer
2988 and nothing is saved by pretending it doesn't exist.  The
2989 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
2990 whether a target machine supports this flag.  @xref{Registers}.@refill
2991 @end ifset
2992 @ifclear INTERNALS
2993 On some machines, such as the Vax, this flag has no effect, because
2994 the standard calling sequence automatically handles the frame pointer
2995 and nothing is saved by pretending it doesn't exist.  The
2996 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
2997 whether a target machine supports this flag.  @xref{Registers,,Register
2998 Usage, gcc.info, Using and Porting GCC}.@refill
2999 @end ifclear
3000
3001 @item -foptimize-sibling-calls
3002 Optimize sibling and tail recursive calls.
3003
3004 @item -ftrapv
3005 This option generates traps for signed overflow on addition, subtraction,
3006 multiplication operations.
3007
3008 @item -fno-inline
3009 Don't pay attention to the @code{inline} keyword.  Normally this option
3010 is used to keep the compiler from expanding any functions inline.
3011 Note that if you are not optimizing, no functions can be expanded inline.
3012
3013 @item -finline-functions
3014 Integrate all simple functions into their callers.  The compiler
3015 heuristically decides which functions are simple enough to be worth
3016 integrating in this way.
3017
3018 If all calls to a given function are integrated, and the function is
3019 declared @code{static}, then the function is normally not output as
3020 assembler code in its own right.
3021
3022 @item -finline-limit=@var{n}
3023 By default, gcc limits the size of functions that can be inlined.  This flag
3024 allows the control of this limit for functions that are explicitly marked as
3025 inline (ie marked with the inline keyword or defined within the class
3026 definition in c++).  @var{n} is the size of functions that can be inlined in
3027 number of pseudo instructions (not counting parameter handling).  The default
3028 value of n is 10000.  Increasing this value can result in more inlined code at
3029 the cost of compilation time and memory consumption.  Decreasing usually makes
3030 the compilation faster and less code will be inlined (which presumably
3031 means slower programs).  This option is particularly useful for programs that
3032 use inlining heavily such as those based on recursive templates with c++.
3033
3034 @emph{Note:} pseudo instruction represents, in this particular context, an
3035 abstract measurement of function's size.  In no way, it represents a count
3036 of assembly instructions and as such its exact meaning might change from one
3037 release to an another.
3038
3039 @item -fkeep-inline-functions
3040 Even if all calls to a given function are integrated, and the function
3041 is declared @code{static}, nevertheless output a separate run-time
3042 callable version of the function.  This switch does not affect
3043 @code{extern inline} functions.
3044
3045 @item -fkeep-static-consts
3046 Emit variables declared @code{static const} when optimization isn't turned
3047 on, even if the variables aren't referenced.
3048
3049 GCC enables this option by default.  If you want to force the compiler to
3050 check if the variable was referenced, regardless of whether or not
3051 optimization is turned on, use the @samp{-fno-keep-static-consts} option.
3052
3053 @item -fno-function-cse
3054 Do not put function addresses in registers; make each instruction that
3055 calls a constant function contain the function's address explicitly.
3056
3057 This option results in less efficient code, but some strange hacks
3058 that alter the assembler output may be confused by the optimizations
3059 performed when this option is not used.
3060
3061 @item -ffast-math
3062 Sets @samp{-fno-math-errno}, @samp{-funsafe-math-optimizations},
3063 and @samp{-fno-trapping-math}.
3064
3065 This option causes the preprocessor macro __FAST_MATH__ to be defined.
3066
3067 This option should never be turned on by any @samp{-O} option since
3068 it can result in incorrect output for programs which depend on
3069 an exact implementation of IEEE or ISO rules/specifications for
3070 math functions.
3071
3072 @item -fno-math-errno
3073 Do not set ERRNO after calling math functions that are executed
3074 with a single instruction, e.g., sqrt.  A program that relies on
3075 IEEE exceptions for math error handling may want to use this flag
3076 for speed while maintaining IEEE arithmetic compatibility.
3077
3078 This option should never be turned on by any @samp{-O} option since
3079 it can result in incorrect output for programs which depend on
3080 an exact implementation of IEEE or ISO rules/specifications for
3081 math functions.
3082
3083 The default is @samp{-fmath-errno}.  The @samp{-ffast-math} option
3084 sets @samp{-fno-math-errno}.
3085
3086 @item -funsafe-math-optimizations
3087 Allow optimizations for floating-point arithmetic that (a) assume
3088 that arguments and results are valid and (b) may violate IEEE or
3089 ANSI standards.
3090
3091 This option should never be turned on by any @samp{-O} option since
3092 it can result in incorrect output for programs which depend on
3093 an exact implementation of IEEE or ISO rules/specifications for
3094 math functions.
3095
3096 The default is @samp{-fno-unsafe-math-optimizations}.  The
3097 @samp{-ffast-math} option sets @samp{-funsafe-math-optimizations}.
3098
3099 @item -fno-trapping-math
3100 Compile code assuming that floating-point operations cannot generate
3101 user-visible traps.  Setting this option may allow faster code
3102 if one relies on ``non-stop'' IEEE arithmetic, for example.
3103
3104 This option should never be turned on by any @samp{-O} option since
3105 it can result in incorrect output for programs which depend on
3106 an exact implementation of IEEE or ISO rules/specifications for
3107 math functions.
3108
3109 The default is @samp{-ftrapping-math}.  The @samp{-ffast-math}
3110 option sets @samp{-fno-trapping-math}.
3111 @end table
3112
3113 @c following causes underfulls.. they don't look great, but we deal.
3114 @c --mew 26jan93
3115 The following options control specific optimizations.  The @samp{-O2}
3116 option turns on all of these optimizations except @samp{-funroll-loops}
3117 and @samp{-funroll-all-loops}.  On most machines, the @samp{-O} option
3118 turns on the @samp{-fthread-jumps} and @samp{-fdelayed-branch} options,
3119 but specific machines may handle it differently.
3120
3121 You can use the following flags in the rare cases when ``fine-tuning''
3122 of optimizations to be performed is desired.
3123
3124 @table @gcctabopt
3125 @item -fstrength-reduce
3126 Perform the optimizations of loop strength reduction and
3127 elimination of iteration variables.
3128
3129 @item -fthread-jumps
3130 Perform optimizations where we check to see if a jump branches to a
3131 location where another comparison subsumed by the first is found.  If
3132 so, the first branch is redirected to either the destination of the
3133 second branch or a point immediately following it, depending on whether
3134 the condition is known to be true or false.
3135
3136 @item -fcse-follow-jumps
3137 In common subexpression elimination, scan through jump instructions
3138 when the target of the jump is not reached by any other path.  For
3139 example, when CSE encounters an @code{if} statement with an
3140 @code{else} clause, CSE will follow the jump when the condition
3141 tested is false.
3142
3143 @item -fcse-skip-blocks
3144 This is similar to @samp{-fcse-follow-jumps}, but causes CSE to
3145 follow jumps which conditionally skip over blocks.  When CSE
3146 encounters a simple @code{if} statement with no else clause,
3147 @samp{-fcse-skip-blocks} causes CSE to follow the jump around the
3148 body of the @code{if}.
3149
3150 @item -frerun-cse-after-loop
3151 Re-run common subexpression elimination after loop optimizations has been
3152 performed.
3153
3154 @item -frerun-loop-opt
3155 Run the loop optimizer twice.
3156
3157 @item -fgcse
3158 Perform a global common subexpression elimination pass.
3159 This pass also performs global constant and copy propagation.
3160
3161 @item -fgcse-lm
3162 When -fgcse-lm is enabled, global common subexpression elimination will
3163 attempt to move loads which are only killed by stores into themselves. This
3164 allows a loop containing a load/store sequence to be changed to a load outside
3165 the loop, and a copy/store within the loop.
3166
3167 @item -fgcse-sm
3168 When -fgcse-sm is enabled, A store motion pass is run after global common
3169 subexpression elimination. This pass will attempt to move stores out of loops.
3170 When used in conjunction with -fgcse-lm, loops containing a load/store sequence
3171 can be changed to a load before the loop and a store after the loop.
3172
3173 @item -fdelete-null-pointer-checks
3174 Use global dataflow analysis to identify and eliminate useless null
3175 pointer checks.  Programs which rely on NULL pointer dereferences @emph{not}
3176 halting the program may not work properly with this option.  Use
3177 -fno-delete-null-pointer-checks to disable this optimizing for programs
3178 which depend on that behavior.
3179
3180 @item -fexpensive-optimizations
3181 Perform a number of minor optimizations that are relatively expensive.
3182
3183 @item -foptimize-register-move
3184 @itemx -fregmove
3185 Attempt to reassign register numbers in move instructions and as
3186 operands of other simple instructions in order to maximize the amount of
3187 register tying.  This is especially helpful on machines with two-operand
3188 instructions.  GCC enables this optimization by default with @samp{-O2}
3189 or higher.
3190
3191 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
3192 optimization.
3193
3194 @item -fdelayed-branch
3195 If supported for the target machine, attempt to reorder instructions
3196 to exploit instruction slots available after delayed branch
3197 instructions.
3198
3199 @item -fschedule-insns
3200 If supported for the target machine, attempt to reorder instructions to
3201 eliminate execution stalls due to required data being unavailable.  This
3202 helps machines that have slow floating point or memory load instructions
3203 by allowing other instructions to be issued until the result of the load
3204 or floating point instruction is required.
3205
3206 @item -fschedule-insns2
3207 Similar to @samp{-fschedule-insns}, but requests an additional pass of
3208 instruction scheduling after register allocation has been done.  This is
3209 especially useful on machines with a relatively small number of
3210 registers and where memory load instructions take more than one cycle.
3211
3212 @item -ffunction-sections
3213 @itemx -fdata-sections
3214 Place each function or data item into its own section in the output
3215 file if the target supports arbitrary sections.  The name of the
3216 function or the name of the data item determines the section's name
3217 in the output file.
3218
3219 Use these options on systems where the linker can perform optimizations
3220 to improve locality of reference in the instruction space.  HPPA
3221 processors running HP-UX and Sparc processors running Solaris 2 have
3222 linkers with such optimizations.  Other systems using the ELF object format
3223 as well as AIX may have these optimizations in the future.
3224
3225 Only use these options when there are significant benefits from doing
3226 so.  When you specify these options, the assembler and linker will
3227 create larger object and executable files and will also be slower.
3228 You will not be able to use @code{gprof} on all systems if you
3229 specify this option and you may have problems with debugging if
3230 you specify both this option and @samp{-g}.
3231
3232 @item -fcaller-saves
3233 Enable values to be allocated in registers that will be clobbered by
3234 function calls, by emitting extra instructions to save and restore the
3235 registers around such calls.  Such allocation is done only when it
3236 seems to result in better code than would otherwise be produced.
3237
3238 This option is always enabled by default on certain machines, usually
3239 those which have no call-preserved registers to use instead.
3240
3241 For all machines, optimization level 2 and higher enables this flag by
3242 default.
3243
3244 @item -funroll-loops
3245 Perform the optimization of loop unrolling.  This is only done for loops
3246 whose number of iterations can be determined at compile time or run time.
3247 @samp{-funroll-loops} implies both @samp{-fstrength-reduce} and
3248 @samp{-frerun-cse-after-loop}.
3249
3250 @item -funroll-all-loops
3251 Perform the optimization of loop unrolling.  This is done for all loops
3252 and usually makes programs run more slowly.  @samp{-funroll-all-loops}
3253 implies @samp{-fstrength-reduce} as well as @samp{-frerun-cse-after-loop}.
3254
3255 @item -fmove-all-movables
3256 Forces all invariant computations in loops to be moved
3257 outside the loop.
3258
3259 @item -freduce-all-givs
3260 Forces all general-induction variables in loops to be
3261 strength-reduced.
3262
3263 @emph{Note:} When compiling programs written in Fortran,
3264 @samp{-fmove-all-movables} and @samp{-freduce-all-givs} are enabled
3265 by default when you use the optimizer.
3266
3267 These options may generate better or worse code; results are highly
3268 dependent on the structure of loops within the source code.
3269
3270 These two options are intended to be removed someday, once
3271 they have helped determine the efficacy of various
3272 approaches to improving loop optimizations.
3273
3274 Please let us (@w{@email{gcc@@gcc.gnu.org}} and @w{@email{fortran@@gnu.org}})
3275 know how use of these options affects
3276 the performance of your production code.
3277 We're very interested in code that runs @emph{slower}
3278 when these options are @emph{enabled}.
3279
3280 @item -fno-peephole
3281 Disable any machine-specific peephole optimizations.
3282
3283 @item -fbranch-probabilities
3284 After running a program compiled with @samp{-fprofile-arcs}
3285 (@pxref{Debugging Options,, Options for Debugging Your Program or
3286 @command{gcc}}), you can compile it a second time using
3287 @samp{-fbranch-probabilities}, to improve optimizations based on
3288 guessing the path a branch might take.
3289
3290 @ifset INTERNALS
3291 With @samp{-fbranch-probabilities}, GCC puts a @samp{REG_EXEC_COUNT}
3292 note on the first instruction of each basic block, and a
3293 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
3294 These can be used to improve optimization.  Currently, they are only
3295 used in one place: in @file{reorg.c}, instead of guessing which path a
3296 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
3297 exactly determine which path is taken more often.
3298 @end ifset
3299
3300 @item -fno-guess-branch-probability
3301 Sometimes gcc will opt to guess branch probabilities when none are
3302 available from either profile directed feedback (@samp{-fprofile-arcs})
3303 or @samp{__builtin_expect}.  In a hard real-time system, people don't
3304 want different runs of the compiler to produce code that has different
3305 behavior; minimizing non-determinism is of paramount import.  This
3306 switch allows users to reduce non-determinism, possibly at the expense
3307 of inferior optimization.
3308
3309 @item -fstrict-aliasing
3310 Allows the compiler to assume the strictest aliasing rules applicable to
3311 the language being compiled.  For C (and C++), this activates
3312 optimizations based on the type of expressions.  In particular, an
3313 object of one type is assumed never to reside at the same address as an
3314 object of a different type, unless the types are almost the same.  For
3315 example, an @code{unsigned int} can alias an @code{int}, but not a
3316 @code{void*} or a @code{double}.  A character type may alias any other
3317 type.
3318
3319 Pay special attention to code like this:
3320 @example
3321 union a_union @{
3322   int i;
3323   double d;
3324 @};
3325
3326 int f() @{
3327   a_union t;
3328   t.d = 3.0;
3329   return t.i;
3330 @}
3331 @end example
3332 The practice of reading from a different union member than the one most
3333 recently written to (called ``type-punning'') is common.  Even with
3334 @samp{-fstrict-aliasing}, type-punning is allowed, provided the memory
3335 is accessed through the union type.  So, the code above will work as
3336 expected.  However, this code might not:
3337 @example
3338 int f() @{
3339   a_union t;
3340   int* ip;
3341   t.d = 3.0;
3342   ip = &t.i;
3343   return *ip;
3344 @}
3345 @end example
3346
3347 @ifset INTERNALS
3348 Every language that wishes to perform language-specific alias analysis
3349 should define a function that computes, given an @code{tree}
3350 node, an alias set for the node.  Nodes in different alias sets are not
3351 allowed to alias.  For an example, see the C front-end function
3352 @code{c_get_alias_set}.
3353 @end ifset
3354
3355 @item -falign-functions
3356 @itemx -falign-functions=@var{n}
3357 Align the start of functions to the next power-of-two greater than
3358 @var{n}, skipping up to @var{n} bytes.  For instance,
3359 @samp{-falign-functions=32} aligns functions to the next 32-byte
3360 boundary, but @samp{-falign-functions=24} would align to the next
3361 32-byte boundary only if this can be done by skipping 23 bytes or less.
3362
3363 @samp{-fno-align-functions} and @samp{-falign-functions=1} are
3364 equivalent and mean that functions will not be aligned.
3365
3366 Some assemblers only support this flag when @var{n} is a power of two;
3367 in that case, it is rounded up.
3368
3369 If @var{n} is not specified, use a machine-dependent default.
3370
3371 @item -falign-labels
3372 @itemx -falign-labels=@var{n}
3373 Align all branch targets to a power-of-two boundary, skipping up to
3374 @var{n} bytes like @samp{-falign-functions}.  This option can easily
3375 make code slower, because it must insert dummy operations for when the
3376 branch target is reached in the usual flow of the code.
3377
3378 If @samp{-falign-loops} or @samp{-falign-jumps} are applicable and
3379 are greater than this value, then their values are used instead.
3380
3381 If @var{n} is not specified, use a machine-dependent default which is
3382 very likely to be @samp{1}, meaning no alignment.
3383
3384 @item -falign-loops
3385 @itemx -falign-loops=@var{n}
3386 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
3387 like @samp{-falign-functions}.  The hope is that the loop will be
3388 executed many times, which will make up for any execution of the dummy
3389 operations.
3390
3391 If @var{n} is not specified, use a machine-dependent default.
3392
3393 @item -falign-jumps
3394 @itemx -falign-jumps=@var{n}
3395 Align branch targets to a power-of-two boundary, for branch targets
3396 where the targets can only be reached by jumping, skipping up to @var{n}
3397 bytes like @samp{-falign-functions}.  In this case, no dummy operations
3398 need be executed.
3399
3400 If @var{n} is not specified, use a machine-dependent default.
3401
3402 @item -fssa
3403 Perform optimizations in static single assignment form.  Each function's
3404 flow graph is translated into SSA form, optimizations are performed, and
3405 the flow graph is translated back from SSA form.  Users should not
3406 specify this option, since it is not yet ready for production use.
3407
3408 @item -fdce
3409 Perform dead-code elimination in SSA form.  Requires @samp{-fssa}.  Like
3410 @samp{-fssa}, this is an experimental feature.
3411
3412 @item -fsingle-precision-constant
3413 Treat floating point constant as single precision constant instead of
3414 implicitly converting it to double precision constant.
3415
3416 @item -frename-registers
3417 Attempt to avoid false dependancies in scheduled code by making use
3418 of registers left over after register allocation.  This optimization
3419 will most benefit processors with lots of registers.  It can, however,
3420 make debugging impossible, since variables will no longer stay in
3421 a ``home register''.
3422
3423 @item --param @var{name}=@var{value}
3424 In some places, GCC uses various constants to control the amount of
3425 optimization that is done.  For example, GCC will not inline functions
3426 that contain more that a certain number of instructions.  You can
3427 control some of these constants on the command-line using the
3428 @samp{--param} option.
3429
3430 In each case, the @var{value} is a integer.  The allowable choices for
3431 @var{name} are given in the following table:
3432
3433 @table @gcctabopt
3434 @item max-delay-slot-insn-search
3435 The maximum number of instructions to consider when looking for an
3436 instruction to fill a delay slot.  If more than this arbitrary number of
3437 instructions is searched, the time savings from filling the delay slot
3438 will be minimal so stop searching.  Increasing values mean more
3439 aggressive optimization, making the compile time increase with probably
3440 small improvement in executable run time.
3441
3442 @item max-delay-slot-live-search
3443 When trying to fill delay slots, the maximum number of instructions to
3444 consider when searching for a block with valid live register
3445 information.  Increasing this arbitrarily chosen value means more
3446 aggressive optimization, increasing the compile time.  This parameter
3447 should be removed when the delay slot code is rewritten to maintain the
3448 control-flow graph.
3449
3450 @item max-gcse-memory
3451 The approximate maximum amount of memory that will be allocated in
3452 order to perform the global common subexpression elimination
3453 optimization.  If more memory than specified is required, the
3454 optimization will not be done.
3455
3456 @item max-inline-insns
3457 If an function contains more than this many instructions, it
3458 will not be inlined.  This option is precisely equivalent to
3459 @samp{-finline-limit}.
3460
3461 @end table
3462 @end table
3463
3464 @node Preprocessor Options
3465 @section Options Controlling the Preprocessor
3466 @cindex preprocessor options
3467 @cindex options, preprocessor
3468
3469 These options control the C preprocessor, which is run on each C source
3470 file before actual compilation.
3471
3472 If you use the @samp{-E} option, nothing is done except preprocessing.
3473 Some of these options make sense only together with @samp{-E} because
3474 they cause the preprocessor output to be unsuitable for actual
3475 compilation.
3476
3477 @table @gcctabopt
3478 @item -include @var{file}
3479 Process @var{file} as input before processing the regular input file.
3480 In effect, the contents of @var{file} are compiled first.  Any @samp{-D}
3481 and @samp{-U} options on the command line are always processed before
3482 @samp{-include @var{file}}, regardless of the order in which they are
3483 written.  All the @samp{-include} and @samp{-imacros} options are
3484 processed in the order in which they are written.
3485
3486 @item -imacros @var{file}
3487 Process @var{file} as input, discarding the resulting output, before
3488 processing the regular input file.  Because the output generated from
3489 @var{file} is discarded, the only effect of @samp{-imacros @var{file}}
3490 is to make the macros defined in @var{file} available for use in the
3491 main input.  All the @samp{-include} and @samp{-imacros} options are
3492 processed in the order in which they are written.
3493
3494 @item -idirafter @var{dir}
3495 @cindex second include path
3496 Add the directory @var{dir} to the second include path.  The directories
3497 on the second include path are searched when a header file is not found
3498 in any of the directories in the main include path (the one that
3499 @samp{-I} adds to).
3500
3501 @item -iprefix @var{prefix}
3502 Specify @var{prefix} as the prefix for subsequent @samp{-iwithprefix}
3503 options.
3504
3505 @item -iwithprefix @var{dir}
3506 Add a directory to the second include path.  The directory's name is
3507 made by concatenating @var{prefix} and @var{dir}, where @var{prefix} was
3508 specified previously with @samp{-iprefix}.  If you have not specified a
3509 prefix yet, the directory containing the installed passes of the
3510 compiler is used as the default.
3511
3512 @item -iwithprefixbefore @var{dir}
3513 Add a directory to the main include path.  The directory's name is made
3514 by concatenating @var{prefix} and @var{dir}, as in the case of
3515 @samp{-iwithprefix}.
3516
3517 @item -isystem @var{dir}
3518 Add a directory to the beginning of the second include path, marking it
3519 as a system directory, so that it gets the same special treatment as
3520 is applied to the standard system directories.
3521
3522 @item -nostdinc
3523 Do not search the standard system directories for header files.  Only
3524 the directories you have specified with @samp{-I} options (and the
3525 current directory, if appropriate) are searched.  @xref{Directory
3526 Options}, for information on @samp{-I}.
3527
3528 By using both @samp{-nostdinc} and @samp{-I-}, you can limit the include-file
3529 search path to only those directories you specify explicitly.
3530
3531 @item -remap
3532 @findex -remap
3533 When searching for a header file in a directory, remap file names if a
3534 file named @file{header.gcc} exists in that directory.  This can be used
3535 to work around limitations of file systems with file name restrictions.
3536 The @file{header.gcc} file should contain a series of lines with two
3537 tokens on each line: the first token is the name to map, and the second
3538 token is the actual name to use.
3539
3540 @item -undef
3541 Do not predefine any nonstandard macros.  (Including architecture flags).
3542
3543 @item -E
3544 Run only the C preprocessor.  Preprocess all the C source files
3545 specified and output the results to standard output or to the
3546 specified output file.
3547
3548 @item -C
3549 Tell the preprocessor not to discard comments.  Used with the
3550 @samp{-E} option.
3551
3552 @item -P
3553 Tell the preprocessor not to generate @samp{#line} directives.
3554 Used with the @samp{-E} option.
3555
3556 @cindex make
3557 @cindex dependencies, make
3558 @item -M
3559 @findex -M
3560 Instead of outputting the result of preprocessing, output a rule
3561 suitable for @code{make} describing the dependencies of the main source
3562 file.  The preprocessor outputs one @code{make} rule containing the
3563 object file name for that source file, a colon, and the names of all the
3564 included files.  Unless overridden explicitly, the object file name
3565 consists of the basename of the source file with any suffix replaced with
3566 object file suffix. If there are many included files then the
3567 rule is split into several lines using @samp{\}-newline.
3568
3569 @samp{-M} implies @samp{-E}.
3570
3571 @item -MM
3572 @findex -MM
3573 Like @samp{-M}, but mention only the files included with @samp{#include
3574 "@var{file}"}.  System header files included with @samp{#include
3575 <@var{file}>} are omitted.
3576
3577 @item -MD
3578 @findex -MD
3579 Like @samp{-M} but the dependency information is written to a file
3580 rather than stdout.  @code{gcc} will use the same file name and
3581 directory as the object file, but with the suffix ".d" instead.
3582
3583 This is in addition to compiling the main file as specified ---
3584 @samp{-MD} does not inhibit ordinary compilation the way @samp{-M} does,
3585 unless you also specify @samp{-MG}.
3586
3587 With Mach, you can use the utility @code{md} to merge multiple
3588 dependency files into a single dependency file suitable for using with
3589 the @samp{make} command.
3590
3591 @item -MMD
3592 @findex -MMD
3593 Like @samp{-MD} except mention only user header files, not system
3594 -header files.
3595
3596 @item -MF @var{file}
3597 @findex -MF
3598 When used with @samp{-M} or @samp{-MM}, specifies a file to write the
3599 dependencies to.  This allows the preprocessor to write the preprocessed
3600 file to stdout normally.  If no @samp{-MF} switch is given, CPP sends
3601 the rules to stdout and suppresses normal preprocessed output.
3602
3603 Another way to specify output of a @code{make} rule is by setting
3604 the environment variable @env{DEPENDENCIES_OUTPUT} (@pxref{Environment
3605 Variables}).
3606
3607 @item -MG
3608 @findex -MG
3609 When used with @samp{-M} or @samp{-MM}, @samp{-MG} says to treat missing
3610 header files as generated files and assume they live in the same
3611 directory as the source file.  It suppresses preprocessed output, as a
3612 missing header file is ordinarily an error.
3613
3614 This feature is used in automatic updating of makefiles.
3615
3616 @item -MP
3617 @findex -MP
3618 This option instructs CPP to add a phony target for each dependency
3619 other than the main file, causing each to depend on nothing.  These
3620 dummy rules work around errors @code{make} gives if you remove header
3621 files without updating the @code{Makefile} to match.
3622
3623 This is typical output:-
3624
3625 @smallexample
3626 /tmp/test.o: /tmp/test.c /tmp/test.h
3627
3628 /tmp/test.h:
3629 @end smallexample
3630
3631 @item -MQ @var{target}
3632 @item -MT @var{target}
3633 @findex -MQ
3634 @findex -MT
3635 By default CPP uses the main file name, including any path, and appends
3636 the object suffix, normally ``.o'', to it to obtain the name of the
3637 target for dependency generation.  With @samp{-MT} you can specify a
3638 target yourself, overriding the default one.
3639
3640 If you want multiple targets, you can specify them as a single argument
3641 to @samp{-MT}, or use multiple @samp{-MT} options.
3642
3643 The targets you specify are output in the order they appear on the
3644 command line.  @samp{-MQ} is identical to @samp{-MT}, except that the
3645 target name is quoted for Make, but with @samp{-MT} it isn't.  For
3646 example, -MT '$(objpfx)foo.o' gives
3647
3648 @smallexample
3649 $(objpfx)foo.o: /tmp/foo.c
3650 @end smallexample
3651
3652 but -MQ '$(objpfx)foo.o' gives
3653
3654 @smallexample
3655 $$(objpfx)foo.o: /tmp/foo.c
3656 @end smallexample
3657
3658 The default target is automatically quoted, as if it were given with
3659 @samp{-MQ}.
3660
3661 @item -H
3662 Print the name of each header file used, in addition to other normal
3663 activities.
3664
3665 @item -A@var{question}(@var{answer})
3666 Assert the answer @var{answer} for @var{question}, in case it is tested
3667 with a preprocessing conditional such as @samp{#if
3668 #@var{question}(@var{answer})}.  @samp{-A-} disables the standard
3669 assertions that normally describe the target machine.
3670
3671 @item -D@var{macro}
3672 Define macro @var{macro} with the string @samp{1} as its definition.
3673
3674 @item -D@var{macro}=@var{defn}
3675 Define macro @var{macro} as @var{defn}.  All instances of @samp{-D} on
3676 the command line are processed before any @samp{-U} options.
3677
3678 Any @samp{-D} and @samp{-U} options on the command line are processed in
3679 order, and always before @samp{-imacros @var{file}}, regardless of the
3680 order in which they are written.
3681
3682 @item -U@var{macro}
3683 Undefine macro @var{macro}.  @samp{-U} options are evaluated after all
3684 @samp{-D} options, but before any @samp{-include} and @samp{-imacros}
3685 options.
3686
3687 Any @samp{-D} and @samp{-U} options on the command line are processed in
3688 order, and always before @samp{-imacros @var{file}}, regardless of the
3689 order in which they are written.
3690
3691 @item -dM
3692 Tell the preprocessor to output only a list of the macro definitions
3693 that are in effect at the end of preprocessing.  Used with the @samp{-E}
3694 option.
3695
3696 @item -dD
3697 Tell the preprocessing to pass all macro definitions into the output, in
3698 their proper sequence in the rest of the output.
3699
3700 @item -dN
3701 Like @samp{-dD} except that the macro arguments and contents are omitted.
3702 Only @samp{#define @var{name}} is included in the output.
3703
3704 @item -dI
3705 @findex -dI
3706 Output @samp{#include} directives in addition to the result of
3707 preprocessing.
3708
3709 @item -trigraphs
3710 @findex -trigraphs
3711 Process ISO standard trigraph sequences.  These are three-character
3712 sequences, all starting with @samp{??}, that are defined by ISO C to
3713 stand for single characters.  For example, @samp{??/} stands for
3714 @samp{\}, so @samp{'??/n'} is a character constant for a newline.  By
3715 default, GCC ignores trigraphs, but in standard-conforming modes it
3716 converts them.  See the @samp{-std} and @samp{-ansi} options.
3717
3718 The nine trigraph sequences are
3719 @table @samp
3720 @item ??(
3721 -> @samp{[}
3722
3723 @item ??)
3724 -> @samp{]}
3725
3726 @item ??<
3727 -> @samp{@{}
3728
3729 @item ??>
3730 -> @samp{@}}
3731
3732 @item ??=
3733 -> @samp{#}
3734
3735 @item ??/
3736 -> @samp{\}
3737
3738 @item ??'
3739 -> @samp{^}
3740
3741 @item ??!
3742 -> @samp{|}
3743
3744 @item ??-
3745 -> @samp{~}
3746
3747 @end table
3748
3749 Trigraph support is not popular, so many compilers do not implement it
3750 properly.  Portable code should not rely on trigraphs being either
3751 converted or ignored.
3752
3753 @item -Wp\,@var{option}
3754 Pass @var{option} as an option to the preprocessor.  If @var{option}
3755 contains commas, it is split into multiple options at the commas.
3756 @end table
3757
3758 @node Assembler Options
3759 @section Passing Options to the Assembler
3760
3761 @c prevent bad page break with this line
3762 You can pass options to the assembler.
3763
3764 @table @gcctabopt
3765 @item -Wa\,@var{option}
3766 Pass @var{option} as an option to the assembler.  If @var{option}
3767 contains commas, it is split into multiple options at the commas.
3768 @end table
3769
3770 @node Link Options
3771 @section Options for Linking
3772 @cindex link options
3773 @cindex options, linking
3774
3775 These options come into play when the compiler links object files into
3776 an executable output file.  They are meaningless if the compiler is
3777 not doing a link step.
3778
3779 @table @gcctabopt
3780 @cindex file names
3781 @item @var{object-file-name}
3782 A file name that does not end in a special recognized suffix is
3783 considered to name an object file or library.  (Object files are
3784 distinguished from libraries by the linker according to the file
3785 contents.)  If linking is done, these object files are used as input
3786 to the linker.
3787
3788 @item -c
3789 @itemx -S
3790 @itemx -E
3791 If any of these options is used, then the linker is not run, and
3792 object file names should not be used as arguments.  @xref{Overall
3793 Options}.
3794
3795 @cindex Libraries
3796 @item -l@var{library}
3797 @itemx -l @var{library}
3798 Search the library named @var{library} when linking.  (The second
3799 alternative with the library as a separate argument is only for
3800 POSIX compliance and is not recommended.)
3801
3802 It makes a difference where in the command you write this option; the
3803 linker searches and processes libraries and object files in the order they
3804 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
3805 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
3806 to functions in @samp{z}, those functions may not be loaded.
3807
3808 The linker searches a standard list of directories for the library,
3809 which is actually a file named @file{lib@var{library}.a}.  The linker
3810 then uses this file as if it had been specified precisely by name.
3811
3812 The directories searched include several standard system directories
3813 plus any that you specify with @samp{-L}.
3814
3815 Normally the files found this way are library files---archive files
3816 whose members are object files.  The linker handles an archive file by
3817 scanning through it for members which define symbols that have so far
3818 been referenced but not defined.  But if the file that is found is an
3819 ordinary object file, it is linked in the usual fashion.  The only
3820 difference between using an @samp{-l} option and specifying a file name
3821 is that @samp{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
3822 and searches several directories.
3823
3824 @item -lobjc
3825 You need this special case of the @samp{-l} option in order to
3826 link an Objective C program.
3827
3828 @item -nostartfiles
3829 Do not use the standard system startup files when linking.
3830 The standard system libraries are used normally, unless @option{-nostdlib}
3831 or @option{-nodefaultlibs} is used.
3832
3833 @item -nodefaultlibs
3834 Do not use the standard system libraries when linking.
3835 Only the libraries you specify will be passed to the linker.
3836 The standard startup files are used normally, unless @option{-nostartfiles}
3837 is used.  The compiler may generate calls to memcmp, memset, and memcpy
3838 for System V (and ISO C) environments or to bcopy and bzero for
3839 BSD environments.  These entries are usually resolved by entries in
3840 libc.  These entry points should be supplied through some other
3841 mechanism when this option is specified.
3842
3843 @item -nostdlib
3844 Do not use the standard system startup files or libraries when linking.
3845 No startup files and only the libraries you specify will be passed to
3846 the linker. The compiler may generate calls to memcmp, memset, and memcpy
3847 for System V (and ISO C) environments or to bcopy and bzero for
3848 BSD environments.  These entries are usually resolved by entries in
3849 libc.  These entry points should be supplied through some other
3850 mechanism when this option is specified.
3851
3852 @cindex @code{-lgcc}, use with @code{-nostdlib}
3853 @cindex @code{-nostdlib} and unresolved references
3854 @cindex unresolved references and @code{-nostdlib}
3855 @cindex @code{-lgcc}, use with @code{-nodefaultlibs}
3856 @cindex @code{-nodefaultlibs} and unresolved references
3857 @cindex unresolved references and @code{-nodefaultlibs}
3858 One of the standard libraries bypassed by @samp{-nostdlib} and
3859 @samp{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
3860 that GCC uses to overcome shortcomings of particular machines, or special
3861 needs for some languages.
3862 @ifset INTERNALS
3863 (@xref{Interface,,Interfacing to GCC Output}, for more discussion of
3864 @file{libgcc.a}.)
3865 @end ifset
3866 @ifclear INTERNALS
3867 (@xref{Interface,,Interfacing to GCC Output,gcc.info,Porting GCC},
3868 for more discussion of @file{libgcc.a}.)
3869 @end ifclear
3870 In most cases, you need @file{libgcc.a} even when you want to avoid
3871 other standard libraries.  In other words, when you specify @samp{-nostdlib}
3872 or @samp{-nodefaultlibs} you should usually specify @samp{-lgcc} as well.
3873 This ensures that you have no unresolved references to internal GCC
3874 library subroutines.  (For example, @samp{__main}, used to ensure C++
3875 constructors will be called; @pxref{Collect2,,@command{collect2}}.)
3876
3877 @item -s
3878 Remove all symbol table and relocation information from the executable.
3879
3880 @item -static
3881 On systems that support dynamic linking, this prevents linking with the shared
3882 libraries.  On other systems, this option has no effect.
3883
3884 @item -shared
3885 Produce a shared object which can then be linked with other objects to
3886 form an executable.  Not all systems support this option.  For predictable
3887 results, you must also specify the same set of options that were used to
3888 generate code (@samp{-fpic}, @samp{-fPIC}, or model suboptions)
3889 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
3890 needs to build supplementary stub code for constructors to work. On
3891 multi-libbed systems, @samp{gcc -shared} must select the correct support
3892 libraries to link against.  Failing to supply the correct flags may lead
3893 to subtle defects. Supplying them in cases where they are not necessary
3894 is innocuous.}
3895
3896 @item -shared-libgcc
3897 @itemx -static-libgcc
3898 On systems that provide @file{libgcc} as a shared library, these options
3899 force the use of either the shared or static version respectively.
3900 If no shared version of @file{libgcc} was built when the compiler was
3901 configured, these options have no effect.
3902
3903 There are several situations in which an application should use the
3904 shared @file{libgcc} instead of the static version.  The most common
3905 of these is when the application wishes to throw and catch exceptions
3906 across different shared libraries.  In that case, each of the libraries
3907 as well as the application itself should use the shared @file{libgcc}.
3908
3909 Therefore, whenever you specify the @samp{-shared} option, the GCC
3910 driver automatically adds @samp{-shared-libgcc}, unless you explicitly
3911 specify @samp{-static-libgcc}.  The G++ driver automatically adds
3912 @samp{-shared-libgcc} when you build a main executable as well because
3913 for C++ programs that is typically the right thing to do.
3914 (Exception-handling will not work reliably otherwise.)
3915
3916 However, when linking a main executable written in C, you must
3917 explicitly say @samp{-shared-libgcc} if you want to use the shared
3918 @file{libgcc}.
3919
3920 @item -symbolic
3921 Bind references to global symbols when building a shared object.  Warn
3922 about any unresolved references (unless overridden by the link editor
3923 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
3924 this option.
3925
3926 @item -Xlinker @var{option}
3927 Pass @var{option} as an option to the linker.  You can use this to
3928 supply system-specific linker options which GCC does not know how to
3929 recognize.
3930
3931 If you want to pass an option that takes an argument, you must use
3932 @samp{-Xlinker} twice, once for the option and once for the argument.
3933 For example, to pass @samp{-assert definitions}, you must write
3934 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
3935 @samp{-Xlinker "-assert definitions"}, because this passes the entire
3936 string as a single argument, which is not what the linker expects.
3937
3938 @item -Wl\,@var{option}
3939 Pass @var{option} as an option to the linker.  If @var{option} contains
3940 commas, it is split into multiple options at the commas.
3941
3942 @item -u @var{symbol}
3943 Pretend the symbol @var{symbol} is undefined, to force linking of
3944 library modules to define it.  You can use @samp{-u} multiple times with
3945 different symbols to force loading of additional library modules.
3946 @end table
3947
3948 @node Directory Options
3949 @section Options for Directory Search
3950 @cindex directory options
3951 @cindex options, directory search
3952 @cindex search path
3953
3954 These options specify directories to search for header files, for
3955 libraries and for parts of the compiler:
3956
3957 @table @gcctabopt
3958 @item -I@var{dir}
3959 Add the directory @var{dir} to the head of the list of directories to be
3960 searched for header files.  This can be used to override a system header
3961 file, substituting your own version, since these directories are
3962 searched before the system header file directories.  However, you should
3963 not use this option to add directories that contain vendor-supplied
3964 system header files (use @samp{-isystem} for that). If you use more than
3965 one @samp{-I} option, the directories are scanned in left-to-right
3966 order; the standard system directories come after.
3967
3968 @item -I-
3969 Any directories you specify with @samp{-I} options before the @samp{-I-}
3970 option are searched only for the case of @samp{#include "@var{file}"};
3971 they are not searched for @samp{#include <@var{file}>}.
3972
3973 If additional directories are specified with @samp{-I} options after
3974 the @samp{-I-}, these directories are searched for all @samp{#include}
3975 directives.  (Ordinarily @emph{all} @samp{-I} directories are used
3976 this way.)
3977
3978 In addition, the @samp{-I-} option inhibits the use of the current
3979 directory (where the current input file came from) as the first search
3980 directory for @samp{#include "@var{file}"}.  There is no way to
3981 override this effect of @samp{-I-}.  With @samp{-I.} you can specify
3982 searching the directory which was current when the compiler was
3983 invoked.  That is not exactly the same as what the preprocessor does
3984 by default, but it is often satisfactory.
3985
3986 @samp{-I-} does not inhibit the use of the standard system directories
3987 for header files.  Thus, @samp{-I-} and @samp{-nostdinc} are
3988 independent.
3989
3990 @item -L@var{dir}
3991 Add directory @var{dir} to the list of directories to be searched
3992 for @samp{-l}.
3993
3994 @item -B@var{prefix}
3995 This option specifies where to find the executables, libraries,
3996 include files, and data files of the compiler itself.
3997
3998 The compiler driver program runs one or more of the subprograms
3999 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
4000 @var{prefix} as a prefix for each program it tries to run, both with and
4001 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
4002
4003 For each subprogram to be run, the compiler driver first tries the
4004 @samp{-B} prefix, if any.  If that name is not found, or if @samp{-B}
4005 was not specified, the driver tries two standard prefixes, which are
4006 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc-lib/}.  If neither of
4007 those results in a file name that is found, the unmodified program
4008 name is searched for using the directories specified in your
4009 @env{PATH} environment variable.
4010
4011 @samp{-B} prefixes that effectively specify directory names also apply
4012 to libraries in the linker, because the compiler translates these
4013 options into @samp{-L} options for the linker.  They also apply to
4014 includes files in the preprocessor, because the compiler translates these
4015 options into @samp{-isystem} options for the preprocessor.  In this case,
4016 the compiler appends @samp{include} to the prefix.
4017
4018 The run-time support file @file{libgcc.a} can also be searched for using
4019 the @samp{-B} prefix, if needed.  If it is not found there, the two
4020 standard prefixes above are tried, and that is all.  The file is left
4021 out of the link if it is not found by those means.
4022
4023 Another way to specify a prefix much like the @samp{-B} prefix is to use
4024 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
4025 Variables}.
4026
4027 @item -specs=@var{file}
4028 Process @var{file} after the compiler reads in the standard @file{specs}
4029 file, in order to override the defaults that the @file{gcc} driver
4030 program uses when determining what switches to pass to @file{cc1},
4031 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
4032 @samp{-specs=}@var{file} can be specified on the command line, and they
4033 are processed in order, from left to right.
4034 @end table
4035
4036 @c man end
4037
4038 @node Spec Files
4039 @section Specifying subprocesses and the switches to pass to them
4040 @cindex Spec Files
4041 @command{gcc} is a driver program.  It performs its job by invoking a
4042 sequence of other programs to do the work of compiling, assembling and
4043 linking.  GCC interprets its command-line parameters and uses these to
4044 deduce which programs it should invoke, and which command-line options
4045 it ought to place on their command lines.  This behaviour is controlled
4046 by @dfn{spec strings}.  In most cases there is one spec string for each
4047 program that GCC can invoke, but a few programs have multiple spec
4048 strings to control their behaviour.  The spec strings built into GCC can
4049 be overridden by using the @samp{-specs=} command-line switch to specify
4050 a spec file.
4051
4052 @dfn{Spec files} are plaintext files that are used to construct spec
4053 strings.  They consist of a sequence of directives separated by blank
4054 lines.  The type of directive is determined by the first non-whitespace
4055 character on the line and it can be one of the following:
4056
4057 @table @code
4058 @item %@var{command}
4059 Issues a @var{command} to the spec file processor.  The commands that can
4060 appear here are:
4061
4062 @table @code
4063 @item %include <@var{file}>
4064 @cindex %include
4065 Search for @var{file} and insert its text at the current point in the
4066 specs file.
4067
4068 @item %include_noerr <@var{file}>
4069 @cindex %include_noerr
4070 Just like @samp{%include}, but do not generate an error message if the include
4071 file cannot be found.
4072
4073 @item %rename @var{old_name} @var{new_name}
4074 @cindex %rename
4075 Rename the spec string @var{old_name} to @var{new_name}.
4076
4077 @end table
4078
4079 @item *[@var{spec_name}]:
4080 This tells the compiler to create, override or delete the named spec
4081 string.  All lines after this directive up to the next directive or
4082 blank line are considered to be the text for the spec string.  If this
4083 results in an empty string then the spec will be deleted.  (Or, if the
4084 spec did not exist, then nothing will happened.)  Otherwise, if the spec
4085 does not currently exist a new spec will be created.  If the spec does
4086 exist then its contents will be overridden by the text of this
4087 directive, unless the first character of that text is the @samp{+}
4088 character, in which case the text will be appended to the spec.
4089
4090 @item [@var{suffix}]:
4091 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
4092 and up to the next directive or blank line are considered to make up the
4093 spec string for the indicated suffix.  When the compiler encounters an
4094 input file with the named suffix, it will processes the spec string in
4095 order to work out how to compile that file.  For example:
4096
4097 @smallexample
4098 .ZZ:
4099 z-compile -input %i
4100 @end smallexample
4101
4102 This says that any input file whose name ends in @samp{.ZZ} should be
4103 passed to the program @samp{z-compile}, which should be invoked with the
4104 command-line switch @samp{-input} and with the result of performing the
4105 @samp{%i} substitution.  (See below.)
4106
4107 As an alternative to providing a spec string, the text that follows a
4108 suffix directive can be one of the following:
4109
4110 @table @code
4111 @item @@@var{language}
4112 This says that the suffix is an alias for a known @var{language}.  This is
4113 similar to using the @option{-x} command-line switch to GCC to specify a
4114 language explicitly.  For example:
4115
4116 @smallexample
4117 .ZZ:
4118 @@c++
4119 @end smallexample
4120
4121 Says that .ZZ files are, in fact, C++ source files.
4122
4123 @item #@var{name}
4124 This causes an error messages saying:
4125
4126 @smallexample
4127 @var{name} compiler not installed on this system.
4128 @end smallexample
4129 @end table
4130
4131 GCC already has an extensive list of suffixes built into it.
4132 This directive will add an entry to the end of the list of suffixes, but
4133 since the list is searched from the end backwards, it is effectively
4134 possible to override earlier entries using this technique.
4135
4136 @end table
4137
4138 GCC has the following spec strings built into it.  Spec files can
4139 override these strings or create their own.  Note that individual
4140 targets can also add their own spec strings to this list.
4141
4142 @smallexample
4143 asm          Options to pass to the assembler
4144 asm_final    Options to pass to the assembler post-processor
4145 cpp          Options to pass to the C preprocessor
4146 cc1          Options to pass to the C compiler
4147 cc1plus      Options to pass to the C++ compiler
4148 endfile      Object files to include at the end of the link
4149 link         Options to pass to the linker
4150 lib          Libraries to include on the command line to the linker
4151 libgcc       Decides which GCC support library to pass to the linker
4152 linker       Sets the name of the linker
4153 predefines   Defines to be passed to the C preprocessor
4154 signed_char  Defines to pass to CPP to say whether @code{char} is signed by default
4155 startfile    Object files to include at the start of the link
4156 @end smallexample
4157
4158 Here is a small example of a spec file:
4159
4160 @smallexample
4161 %rename lib                 old_lib
4162
4163 *lib:
4164 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
4165 @end smallexample
4166
4167 This example renames the spec called @samp{lib} to @samp{old_lib} and
4168 then overrides the previous definition of @samp{lib} with a new one.
4169 The new definition adds in some extra command-line options before
4170 including the text of the old definition.
4171
4172 @dfn{Spec strings} are a list of command-line options to be passed to their
4173 corresponding program.  In addition, the spec strings can contain
4174 @samp{%}-prefixed sequences to substitute variable text or to
4175 conditionally insert text into the command line.  Using these constructs
4176 it is possible to generate quite complex command lines.
4177
4178 Here is a table of all defined @samp{%}-sequences for spec
4179 strings.  Note that spaces are not generated automatically around the
4180 results of expanding these sequences.  Therefore you can concatenate them
4181 together or combine them with constant text in a single argument.
4182
4183 @table @code
4184 @item %%
4185 Substitute one @samp{%} into the program name or argument.
4186
4187 @item %i
4188 Substitute the name of the input file being processed.
4189
4190 @item %b
4191 Substitute the basename of the input file being processed.
4192 This is the substring up to (and not including) the last period
4193 and not including the directory.
4194
4195 @item %B
4196 This is the same as @samp{%b}, but include the file suffix (text after
4197 the last period).
4198
4199 @item %d
4200 Marks the argument containing or following the @samp{%d} as a
4201 temporary file name, so that that file will be deleted if GCC exits
4202 successfully.  Unlike @samp{%g}, this contributes no text to the
4203 argument.
4204
4205 @item %g@var{suffix}
4206 Substitute a file name that has suffix @var{suffix} and is chosen
4207 once per compilation, and mark the argument in the same way as
4208 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
4209 name is now chosen in a way that is hard to predict even when previously
4210 chosen file names are known.  For example, @samp{%g.s ... %g.o ... %g.s}
4211 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
4212 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
4213 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
4214 was simply substituted with a file name chosen once per compilation,
4215 without regard to any appended suffix (which was therefore treated
4216 just like ordinary text), making such attacks more likely to succeed.
4217
4218 @item %u@var{suffix}
4219 Like @samp{%g}, but generates a new temporary file name even if
4220 @samp{%u@var{suffix}} was already seen.
4221
4222 @item %U@var{suffix}
4223 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
4224 new one if there is no such last file name.  In the absence of any
4225 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
4226 the same suffix @emph{space}, so @samp{%g.s ... %U.s ... %g.s ... %U.s}
4227 would involve the generation of two distinct file names, one
4228 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
4229 simply substituted with a file name chosen for the previous @samp{%u},
4230 without regard to any appended suffix.
4231
4232 @item %j@var{SUFFIX}
4233 Substitutes the name of the HOST_BIT_BUCKET, if any, and if it is
4234 writable, and if save-temps is off; otherwise, substitute the name
4235 of a temporary file, just like @samp{%u}.  This temporary file is not
4236 meant for communication between processes, but rather as a junk
4237 disposal mechanism.
4238
4239 @item %.@var{SUFFIX}
4240 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
4241 when it is subsequently output with @samp{%*}. @var{SUFFIX} is
4242 terminated by the next space or %.
4243
4244 @item %w
4245 Marks the argument containing or following the @samp{%w} as the
4246 designated output file of this compilation.  This puts the argument
4247 into the sequence of arguments that @samp{%o} will substitute later.
4248
4249 @item %o
4250 Substitutes the names of all the output files, with spaces
4251 automatically placed around them.  You should write spaces
4252 around the @samp{%o} as well or the results are undefined.
4253 @samp{%o} is for use in the specs for running the linker.
4254 Input files whose names have no recognized suffix are not compiled
4255 at all, but they are included among the output files, so they will
4256 be linked.
4257
4258 @item %O
4259 Substitutes the suffix for object files.  Note that this is
4260 handled specially when it immediately follows @samp{%g, %u, or %U},
4261 because of the need for those to form complete file names.  The
4262 handling is such that @samp{%O} is treated exactly as if it had already
4263 been substituted, except that @samp{%g, %u, and %U} do not currently
4264 support additional @var{suffix} characters following @samp{%O} as they would
4265 following, for example, @samp{.o}.
4266
4267 @item %p
4268 Substitutes the standard macro predefinitions for the
4269 current target machine.  Use this when running @code{cpp}.
4270
4271 @item %P
4272 Like @samp{%p}, but puts @samp{__} before and after the name of each
4273 predefined macro, except for macros that start with @samp{__} or with
4274 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
4275 C.
4276
4277 @item %I
4278 Substitute a @samp{-iprefix} option made from GCC_EXEC_PREFIX.
4279
4280 @item %s
4281 Current argument is the name of a library or startup file of some sort.
4282 Search for that file in a standard list of directories and substitute
4283 the full name found.
4284
4285 @item %e@var{str}
4286 Print @var{str} as an error message.  @var{str} is terminated by a newline.
4287 Use this when inconsistent options are detected.
4288
4289 @item %|
4290 Output @samp{-} if the input for the current command is coming from a pipe.
4291
4292 @item %(@var{name})
4293 Substitute the contents of spec string @var{name} at this point.
4294
4295 @item %[@var{name}]
4296 Like @samp{%(...)} but put @samp{__} around @samp{-D} arguments.
4297
4298 @item %x@{@var{option}@}
4299 Accumulate an option for @samp{%X}.
4300
4301 @item %X
4302 Output the accumulated linker options specified by @samp{-Wl} or a @samp{%x}
4303 spec string.
4304
4305 @item %Y
4306 Output the accumulated assembler options specified by @samp{-Wa}.
4307
4308 @item %Z
4309 Output the accumulated preprocessor options specified by @samp{-Wp}.
4310
4311 @item %v1
4312 Substitute the major version number of GCC.
4313 (For version 2.9.5, this is 2.)
4314
4315 @item %v2
4316 Substitute the minor version number of GCC.
4317 (For version 2.9.5, this is 9.)
4318
4319 @item %v3
4320 Substitute the patch level number of GCC.
4321 (For version 2.9.5, this is 5.)
4322
4323 @item %a
4324 Process the @code{asm} spec.  This is used to compute the
4325 switches to be passed to the assembler.
4326
4327 @item %A
4328 Process the @code{asm_final} spec.  This is a spec string for
4329 passing switches to an assembler post-processor, if such a program is
4330 needed.
4331
4332 @item %l
4333 Process the @code{link} spec.  This is the spec for computing the
4334 command line passed to the linker.  Typically it will make use of the
4335 @samp{%L %G %S %D and %E} sequences.
4336
4337 @item %D
4338 Dump out a @samp{-L} option for each directory that GCC believes might
4339 contain startup files.  If the target supports multilibs then the
4340 current multilib directory will be prepended to each of these paths.
4341
4342 @item %M
4343 Output the multilib directory with directory seperators replaced with
4344 "_".  If multilib directories are not set, or the multilib directory is
4345 "." then this option emits nothing.
4346
4347 @item %L
4348 Process the @code{lib} spec.  This is a spec string for deciding which
4349 libraries should be included on the command line to the linker.
4350
4351 @item %G
4352 Process the @code{libgcc} spec.  This is a spec string for deciding
4353 which GCC support library should be included on the command line to the linker.
4354
4355 @item %S
4356 Process the @code{startfile} spec.  This is a spec for deciding which
4357 object files should be the first ones passed to the linker.  Typically
4358 this might be a file named @file{crt0.o}.
4359
4360 @item %E
4361 Process the @code{endfile} spec.  This is a spec string that specifies
4362 the last object files that will be passed to the linker.
4363
4364 @item %C
4365 Process the @code{cpp} spec.  This is used to construct the arguments
4366 to be passed to the C preprocessor.
4367
4368 @item %c
4369 Process the @code{signed_char} spec.  This is intended to be used
4370 to tell cpp whether a char is signed.  It typically has the definition:
4371 @smallexample
4372 %@{funsigned-char:-D__CHAR_UNSIGNED__@}
4373 @end smallexample
4374
4375 @item %1
4376 Process the @code{cc1} spec.  This is used to construct the options to be
4377 passed to the actual C compiler (@samp{cc1}).
4378
4379 @item %2
4380 Process the @code{cc1plus} spec.  This is used to construct the options to be
4381 passed to the actual C++ compiler (@samp{cc1plus}).
4382
4383 @item %*
4384 Substitute the variable part of a matched option.  See below.
4385 Note that each comma in the substituted string is replaced by
4386 a single space.
4387
4388 @item %@{@code{S}@}
4389 Substitutes the @code{-S} switch, if that switch was given to GCC.
4390 If that switch was not specified, this substitutes nothing.  Note that
4391 the leading dash is omitted when specifying this option, and it is
4392 automatically inserted if the substitution is performed.  Thus the spec
4393 string @samp{%@{foo@}} would match the command-line option @samp{-foo}
4394 and would output the command line option @samp{-foo}.
4395
4396 @item %W@{@code{S}@}
4397 Like %@{@code{S}@} but mark last argument supplied within as a file to be
4398 deleted on failure.
4399
4400 @item %@{@code{S}*@}
4401 Substitutes all the switches specified to GCC whose names start
4402 with @code{-S}, but which also take an argument.  This is used for
4403 switches like @samp{-o, -D, -I}, etc.  GCC considers @samp{-o foo} as being
4404 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
4405 text, including the space.  Thus two arguments would be generated.
4406
4407 @item %@{^@code{S}*@}
4408 Like %@{@code{S}*@}, but don't put a blank between a switch and its
4409 argument.  Thus %@{^o*@} would only generate one argument, not two.
4410
4411 @item %@{@code{S}*&@code{T}*@}
4412 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
4413 (the order of @code{S} and @code{T} in the spec is not significant).
4414 There can be any number of ampersand-separated variables; for each the
4415 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
4416
4417 @item %@{<@code{S}@}
4418 Remove all occurrences of @code{-S} from the command line.  Note - this
4419 command is position dependent.  @samp{%} commands in the spec string
4420 before this option will see @code{-S}, @samp{%} commands in the spec
4421 string after this option will not.
4422
4423 @item %@{@code{S}*:@code{X}@}
4424 Substitutes @code{X} if one or more switches whose names start with
4425 @code{-S} are specified to GCC.  Note that the tail part of the
4426 @code{-S} option (i.e. the part matched by the @samp{*}) will be substituted
4427 for each occurrence of @samp{%*} within @code{X}.
4428
4429 @item %@{@code{S}:@code{X}@}
4430 Substitutes @code{X}, but only if the @samp{-S} switch was given to GCC.
4431
4432 @item %@{!@code{S}:@code{X}@}
4433 Substitutes @code{X}, but only if the @samp{-S} switch was @emph{not} given to GCC.
4434
4435 @item %@{|@code{S}:@code{X}@}
4436 Like %@{@code{S}:@code{X}@}, but if no @code{S} switch, substitute @samp{-}.
4437
4438 @item %@{|!@code{S}:@code{X}@}
4439 Like %@{!@code{S}:@code{X}@}, but if there is an @code{S} switch, substitute @samp{-}.
4440
4441 @item %@{.@code{S}:@code{X}@}
4442 Substitutes @code{X}, but only if processing a file with suffix @code{S}.
4443
4444 @item %@{!.@code{S}:@code{X}@}
4445 Substitutes @code{X}, but only if @emph{not} processing a file with suffix @code{S}.
4446
4447 @item %@{@code{S}|@code{P}:@code{X}@}
4448 Substitutes @code{X} if either @code{-S} or @code{-P} was given to GCC.  This may be
4449 combined with @samp{!} and @samp{.} sequences as well, although they
4450 have a stronger binding than the @samp{|}.  For example a spec string
4451 like this:
4452
4453 @smallexample
4454 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
4455 @end smallexample
4456
4457 will output the following command-line options from the following input
4458 command-line options:
4459
4460 @smallexample
4461 fred.c        -foo -baz
4462 jim.d         -bar -boggle
4463 -d fred.c     -foo -baz -boggle
4464 -d jim.d      -bar -baz -boggle
4465 @end smallexample
4466
4467 @end table
4468
4469 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or
4470 %@{!@code{S}:@code{X}@} construct may contain other nested @samp{%} constructs
4471 or spaces, or even newlines.  They are processed as usual, as described
4472 above.
4473
4474 The @samp{-O, -f, -m, and -W} switches are handled specifically in these
4475 constructs.  If another value of @samp{-O} or the negated form of a @samp{-f, -m, or
4476 -W} switch is found later in the command line, the earlier switch
4477 value is ignored, except with @{@code{S}*@} where @code{S} is just one
4478 letter, which passes all matching options.
4479
4480 The character @samp{|} at the beginning of the predicate text is used to indicate
4481 that a command should be piped to the following command, but only if @samp{-pipe}
4482 is specified.
4483
4484 It is built into GCC which switches take arguments and which do not.
4485 (You might think it would be useful to generalize this to allow each
4486 compiler's spec to say which switches take arguments.  But this cannot
4487 be done in a consistent fashion.  GCC cannot even decide which input
4488 files have been specified without knowing which switches take arguments,
4489 and it must know which input files to compile in order to tell which
4490 compilers to run).
4491
4492 GCC also knows implicitly that arguments starting in @samp{-l} are to be
4493 treated as compiler output files, and passed to the linker in their
4494 proper position among the other output files.
4495
4496 @c man begin OPTIONS
4497
4498 @node Target Options
4499 @section Specifying Target Machine and Compiler Version
4500 @cindex target options
4501 @cindex cross compiling
4502 @cindex specifying machine version
4503 @cindex specifying compiler version and target machine
4504 @cindex compiler version, specifying
4505 @cindex target machine, specifying
4506
4507 By default, GCC compiles code for the same type of machine that you
4508 are using.  However, it can also be installed as a cross-compiler, to
4509 compile for some other type of machine.  In fact, several different
4510 configurations of GCC, for different target machines, can be
4511 installed side by side.  Then you specify which one to use with the
4512 @samp{-b} option.
4513
4514 In addition, older and newer versions of GCC can be installed side
4515 by side.  One of them (probably the newest) will be the default, but
4516 you may sometimes wish to use another.
4517
4518 @table @gcctabopt
4519 @item -b @var{machine}
4520 The argument @var{machine} specifies the target machine for compilation.
4521 This is useful when you have installed GCC as a cross-compiler.
4522
4523 The value to use for @var{machine} is the same as was specified as the
4524 machine type when configuring GCC as a cross-compiler.  For
4525 example, if a cross-compiler was configured with @samp{configure
4526 i386v}, meaning to compile for an 80386 running System V, then you
4527 would specify @samp{-b i386v} to run that cross compiler.
4528
4529 When you do not specify @samp{-b}, it normally means to compile for
4530 the same type of machine that you are using.
4531
4532 @item -V @var{version}
4533 The argument @var{version} specifies which version of GCC to run.
4534 This is useful when multiple versions are installed.  For example,
4535 @var{version} might be @samp{2.0}, meaning to run GCC version 2.0.
4536
4537 The default version, when you do not specify @samp{-V}, is the last
4538 version of GCC that you installed.
4539 @end table
4540
4541 The @samp{-b} and @samp{-V} options actually work by controlling part of
4542 the file name used for the executable files and libraries used for
4543 compilation.  A given version of GCC, for a given target machine, is
4544 normally kept in the directory @file{/usr/local/lib/gcc-lib/@var{machine}/@var{version}}.@refill
4545
4546 Thus, sites can customize the effect of @samp{-b} or @samp{-V} either by
4547 changing the names of these directories or adding alternate names (or
4548 symbolic links).  If in directory @file{/usr/local/lib/gcc-lib/} the
4549 file @file{80386} is a link to the file @file{i386v}, then @samp{-b
4550 80386} becomes an alias for @samp{-b i386v}.
4551
4552 In one respect, the @samp{-b} or @samp{-V} do not completely change
4553 to a different compiler: the top-level driver program @command{gcc}
4554 that you originally invoked continues to run and invoke the other
4555 executables (preprocessor, compiler per se, assembler and linker)
4556 that do the real work.  However, since no real work is done in the
4557 driver program, it usually does not matter that the driver program
4558 in use is not the one for the specified target.  It is common for the
4559 interface to the other executables to change incompatibly between
4560 compiler versions, so unless the version specified is very close to that
4561 of the driver (for example, @samp{-V 3.0} with a driver program from GCC
4562 version 3.0.1), use of @samp{-V} may not work; for example, using
4563 @samp{-V 2.95.2} will not work with a driver program from GCC 3.0.
4564
4565 The only way that the driver program depends on the target machine is
4566 in the parsing and handling of special machine-specific options.
4567 However, this is controlled by a file which is found, along with the
4568 other executables, in the directory for the specified version and
4569 target machine.  As a result, a single installed driver program adapts
4570 to any specified target machine, and sufficiently similar compiler
4571 versions.
4572
4573 The driver program executable does control one significant thing,
4574 however: the default version and target machine.  Therefore, you can
4575 install different instances of the driver program, compiled for
4576 different targets or versions, under different names.
4577
4578 For example, if the driver for version 2.0 is installed as @command{ogcc}
4579 and that for version 2.1 is installed as @command{gcc}, then the command
4580 @command{gcc} will use version 2.1 by default, while @command{ogcc} will use
4581 2.0 by default.  However, you can choose either version with either
4582 command with the @samp{-V} option.
4583
4584 @node Submodel Options
4585 @section Hardware Models and Configurations
4586 @cindex submodel options
4587 @cindex specifying hardware config
4588 @cindex hardware models and configurations, specifying
4589 @cindex machine dependent options
4590
4591 Earlier we discussed the standard option @samp{-b} which chooses among
4592 different installed compilers for completely different target
4593 machines, such as Vax vs. 68000 vs. 80386.
4594
4595 In addition, each of these target machine types can have its own
4596 special options, starting with @samp{-m}, to choose among various
4597 hardware models or configurations---for example, 68010 vs 68020,
4598 floating coprocessor or none.  A single installed version of the
4599 compiler can compile for any model or configuration, according to the
4600 options specified.
4601
4602 Some configurations of the compiler also support additional special
4603 options, usually for compatibility with other compilers on the same
4604 platform.
4605
4606 @ifset INTERNALS
4607 These options are defined by the macro @code{TARGET_SWITCHES} in the
4608 machine description.  The default for the options is also defined by
4609 that macro, which enables you to change the defaults.
4610 @end ifset
4611
4612 @menu
4613 * M680x0 Options::
4614 * M68hc1x Options::
4615 * VAX Options::
4616 * SPARC Options::
4617 * Convex Options::
4618 * AMD29K Options::
4619 * ARM Options::
4620 * Thumb Options::
4621 * MN10200 Options::
4622 * MN10300 Options::
4623 * M32R/D Options::
4624 * M88K Options::
4625 * RS/6000 and PowerPC Options::
4626 * RT Options::
4627 * MIPS Options::
4628 * i386 Options::
4629 * HPPA Options::
4630 * Intel 960 Options::
4631 * DEC Alpha Options::
4632 * Clipper Options::
4633 * H8/300 Options::
4634 * SH Options::
4635 * System V Options::
4636 * TMS320C3x/C4x Options::
4637 * V850 Options::
4638 * ARC Options::
4639 * NS32K Options::
4640 * AVR Options::
4641 * MCore Options::
4642 * IA-64 Options::
4643 * D30V Options::
4644 @end menu
4645
4646 @node M680x0 Options
4647 @subsection M680x0 Options
4648 @cindex M680x0 options
4649
4650 These are the @samp{-m} options defined for the 68000 series.  The default
4651 values for these options depends on which style of 68000 was selected when
4652 the compiler was configured; the defaults for the most common choices are
4653 given below.
4654
4655 @table @gcctabopt
4656 @item -m68000
4657 @itemx -mc68000
4658 Generate output for a 68000.  This is the default
4659 when the compiler is configured for 68000-based systems.
4660
4661 Use this option for microcontrollers with a 68000 or EC000 core,
4662 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
4663
4664 @item -m68020
4665 @itemx -mc68020
4666 Generate output for a 68020.  This is the default
4667 when the compiler is configured for 68020-based systems.
4668
4669 @item -m68881
4670 Generate output containing 68881 instructions for floating point.
4671 This is the default for most 68020 systems unless @samp{-nfp} was
4672 specified when the compiler was configured.
4673
4674 @item -m68030
4675 Generate output for a 68030.  This is the default when the compiler is
4676 configured for 68030-based systems.
4677
4678 @item -m68040
4679 Generate output for a 68040.  This is the default when the compiler is
4680 configured for 68040-based systems.
4681
4682 This option inhibits the use of 68881/68882 instructions that have to be
4683 emulated by software on the 68040.  Use this option if your 68040 does not
4684 have code to emulate those instructions.
4685
4686 @item -m68060
4687 Generate output for a 68060.  This is the default when the compiler is
4688 configured for 68060-based systems.
4689
4690 This option inhibits the use of 68020 and 68881/68882 instructions that
4691 have to be emulated by software on the 68060.  Use this option if your 68060
4692 does not have code to emulate those instructions.
4693
4694 @item -mcpu32
4695 Generate output for a CPU32. This is the default
4696 when the compiler is configured for CPU32-based systems.
4697
4698 Use this option for microcontrollers with a
4699 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
4700 68336, 68340, 68341, 68349 and 68360.
4701
4702 @item -m5200
4703 Generate output for a 520X "coldfire" family cpu.  This is the default
4704 when the compiler is configured for 520X-based systems.
4705
4706 Use this option for microcontroller with a 5200 core, including
4707 the MCF5202, MCF5203, MCF5204 and MCF5202.
4708
4709
4710 @item -m68020-40
4711 Generate output for a 68040, without using any of the new instructions.
4712 This results in code which can run relatively efficiently on either a
4713 68020/68881 or a 68030 or a 68040.  The generated code does use the
4714 68881 instructions that are emulated on the 68040.
4715
4716 @item -m68020-60
4717 Generate output for a 68060, without using any of the new instructions.
4718 This results in code which can run relatively efficiently on either a
4719 68020/68881 or a 68030 or a 68040.  The generated code does use the
4720 68881 instructions that are emulated on the 68060.
4721
4722 @item -mfpa
4723 Generate output containing Sun FPA instructions for floating point.
4724
4725 @item -msoft-float
4726 Generate output containing library calls for floating point.
4727 @strong{Warning:} the requisite libraries are not available for all m68k
4728 targets.  Normally the facilities of the machine's usual C compiler are
4729 used, but this can't be done directly in cross-compilation.  You must
4730 make your own arrangements to provide suitable library functions for
4731 cross-compilation.  The embedded targets @samp{m68k-*-aout} and
4732 @samp{m68k-*-coff} do provide software floating point support.
4733
4734 @item -mshort
4735 Consider type @code{int} to be 16 bits wide, like @code{short int}.
4736
4737 @item -mnobitfield
4738 Do not use the bit-field instructions.  The @samp{-m68000}, @samp{-mcpu32}
4739 and @samp{-m5200} options imply @w{@samp{-mnobitfield}}.
4740
4741 @item -mbitfield
4742 Do use the bit-field instructions.  The @samp{-m68020} option implies
4743 @samp{-mbitfield}.  This is the default if you use a configuration
4744 designed for a 68020.
4745
4746 @item -mrtd
4747 Use a different function-calling convention, in which functions
4748 that take a fixed number of arguments return with the @code{rtd}
4749 instruction, which pops their arguments while returning.  This
4750 saves one instruction in the caller since there is no need to pop
4751 the arguments there.
4752
4753 This calling convention is incompatible with the one normally
4754 used on Unix, so you cannot use it if you need to call libraries
4755 compiled with the Unix compiler.
4756
4757 Also, you must provide function prototypes for all functions that
4758 take variable numbers of arguments (including @code{printf});
4759 otherwise incorrect code will be generated for calls to those
4760 functions.
4761
4762 In addition, seriously incorrect code will result if you call a
4763 function with too many arguments.  (Normally, extra arguments are
4764 harmlessly ignored.)
4765
4766 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
4767 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
4768
4769 @item -malign-int
4770 @itemx -mno-align-int
4771 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
4772 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
4773 boundary (@samp{-malign-int}) or a 16-bit boundary (@samp{-mno-align-int}).
4774 Aligning variables on 32-bit boundaries produces code that runs somewhat
4775 faster on processors with 32-bit busses at the expense of more memory.
4776
4777 @strong{Warning:} if you use the @samp{-malign-int} switch, GCC will
4778 align structures containing the above types  differently than
4779 most published application binary interface specifications for the m68k.
4780
4781 @item -mpcrel
4782 Use the pc-relative addressing mode of the 68000 directly, instead of
4783 using a global offset table.  At present, this option implies -fpic,
4784 allowing at most a 16-bit offset for pc-relative addressing.  -fPIC is
4785 not presently supported with -mpcrel, though this could be supported for
4786 68020 and higher processors.
4787
4788 @item -mno-strict-align
4789 @itemx -mstrict-align
4790 @kindex -mstrict-align
4791 Do not (do) assume that unaligned memory references will be handled by
4792 the system.
4793
4794 @end table
4795
4796 @node M68hc1x Options
4797 @subsection M68hc1x Options
4798 @cindex M68hc1x options
4799
4800 These are the @samp{-m} options defined for the 68hc11 and 68hc12
4801 microcontrollers.  The default values for these options depends on
4802 which style of microcontroller was selected when the compiler was configured;
4803 the defaults for the most common choices are given below.
4804
4805 @table @gcctabopt
4806 @item -m6811
4807 @itemx -m68hc11
4808 Generate output for a 68HC11.  This is the default
4809 when the compiler is configured for 68HC11-based systems.
4810
4811 @item -m6812
4812 @itemx -m68hc12
4813 Generate output for a 68HC12.  This is the default
4814 when the compiler is configured for 68HC12-based systems.
4815
4816 @item -mauto-incdec
4817 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
4818 addressing modes.
4819
4820 @item -mshort
4821 Consider type @code{int} to be 16 bits wide, like @code{short int}.
4822
4823 @item -msoft-reg-count=@var{count}
4824 Specify the number of pseudo-soft registers which are used for the
4825 code generation.  The maximum number is 32.  Using more pseudo-soft
4826 register may or may not result in better code depending on the program.
4827 The default is 4 for 68HC11 and 2 for 68HC12.
4828
4829 @end table
4830
4831 @node VAX Options
4832 @subsection VAX Options
4833 @cindex VAX options
4834
4835 These @samp{-m} options are defined for the Vax:
4836
4837 @table @gcctabopt
4838 @item -munix
4839 Do not output certain jump instructions (@code{aobleq} and so on)
4840 that the Unix assembler for the Vax cannot handle across long
4841 ranges.
4842
4843 @item -mgnu
4844 Do output those jump instructions, on the assumption that you
4845 will assemble with the GNU assembler.
4846
4847 @item -mg
4848 Output code for g-format floating point numbers instead of d-format.
4849 @end table
4850
4851 @node SPARC Options
4852 @subsection SPARC Options
4853 @cindex SPARC options
4854
4855 These @samp{-m} switches are supported on the SPARC:
4856
4857 @table @gcctabopt
4858 @item -mno-app-regs
4859 @itemx -mapp-regs
4860 Specify @samp{-mapp-regs} to generate output using the global registers
4861 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
4862 is the default.
4863
4864 To be fully SVR4 ABI compliant at the cost of some performance loss,
4865 specify @samp{-mno-app-regs}.  You should compile libraries and system
4866 software with this option.
4867
4868 @item -mfpu
4869 @itemx -mhard-float
4870 Generate output containing floating point instructions.  This is the
4871 default.
4872
4873 @item -mno-fpu
4874 @itemx -msoft-float
4875 Generate output containing library calls for floating point.
4876 @strong{Warning:} the requisite libraries are not available for all SPARC
4877 targets.  Normally the facilities of the machine's usual C compiler are
4878 used, but this cannot be done directly in cross-compilation.  You must make
4879 your own arrangements to provide suitable library functions for
4880 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
4881 @samp{sparclite-*-*} do provide software floating point support.
4882
4883 @samp{-msoft-float} changes the calling convention in the output file;
4884 therefore, it is only useful if you compile @emph{all} of a program with
4885 this option.  In particular, you need to compile @file{libgcc.a}, the
4886 library that comes with GCC, with @samp{-msoft-float} in order for
4887 this to work.
4888
4889 @item -mhard-quad-float
4890 Generate output containing quad-word (long double) floating point
4891 instructions.
4892
4893 @item -msoft-quad-float
4894 Generate output containing library calls for quad-word (long double)
4895 floating point instructions.  The functions called are those specified
4896 in the SPARC ABI.  This is the default.
4897
4898 As of this writing, there are no sparc implementations that have hardware
4899 support for the quad-word floating point instructions.  They all invoke
4900 a trap handler for one of these instructions, and then the trap handler
4901 emulates the effect of the instruction.  Because of the trap handler overhead,
4902 this is much slower than calling the ABI library routines.  Thus the
4903 @samp{-msoft-quad-float} option is the default.
4904
4905 @item -mno-epilogue
4906 @itemx -mepilogue
4907 With @samp{-mepilogue} (the default), the compiler always emits code for
4908 function exit at the end of each function.  Any function exit in
4909 the middle of the function (such as a return statement in C) will
4910 generate a jump to the exit code at the end of the function.
4911
4912 With @samp{-mno-epilogue}, the compiler tries to emit exit code inline
4913 at every function exit.
4914
4915 @item -mno-flat
4916 @itemx -mflat
4917 With @samp{-mflat}, the compiler does not generate save/restore instructions
4918 and will use a "flat" or single register window calling convention.
4919 This model uses %i7 as the frame pointer and is compatible with the normal
4920 register window model.  Code from either may be intermixed.
4921 The local registers and the input registers (0-5) are still treated as
4922 "call saved" registers and will be saved on the stack as necessary.
4923
4924 With @samp{-mno-flat} (the default), the compiler emits save/restore
4925 instructions (except for leaf functions) and is the normal mode of operation.
4926
4927 @item -mno-unaligned-doubles
4928 @itemx -munaligned-doubles
4929 Assume that doubles have 8 byte alignment.  This is the default.
4930
4931 With @samp{-munaligned-doubles}, GCC assumes that doubles have 8 byte
4932 alignment only if they are contained in another type, or if they have an
4933 absolute address.  Otherwise, it assumes they have 4 byte alignment.
4934 Specifying this option avoids some rare compatibility problems with code
4935 generated by other compilers.  It is not the default because it results
4936 in a performance loss, especially for floating point code.
4937
4938 @item -mno-faster-structs
4939 @itemx -mfaster-structs
4940 With @samp{-mfaster-structs}, the compiler assumes that structures
4941 should have 8 byte alignment.  This enables the use of pairs of
4942 @code{ldd} and @code{std} instructions for copies in structure
4943 assignment, in place of twice as many @code{ld} and @code{st} pairs.
4944 However, the use of this changed alignment directly violates the Sparc
4945 ABI.  Thus, it's intended only for use on targets where the developer
4946 acknowledges that their resulting code will not be directly in line with
4947 the rules of the ABI.
4948
4949 @item -mv8
4950 @itemx -msparclite
4951 These two options select variations on the SPARC architecture.
4952
4953 By default (unless specifically configured for the Fujitsu SPARClite),
4954 GCC generates code for the v7 variant of the SPARC architecture.
4955
4956 @samp{-mv8} will give you SPARC v8 code.  The only difference from v7
4957 code is that the compiler emits the integer multiply and integer
4958 divide instructions which exist in SPARC v8 but not in SPARC v7.
4959
4960 @samp{-msparclite} will give you SPARClite code.  This adds the integer
4961 multiply, integer divide step and scan (@code{ffs}) instructions which
4962 exist in SPARClite but not in SPARC v7.
4963
4964 These options are deprecated and will be deleted in a future GCC release.
4965 They have been replaced with @samp{-mcpu=xxx}.
4966
4967 @item -mcypress
4968 @itemx -msupersparc
4969 These two options select the processor for which the code is optimised.
4970
4971 With @samp{-mcypress} (the default), the compiler optimizes code for the
4972 Cypress CY7C602 chip, as used in the SparcStation/SparcServer 3xx series.
4973 This is also appropriate for the older SparcStation 1, 2, IPX etc.
4974
4975 With @samp{-msupersparc} the compiler optimizes code for the SuperSparc cpu, as
4976 used in the SparcStation 10, 1000 and 2000 series. This flag also enables use
4977 of the full SPARC v8 instruction set.
4978
4979 These options are deprecated and will be deleted in a future GCC release.
4980 They have been replaced with @samp{-mcpu=xxx}.
4981
4982 @item -mcpu=@var{cpu_type}
4983 Set the instruction set, register set, and instruction scheduling parameters
4984 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
4985 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
4986 @samp{hypersparc}, @samp{sparclite86x}, @samp{f930}, @samp{f934},
4987 @samp{sparclet}, @samp{tsc701}, @samp{v9}, and @samp{ultrasparc}.
4988
4989 Default instruction scheduling parameters are used for values that select
4990 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
4991 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
4992
4993 Here is a list of each supported architecture and their supported
4994 implementations.
4995
4996 @smallexample
4997     v7:             cypress
4998     v8:             supersparc, hypersparc
4999     sparclite:      f930, f934, sparclite86x
5000     sparclet:       tsc701
5001     v9:             ultrasparc
5002 @end smallexample
5003
5004 @item -mtune=@var{cpu_type}
5005 Set the instruction scheduling parameters for machine type
5006 @var{cpu_type}, but do not set the instruction set or register set that the
5007 option @samp{-mcpu=}@var{cpu_type} would.
5008
5009 The same values for @samp{-mcpu=}@var{cpu_type} are used for
5010 @samp{-mtune=}@*@var{cpu_type}, though the only useful values are those that
5011 select a particular cpu implementation: @samp{cypress}, @samp{supersparc},
5012 @samp{hypersparc}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
5013 @samp{tsc701}, @samp{ultrasparc}.
5014
5015 @end table
5016
5017 These @samp{-m} switches are supported in addition to the above
5018 on the SPARCLET processor.
5019
5020 @table @gcctabopt
5021 @item -mlittle-endian
5022 Generate code for a processor running in little-endian mode.
5023
5024 @item -mlive-g0
5025 Treat register @code{%g0} as a normal register.
5026 GCC will continue to clobber it as necessary but will not assume
5027 it always reads as 0.
5028
5029 @item -mbroken-saverestore
5030 Generate code that does not use non-trivial forms of the @code{save} and
5031 @code{restore} instructions.  Early versions of the SPARCLET processor do
5032 not correctly handle @code{save} and @code{restore} instructions used with
5033 arguments.  They correctly handle them used without arguments.  A @code{save}
5034 instruction used without arguments increments the current window pointer
5035 but does not allocate a new stack frame.  It is assumed that the window
5036 overflow trap handler will properly handle this case as will interrupt
5037 handlers.
5038 @end table
5039
5040 These @samp{-m} switches are supported in addition to the above
5041 on SPARC V9 processors in 64-bit environments.
5042
5043 @table @gcctabopt
5044 @item -mlittle-endian
5045 Generate code for a processor running in little-endian mode.
5046
5047 @item -m32
5048 @itemx -m64
5049 Generate code for a 32-bit or 64-bit environment.
5050 The 32-bit environment sets int, long and pointer to 32 bits.
5051 The 64-bit environment sets int to 32 bits and long and pointer
5052 to 64 bits.
5053
5054 @item -mcmodel=medlow
5055 Generate code for the Medium/Low code model: the program must be linked
5056 in the low 32 bits of the address space.  Pointers are 64 bits.
5057 Programs can be statically or dynamically linked.
5058
5059 @item -mcmodel=medmid
5060 Generate code for the Medium/Middle code model: the program must be linked
5061 in the low 44 bits of the address space, the text segment must be less than
5062 2G bytes, and data segment must be within 2G of the text segment.
5063 Pointers are 64 bits.
5064
5065 @item -mcmodel=medany
5066 Generate code for the Medium/Anywhere code model: the program may be linked
5067 anywhere in the address space, the text segment must be less than
5068 2G bytes, and data segment must be within 2G of the text segment.
5069 Pointers are 64 bits.
5070
5071 @item -mcmodel=embmedany
5072 Generate code for the Medium/Anywhere code model for embedded systems:
5073 assume a 32-bit text and a 32-bit data segment, both starting anywhere
5074 (determined at link time).  Register %g4 points to the base of the
5075 data segment.  Pointers are still 64 bits.
5076 Programs are statically linked, PIC is not supported.
5077
5078 @item -mstack-bias
5079 @itemx -mno-stack-bias
5080 With @samp{-mstack-bias}, GCC assumes that the stack pointer, and
5081 frame pointer if present, are offset by -2047 which must be added back
5082 when making stack frame references.
5083 Otherwise, assume no such offset is present.
5084 @end table
5085
5086 @node Convex Options
5087 @subsection Convex Options
5088 @cindex Convex options
5089
5090 These @samp{-m} options are defined for Convex:
5091
5092 @table @gcctabopt
5093 @item -mc1
5094 Generate output for C1.  The code will run on any Convex machine.
5095 The preprocessor symbol @code{__convex__c1__} is defined.
5096
5097 @item -mc2
5098 Generate output for C2.  Uses instructions not available on C1.
5099 Scheduling and other optimizations are chosen for max performance on C2.
5100 The preprocessor symbol @code{__convex_c2__} is defined.
5101
5102 @item -mc32
5103 Generate output for C32xx.  Uses instructions not available on C1.
5104 Scheduling and other optimizations are chosen for max performance on C32.
5105 The preprocessor symbol @code{__convex_c32__} is defined.
5106
5107 @item -mc34
5108 Generate output for C34xx.  Uses instructions not available on C1.
5109 Scheduling and other optimizations are chosen for max performance on C34.
5110 The preprocessor symbol @code{__convex_c34__} is defined.
5111
5112 @item -mc38
5113 Generate output for C38xx.  Uses instructions not available on C1.
5114 Scheduling and other optimizations are chosen for max performance on C38.
5115 The preprocessor symbol @code{__convex_c38__} is defined.
5116
5117 @item -margcount
5118 Generate code which puts an argument count in the word preceding each
5119 argument list.  This is compatible with regular CC, and a few programs
5120 may need the argument count word.  GDB and other source-level debuggers
5121 do not need it; this info is in the symbol table.
5122
5123 @item -mnoargcount
5124 Omit the argument count word.  This is the default.
5125
5126 @item -mvolatile-cache
5127 Allow volatile references to be cached.  This is the default.
5128
5129 @item -mvolatile-nocache
5130 Volatile references bypass the data cache, going all the way to memory.
5131 This is only needed for multi-processor code that does not use standard
5132 synchronization instructions.  Making non-volatile references to volatile
5133 locations will not necessarily work.
5134
5135 @item -mlong32
5136 Type long is 32 bits, the same as type int.  This is the default.
5137
5138 @item -mlong64
5139 Type long is 64 bits, the same as type long long.  This option is useless,
5140 because no library support exists for it.
5141 @end table
5142
5143 @node AMD29K Options
5144 @subsection AMD29K Options
5145 @cindex AMD29K options
5146
5147 These @samp{-m} options are defined for the AMD Am29000:
5148
5149 @table @gcctabopt
5150 @item -mdw
5151 @kindex -mdw
5152 @cindex DW bit (29k)
5153 Generate code that assumes the @code{DW} bit is set, i.e., that byte and
5154 halfword operations are directly supported by the hardware.  This is the
5155 default.
5156
5157 @item -mndw
5158 @kindex -mndw
5159 Generate code that assumes the @code{DW} bit is not set.
5160
5161 @item -mbw
5162 @kindex -mbw
5163 @cindex byte writes (29k)
5164 Generate code that assumes the system supports byte and halfword write
5165 operations.  This is the default.
5166
5167 @item -mnbw
5168 @kindex -mnbw
5169 Generate code that assumes the systems does not support byte and
5170 halfword write operations.  @samp{-mnbw} implies @samp{-mndw}.
5171
5172 @item -msmall
5173 @kindex -msmall
5174 @cindex memory model (29k)
5175 Use a small memory model that assumes that all function addresses are
5176 either within a single 256 KB segment or at an absolute address of less
5177 than 256k.  This allows the @code{call} instruction to be used instead
5178 of a @code{const}, @code{consth}, @code{calli} sequence.
5179
5180 @item -mnormal
5181 @kindex -mnormal
5182 Use the normal memory model: Generate @code{call} instructions only when
5183 calling functions in the same file and @code{calli} instructions
5184 otherwise.  This works if each file occupies less than 256 KB but allows
5185 the entire executable to be larger than 256 KB.  This is the default.
5186
5187 @item -mlarge
5188 Always use @code{calli} instructions.  Specify this option if you expect
5189 a single file to compile into more than 256 KB of code.
5190
5191 @item -m29050
5192 @kindex -m29050
5193 @cindex processor selection (29k)
5194 Generate code for the Am29050.
5195
5196 @item -m29000
5197 @kindex -m29000
5198 Generate code for the Am29000.  This is the default.
5199
5200 @item -mkernel-registers
5201 @kindex -mkernel-registers
5202 @cindex kernel and user registers (29k)
5203 Generate references to registers @code{gr64-gr95} instead of to
5204 registers @code{gr96-gr127}.  This option can be used when compiling
5205 kernel code that wants a set of global registers disjoint from that used
5206 by user-mode code.
5207
5208 Note that when this option is used, register names in @samp{-f} flags
5209 must use the normal, user-mode, names.
5210
5211 @item -muser-registers
5212 @kindex -muser-registers
5213 Use the normal set of global registers, @code{gr96-gr127}.  This is the
5214 default.
5215
5216 @item -mstack-check
5217 @itemx -mno-stack-check
5218 @kindex -mstack-check
5219 @cindex stack checks (29k)
5220 Insert (or do not insert) a call to @code{__msp_check} after each stack
5221 adjustment.  This is often used for kernel code.
5222
5223 @item -mstorem-bug
5224 @itemx -mno-storem-bug
5225 @kindex -mstorem-bug
5226 @cindex storem bug (29k)
5227 @samp{-mstorem-bug} handles 29k processors which cannot handle the
5228 separation of a mtsrim insn and a storem instruction (most 29000 chips
5229 to date, but not the 29050).
5230
5231 @item -mno-reuse-arg-regs
5232 @itemx -mreuse-arg-regs
5233 @kindex -mreuse-arg-regs
5234 @samp{-mno-reuse-arg-regs} tells the compiler to only use incoming argument
5235 registers for copying out arguments.  This helps detect calling a function
5236 with fewer arguments than it was declared with.
5237
5238 @item -mno-impure-text
5239 @itemx -mimpure-text
5240 @kindex -mimpure-text
5241 @samp{-mimpure-text}, used in addition to @samp{-shared}, tells the compiler to
5242 not pass @samp{-assert pure-text} to the linker when linking a shared object.
5243
5244 @item -msoft-float
5245 @kindex -msoft-float
5246 Generate output containing library calls for floating point.
5247 @strong{Warning:} the requisite libraries are not part of GCC.
5248 Normally the facilities of the machine's usual C compiler are used, but
5249 this can't be done directly in cross-compilation.  You must make your
5250 own arrangements to provide suitable library functions for
5251 cross-compilation.
5252
5253 @item -mno-multm
5254 @kindex -mno-multm
5255 Do not generate multm or multmu instructions.  This is useful for some embedded
5256 systems which do not have trap handlers for these instructions.
5257 @end table
5258
5259 @node ARM Options
5260 @subsection ARM Options
5261 @cindex ARM options
5262
5263 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
5264 architectures:
5265
5266 @table @gcctabopt
5267 @item -mapcs-frame
5268 @kindex -mapcs-frame
5269 Generate a stack frame that is compliant with the ARM Procedure Call
5270 Standard for all functions, even if this is not strictly necessary for
5271 correct execution of the code.  Specifying @samp{-fomit-frame-pointer}
5272 with this option will cause the stack frames not to be generated for
5273 leaf functions.  The default is @samp{-mno-apcs-frame}.
5274
5275 @item -mapcs
5276 @kindex -mapcs
5277 This is a synonym for @samp{-mapcs-frame}.
5278
5279 @item -mapcs-26
5280 @kindex -mapcs-26
5281 Generate code for a processor running with a 26-bit program counter,
5282 and conforming to the function calling standards for the APCS 26-bit
5283 option.  This option replaces the @samp{-m2} and @samp{-m3} options
5284 of previous releases of the compiler.
5285
5286 @item -mapcs-32
5287 @kindex -mapcs-32
5288 Generate code for a processor running with a 32-bit program counter,
5289 and conforming to the function calling standards for the APCS 32-bit
5290 option.  This option replaces the @samp{-m6} option of previous releases
5291 of the compiler.
5292
5293 @item -mapcs-stack-check
5294 @kindex -mapcs-stack-check
5295 @kindex -mno-apcs-stack-check
5296 Generate code to check the amount of stack space available upon entry to
5297 every function (that actually uses some stack space).  If there is
5298 insufficient space available then either the function
5299 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
5300 called, depending upon the amount of stack space required.  The run time
5301 system is required to provide these functions.  The default is
5302 @samp{-mno-apcs-stack-check}, since this produces smaller code.
5303
5304 @item -mapcs-float
5305 @kindex -mapcs-float
5306 @kindex -mno-apcs-float
5307 Pass floating point arguments using the float point registers.  This is
5308 one of the variants of the APCS.  This option is recommended if the
5309 target hardware has a floating point unit or if a lot of floating point
5310 arithmetic is going to be performed by the code.  The default is
5311 @samp{-mno-apcs-float}, since integer only code is slightly increased in
5312 size if @samp{-mapcs-float} is used.
5313
5314 @item -mapcs-reentrant
5315 @kindex -mapcs-reentrant
5316 @kindex -mno-apcs-reentrant
5317 Generate reentrant, position independent code.  This is the equivalent
5318 to specifying the @samp{-fpic} option.  The default is
5319 @samp{-mno-apcs-reentrant}.
5320
5321 @item -mthumb-interwork
5322 @kindex -mthumb-interwork
5323 @kindex -mno-thumb-interwork
5324 Generate code which supports calling between the ARM and THUMB
5325 instruction sets.  Without this option the two instruction sets cannot
5326 be reliably used inside one program.  The default is
5327 @samp{-mno-thumb-interwork}, since slightly larger code is generated
5328 when @samp{-mthumb-interwork} is specified.
5329
5330 @item -mno-sched-prolog
5331 @kindex -mno-sched-prolog
5332 @kindex -msched-prolog
5333 Prevent the reordering of instructions in the function prolog, or the
5334 merging of those instruction with the instructions in the function's
5335 body.  This means that all functions will start with a recognizable set
5336 of instructions (or in fact one of a choice from a small set of
5337 different function prologues), and this information can be used to
5338 locate the start if functions inside an executable piece of code.  The
5339 default is @samp{-msched-prolog}.
5340
5341 @item -mhard-float
5342 Generate output containing floating point instructions.  This is the
5343 default.
5344
5345 @item -msoft-float
5346 Generate output containing library calls for floating point.
5347 @strong{Warning:} the requisite libraries are not available for all ARM
5348 targets.  Normally the facilities of the machine's usual C compiler are
5349 used, but this cannot be done directly in cross-compilation.  You must make
5350 your own arrangements to provide suitable library functions for
5351 cross-compilation.
5352
5353 @samp{-msoft-float} changes the calling convention in the output file;
5354 therefore, it is only useful if you compile @emph{all} of a program with
5355 this option.  In particular, you need to compile @file{libgcc.a}, the
5356 library that comes with GCC, with @samp{-msoft-float} in order for
5357 this to work.
5358
5359 @item -mlittle-endian
5360 Generate code for a processor running in little-endian mode.  This is
5361 the default for all standard configurations.
5362
5363 @item -mbig-endian
5364 Generate code for a processor running in big-endian mode; the default is
5365 to compile code for a little-endian processor.
5366
5367 @item -mwords-little-endian
5368 This option only applies when generating code for big-endian processors.
5369 Generate code for a little-endian word order but a big-endian byte
5370 order.  That is, a byte order of the form @samp{32107654}.  Note: this
5371 option should only be used if you require compatibility with code for
5372 big-endian ARM processors generated by versions of the compiler prior to
5373 2.8.
5374
5375 @item -malignment-traps
5376 @kindex -malignment-traps
5377 Generate code that will not trap if the MMU has alignment traps enabled.
5378 On ARM architectures prior to ARMv4, there were no instructions to
5379 access half-word objects stored in memory.  However, when reading from
5380 memory a feature of the ARM architecture allows a word load to be used,
5381 even if the address is unaligned, and the processor core will rotate the
5382 data as it is being loaded.  This option tells the compiler that such
5383 misaligned accesses will cause a MMU trap and that it should instead
5384 synthesise the access as a series of byte accesses.  The compiler can
5385 still use word accesses to load half-word data if it knows that the
5386 address is aligned to a word boundary.
5387
5388 This option is ignored when compiling for ARM architecture 4 or later,
5389 since these processors have instructions to directly access half-word
5390 objects in memory.
5391
5392 @item -mno-alignment-traps
5393 @kindex -mno-alignment-traps
5394 Generate code that assumes that the MMU will not trap unaligned
5395 accesses.  This produces better code when the target instruction set
5396 does not have half-word memory operations (implementations prior to
5397 ARMv4).
5398
5399 Note that you cannot use this option to access unaligned word objects,
5400 since the processor will only fetch one 32-bit aligned object from
5401 memory.
5402
5403 The default setting for most targets is -mno-alignment-traps, since
5404 this produces better code when there are no half-word memory
5405 instructions available.
5406
5407 @item -mshort-load-bytes
5408 @kindex -mshort-load-bytes
5409 This is a deprecated alias for @samp{-malignment-traps}.
5410
5411 @item -mno-short-load-bytes
5412 @kindex -mno-short-load-bytes
5413 This is a deprecated alias for @samp{-mno-alignment-traps}.
5414
5415 @item -mshort-load-words
5416 @kindex -mshort-load-words
5417 This is a deprecated alias for @samp{-mno-alignment-traps}.
5418
5419 @item -mno-short-load-words
5420 @kindex -mno-short-load-words
5421 This is a deprecated alias for @samp{-malignment-traps}.
5422
5423 @item -mbsd
5424 @kindex -mbsd
5425 This option only applies to RISC iX.  Emulate the native BSD-mode
5426 compiler.  This is the default if @samp{-ansi} is not specified.
5427
5428 @item -mxopen
5429 @kindex -mxopen
5430 This option only applies to RISC iX.  Emulate the native X/Open-mode
5431 compiler.
5432
5433 @item -mno-symrename
5434 @kindex -mno-symrename
5435 This option only applies to RISC iX.  Do not run the assembler
5436 post-processor, @samp{symrename}, after code has been assembled.
5437 Normally it is necessary to modify some of the standard symbols in
5438 preparation for linking with the RISC iX C library; this option
5439 suppresses this pass.  The post-processor is never run when the
5440 compiler is built for cross-compilation.
5441
5442 @item -mcpu=<name>
5443 @kindex -mcpu=
5444 This specifies the name of the target ARM processor.  GCC uses this name
5445 to determine what kind of instructions it can use when generating
5446 assembly code.  Permissible names are: arm2, arm250, arm3, arm6, arm60,
5447 arm600, arm610, arm620, arm7, arm7m, arm7d, arm7dm, arm7di, arm7dmi,
5448 arm70, arm700, arm700i, arm710, arm710c, arm7100, arm7500, arm7500fe,
5449 arm7tdmi, arm8, strongarm, strongarm110, strongarm1100, arm8, arm810,
5450 arm9, arm920, arm920t, arm9tdmi.
5451
5452 @itemx -mtune=<name>
5453 @kindex -mtune=
5454 This option is very similar to the @samp{-mcpu=} option, except that
5455 instead of specifying the actual target processor type, and hence
5456 restricting which instructions can be used, it specifies that GCC should
5457 tune the performance of the code as if the target were of the type
5458 specified in this option, but still choosing the instructions that it
5459 will generate based on the cpu specified by a @samp{-mcpu=} option.
5460 For some arm implementations better performance can be obtained by using
5461 this option.
5462
5463 @item -march=<name>
5464 @kindex -march=
5465 This specifies the name of the target ARM architecture.  GCC uses this
5466 name to determine what kind of instructions it can use when generating
5467 assembly code.  This option can be used in conjunction with or instead
5468 of the @samp{-mcpu=} option.  Permissible names are: armv2, armv2a,
5469 armv3, armv3m, armv4, armv4t, armv5.
5470
5471 @item -mfpe=<number>
5472 @itemx -mfp=<number>
5473 @kindex -mfpe=
5474 @kindex -mfp=
5475 This specifies the version of the floating point emulation available on
5476 the target.  Permissible values are 2 and 3.  @samp{-mfp=} is a synonym
5477 for @samp{-mfpe=} to support older versions of GCC.
5478
5479 @item -mstructure-size-boundary=<n>
5480 @kindex -mstructure-size-boundary
5481 The size of all structures and unions will be rounded up to a multiple
5482 of the number of bits set by this option.  Permissible values are 8 and
5483 32.  The default value varies for different toolchains.  For the COFF
5484 targeted toolchain the default value is 8.  Specifying the larger number
5485 can produce faster, more efficient code, but can also increase the size
5486 of the program.  The two values are potentially incompatible.  Code
5487 compiled with one value cannot necessarily expect to work with code or
5488 libraries compiled with the other value, if they exchange information
5489 using structures or unions.  Programmers are encouraged to use the 32
5490 value as future versions of the toolchain may default to this value.
5491
5492 @item -mabort-on-noreturn
5493 @kindex -mabort-on-noreturn
5494 @kindex -mnoabort-on-noreturn
5495 Generate a call to the function abort at the end of a noreturn function.
5496 It will be executed if the function tries to return.
5497
5498 @item -mlong-calls
5499 @itemx -mno-long-calls
5500 Tells the compiler to perform function calls by first loading the
5501 address of the function into a register and then performing a subroutine
5502 call on this register.  This switch is needed if the target function
5503 will lie outside of the 64 megabyte addressing range of the offset based
5504 version of subroutine call instruction.
5505
5506 Even if this switch is enabled, not all function calls will be turned
5507 into long calls.  The heuristic is that static functions, functions
5508 which have the @samp{short-call} attribute, functions that are inside
5509 the scope of a @samp{#pragma no_long_calls} directive and functions whose
5510 definitions have already been compiled within the current compilation
5511 unit, will not be turned into long calls.  The exception to this rule is
5512 that weak function definitions, functions with the @samp{long-call}
5513 attribute or the @samp{section} attribute, and functions that are within
5514 the scope of a @samp{#pragma long_calls} directive, will always be
5515 turned into long calls.
5516
5517 This feature is not enabled by default.  Specifying
5518 @samp{--no-long-calls} will restore the default behaviour, as will
5519 placing the function calls within the scope of a @samp{#pragma
5520 long_calls_off} directive.  Note these switches have no effect on how
5521 the compiler generates code to handle function calls via function
5522 pointers.
5523
5524 @item -mnop-fun-dllimport
5525 @kindex -mnop-fun-dllimport
5526 Disable the support for the @emph{dllimport} attribute.
5527
5528 @item -msingle-pic-base
5529 @kindex -msingle-pic-base
5530 Treat the register used for PIC addressing as read-only, rather than
5531 loading it in the prologue for each function.  The run-time system is
5532 responsible for initialising this register with an appropriate value
5533 before execution begins.
5534
5535 @item -mpic-register=<reg>
5536 @kindex -mpic-register=
5537 Specify the register to be used for PIC addressing.  The default is R10
5538 unless stack-checking is enabled, when R9 is used.
5539
5540 @end table
5541
5542 @node Thumb Options
5543 @subsection Thumb Options
5544 @cindex Thumb Options
5545
5546 @table @gcctabopt
5547
5548 @item -mthumb-interwork
5549 @kindex -mthumb-interwork
5550 @kindex -mno-thumb-interwork
5551 Generate code which supports calling between the THUMB and ARM
5552 instruction sets.  Without this option the two instruction sets cannot
5553 be reliably used inside one program.  The default is
5554 @samp{-mno-thumb-interwork}, since slightly smaller code is generated
5555 with this option.
5556
5557 @item -mtpcs-frame
5558 @kindex -mtpcs-frame
5559 @kindex -mno-tpcs-frame
5560 Generate a stack frame that is compliant with the Thumb Procedure Call
5561 Standard for all non-leaf functions.  (A leaf function is one that does
5562 not call any other functions).  The default is @samp{-mno-apcs-frame}.
5563
5564 @item -mtpcs-leaf-frame
5565 @kindex -mtpcs-leaf-frame
5566 @kindex -mno-tpcs-leaf-frame
5567 Generate a stack frame that is compliant with the Thumb Procedure Call
5568 Standard for all leaf functions.  (A leaf function is one that does
5569 not call any other functions).  The default is @samp{-mno-apcs-leaf-frame}.
5570
5571 @item -mlittle-endian
5572 @kindex -mlittle-endian
5573 Generate code for a processor running in little-endian mode.  This is
5574 the default for all standard configurations.
5575
5576 @item -mbig-endian
5577 @kindex -mbig-endian
5578 Generate code for a processor running in big-endian mode.
5579
5580 @item -mstructure-size-boundary=<n>
5581 @kindex -mstructure-size-boundary
5582 The size of all structures and unions will be rounded up to a multiple
5583 of the number of bits set by this option.  Permissible values are 8 and
5584 32.  The default value varies for different toolchains.  For the COFF
5585 targeted toolchain the default value is 8.  Specifying the larger number
5586 can produced faster, more efficient code, but can also increase the size
5587 of the program.  The two values are potentially incompatible.  Code
5588 compiled with one value cannot necessarily expect to work with code or
5589 libraries compiled with the other value, if they exchange information
5590 using structures or unions.  Programmers are encouraged to use the 32
5591 value as future versions of the toolchain may default to this value.
5592
5593 @item -mnop-fun-dllimport
5594 @kindex -mnop-fun-dllimport
5595 Disable the support for the @emph{dllimport} attribute.
5596
5597 @item -mcallee-super-interworking
5598 @kindex -mcallee-super-interworking
5599 Gives all externally visible functions in the file being compiled an ARM
5600 instruction set header which switches to Thumb mode before executing the
5601 rest of the function.  This allows these functions to be called from
5602 non-interworking code.
5603
5604 @item -mcaller-super-interworking
5605 @kindex -mcaller-super-interworking
5606 Allows calls via function pointers (including virtual functions) to
5607 execute correctly regardless of whether the target code has been
5608 compiled for interworking or not.  There is a small overhead in the cost
5609 of executing a function pointer if this option is enabled.
5610
5611 @item -msingle-pic-base
5612 @kindex -msingle-pic-base
5613 Treat the register used for PIC addressing as read-only, rather than
5614 loading it in the prologue for each function.  The run-time system is
5615 responsible for initialising this register with an appropriate value
5616 before execution begins.
5617
5618 @item -mpic-register=<reg>
5619 @kindex -mpic-register=
5620 Specify the register to be used for PIC addressing.  The default is R10.
5621
5622 @end table
5623
5624 @node MN10200 Options
5625 @subsection MN10200 Options
5626 @cindex MN10200 options
5627 These @samp{-m} options are defined for Matsushita MN10200 architectures:
5628 @table @gcctabopt
5629
5630 @item -mrelax
5631 Indicate to the linker that it should perform a relaxation optimization pass
5632 to shorten branches, calls and absolute memory addresses.  This option only
5633 has an effect when used on the command line for the final link step.
5634
5635 This option makes symbolic debugging impossible.
5636 @end table
5637
5638 @node MN10300 Options
5639 @subsection MN10300 Options
5640 @cindex MN10300 options
5641 These @samp{-m} options are defined for Matsushita MN10300 architectures:
5642
5643 @table @gcctabopt
5644 @item -mmult-bug
5645 Generate code to avoid bugs in the multiply instructions for the MN10300
5646 processors.  This is the default.
5647
5648 @item -mno-mult-bug
5649 Do not generate code to avoid bugs in the multiply instructions for the
5650 MN10300 processors.
5651
5652 @item -mam33
5653 Generate code which uses features specific to the AM33 processor.
5654
5655 @item -mno-am33
5656 Do not generate code which uses features specific to the AM33 processor.  This
5657 is the default.
5658
5659 @item -mrelax
5660 Indicate to the linker that it should perform a relaxation optimization pass
5661 to shorten branches, calls and absolute memory addresses.  This option only
5662 has an effect when used on the command line for the final link step.
5663
5664 This option makes symbolic debugging impossible.
5665 @end table
5666
5667
5668 @node M32R/D Options
5669 @subsection M32R/D Options
5670 @cindex M32R/D options
5671
5672 These @samp{-m} options are defined for Mitsubishi M32R/D architectures:
5673
5674 @table @gcctabopt
5675 @item -mcode-model=small
5676 Assume all objects live in the lower 16MB of memory (so that their addresses
5677 can be loaded with the @code{ld24} instruction), and assume all subroutines
5678 are reachable with the @code{bl} instruction.
5679 This is the default.
5680
5681 The addressability of a particular object can be set with the
5682 @code{model} attribute.
5683
5684 @item -mcode-model=medium
5685 Assume objects may be anywhere in the 32-bit address space (the compiler
5686 will generate @code{seth/add3} instructions to load their addresses), and
5687 assume all subroutines are reachable with the @code{bl} instruction.
5688
5689 @item -mcode-model=large
5690 Assume objects may be anywhere in the 32-bit address space (the compiler
5691 will generate @code{seth/add3} instructions to load their addresses), and
5692 assume subroutines may not be reachable with the @code{bl} instruction
5693 (the compiler will generate the much slower @code{seth/add3/jl}
5694 instruction sequence).
5695
5696 @item -msdata=none
5697 Disable use of the small data area.  Variables will be put into
5698 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
5699 @code{section} attribute has been specified).
5700 This is the default.
5701
5702 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
5703 Objects may be explicitly put in the small data area with the
5704 @code{section} attribute using one of these sections.
5705
5706 @item -msdata=sdata
5707 Put small global and static data in the small data area, but do not
5708 generate special code to reference them.
5709
5710 @item -msdata=use
5711 Put small global and static data in the small data area, and generate
5712 special instructions to reference them.
5713
5714 @item -G @var{num}
5715 @cindex smaller data references
5716 Put global and static objects less than or equal to @var{num} bytes
5717 into the small data or bss sections instead of the normal data or bss
5718 sections.  The default value of @var{num} is 8.
5719 The @samp{-msdata} option must be set to one of @samp{sdata} or @samp{use}
5720 for this option to have any effect.
5721
5722 All modules should be compiled with the same @samp{-G @var{num}} value.
5723 Compiling with different values of @var{num} may or may not work; if it
5724 doesn't the linker will give an error message - incorrect code will not be
5725 generated.
5726
5727 @end table
5728
5729 @node M88K Options
5730 @subsection M88K Options
5731 @cindex M88k options
5732
5733 These @samp{-m} options are defined for Motorola 88k architectures:
5734
5735 @table @gcctabopt
5736 @item -m88000
5737 @kindex -m88000
5738 Generate code that works well on both the m88100 and the
5739 m88110.
5740
5741 @item -m88100
5742 @kindex -m88100
5743 Generate code that works best for the m88100, but that also
5744 runs on the m88110.
5745
5746 @item -m88110
5747 @kindex -m88110
5748 Generate code that works best for the m88110, and may not run
5749 on the m88100.
5750
5751 @item -mbig-pic
5752 @kindex -mbig-pic
5753 Obsolete option to be removed from the next revision.
5754 Use @samp{-fPIC}.
5755
5756 @item -midentify-revision
5757 @kindex -midentify-revision
5758 @kindex ident
5759 @cindex identifying source, compiler (88k)
5760 Include an @code{ident} directive in the assembler output recording the
5761 source file name, compiler name and version, timestamp, and compilation
5762 flags used.
5763
5764 @item -mno-underscores
5765 @kindex -mno-underscores
5766 @cindex underscores, avoiding (88k)
5767 In assembler output, emit symbol names without adding an underscore
5768 character at the beginning of each name.  The default is to use an
5769 underscore as prefix on each name.
5770
5771 @item -mocs-debug-info
5772 @itemx -mno-ocs-debug-info
5773 @kindex -mocs-debug-info
5774 @kindex -mno-ocs-debug-info
5775 @cindex OCS (88k)
5776 @cindex debugging, 88k OCS
5777 Include (or omit) additional debugging information (about registers used
5778 in each stack frame) as specified in the 88open Object Compatibility
5779 Standard, ``OCS''.  This extra information allows debugging of code that
5780 has had the frame pointer eliminated.  The default for DG/UX, SVr4, and
5781 Delta 88 SVr3.2 is to include this information; other 88k configurations
5782 omit this information by default.
5783
5784 @item -mocs-frame-position
5785 @kindex -mocs-frame-position
5786 @cindex register positions in frame (88k)
5787 When emitting COFF debugging information for automatic variables and
5788 parameters stored on the stack, use the offset from the canonical frame
5789 address, which is the stack pointer (register 31) on entry to the
5790 function.  The DG/UX, SVr4, Delta88 SVr3.2, and BCS configurations use
5791 @samp{-mocs-frame-position}; other 88k configurations have the default
5792 @samp{-mno-ocs-frame-position}.
5793
5794 @item -mno-ocs-frame-position
5795 @kindex -mno-ocs-frame-position
5796 @cindex register positions in frame (88k)
5797 When emitting COFF debugging information for automatic variables and
5798 parameters stored on the stack, use the offset from the frame pointer
5799 register (register 30).  When this option is in effect, the frame
5800 pointer is not eliminated when debugging information is selected by the
5801 -g switch.
5802
5803 @item -moptimize-arg-area
5804 @itemx -mno-optimize-arg-area
5805 @kindex -moptimize-arg-area
5806 @kindex -mno-optimize-arg-area
5807 @cindex arguments in frame (88k)
5808 Control how function arguments are stored in stack frames.
5809 @samp{-moptimize-arg-area} saves space by optimizing them, but this
5810 conflicts with the 88open specifications.  The opposite alternative,
5811 @samp{-mno-optimize-arg-area}, agrees with 88open standards.  By default
5812 GCC does not optimize the argument area.
5813
5814 @item -mshort-data-@var{num}
5815 @kindex -mshort-data-@var{num}
5816 @cindex smaller data references (88k)
5817 @cindex r0-relative references (88k)
5818 Generate smaller data references by making them relative to @code{r0},
5819 which allows loading a value using a single instruction (rather than the
5820 usual two).  You control which data references are affected by
5821 specifying @var{num} with this option.  For example, if you specify
5822 @samp{-mshort-data-512}, then the data references affected are those
5823 involving displacements of less than 512 bytes.
5824 @samp{-mshort-data-@var{num}} is not effective for @var{num} greater
5825 than 64k.
5826
5827 @item -mserialize-volatile
5828 @kindex -mserialize-volatile
5829 @itemx -mno-serialize-volatile
5830 @kindex -mno-serialize-volatile
5831 @cindex sequential consistency on 88k
5832 Do, or don't, generate code to guarantee sequential consistency
5833 of volatile memory references.  By default, consistency is
5834 guaranteed.
5835
5836 The order of memory references made by the MC88110 processor does
5837 not always match the order of the instructions requesting those
5838 references.  In particular, a load instruction may execute before
5839 a preceding store instruction.  Such reordering violates
5840 sequential consistency of volatile memory references, when there
5841 are multiple processors.   When consistency must be guaranteed,
5842 GNU C generates special instructions, as needed, to force
5843 execution in the proper order.
5844
5845 The MC88100 processor does not reorder memory references and so
5846 always provides sequential consistency.  However, by default, GNU
5847 C generates the special instructions to guarantee consistency
5848 even when you use @samp{-m88100}, so that the code may be run on an
5849 MC88110 processor.  If you intend to run your code only on the
5850 MC88100 processor, you may use @samp{-mno-serialize-volatile}.
5851
5852 The extra code generated to guarantee consistency may affect the
5853 performance of your application.  If you know that you can safely
5854 forgo this guarantee, you may use @samp{-mno-serialize-volatile}.
5855
5856 @item -msvr4
5857 @itemx -msvr3
5858 @kindex -msvr4
5859 @kindex -msvr3
5860 @cindex assembler syntax, 88k
5861 @cindex SVr4
5862 Turn on (@samp{-msvr4}) or off (@samp{-msvr3}) compiler extensions
5863 related to System V release 4 (SVr4).  This controls the following:
5864
5865 @enumerate
5866 @item
5867 Which variant of the assembler syntax to emit.
5868 @item
5869 @samp{-msvr4} makes the C preprocessor recognize @samp{#pragma weak}
5870 that is used on System V release 4.
5871 @item
5872 @samp{-msvr4} makes GCC issue additional declaration directives used in
5873 SVr4.
5874 @end enumerate
5875
5876 @samp{-msvr4} is the default for the m88k-motorola-sysv4 and
5877 m88k-dg-dgux m88k configurations. @samp{-msvr3} is the default for all
5878 other m88k configurations.
5879
5880 @item -mversion-03.00
5881 @kindex -mversion-03.00
5882 This option is obsolete, and is ignored.
5883 @c ??? which asm syntax better for GAS?  option there too?
5884
5885 @item -mno-check-zero-division
5886 @itemx -mcheck-zero-division
5887 @kindex -mno-check-zero-division
5888 @kindex -mcheck-zero-division
5889 @cindex zero division on 88k
5890 Do, or don't, generate code to guarantee that integer division by
5891 zero will be detected.  By default, detection is guaranteed.
5892
5893 Some models of the MC88100 processor fail to trap upon integer
5894 division by zero under certain conditions.  By default, when
5895 compiling code that might be run on such a processor, GNU C
5896 generates code that explicitly checks for zero-valued divisors
5897 and traps with exception number 503 when one is detected.  Use of
5898 mno-check-zero-division suppresses such checking for code
5899 generated to run on an MC88100 processor.
5900
5901 GNU C assumes that the MC88110 processor correctly detects all
5902 instances of integer division by zero.  When @samp{-m88110} is
5903 specified, both @samp{-mcheck-zero-division} and
5904 @samp{-mno-check-zero-division} are ignored, and no explicit checks for
5905 zero-valued divisors are generated.
5906
5907 @item -muse-div-instruction
5908 @kindex -muse-div-instruction
5909 @cindex divide instruction, 88k
5910 Use the div instruction for signed integer division on the
5911 MC88100 processor.  By default, the div instruction is not used.
5912
5913 On the MC88100 processor the signed integer division instruction
5914 div) traps to the operating system on a negative operand.  The
5915 operating system transparently completes the operation, but at a
5916 large cost in execution time.  By default, when compiling code
5917 that might be run on an MC88100 processor, GNU C emulates signed
5918 integer division using the unsigned integer division instruction
5919 divu), thereby avoiding the large penalty of a trap to the
5920 operating system.  Such emulation has its own, smaller, execution
5921 cost in both time and space.  To the extent that your code's
5922 important signed integer division operations are performed on two
5923 nonnegative operands, it may be desirable to use the div
5924 instruction directly.
5925
5926 On the MC88110 processor the div instruction (also known as the
5927 divs instruction) processes negative operands without trapping to
5928 the operating system.  When @samp{-m88110} is specified,
5929 @samp{-muse-div-instruction} is ignored, and the div instruction is used
5930 for signed integer division.
5931
5932 Note that the result of dividing INT_MIN by -1 is undefined.  In
5933 particular, the behavior of such a division with and without
5934 @samp{-muse-div-instruction}  may differ.
5935
5936 @item -mtrap-large-shift
5937 @itemx -mhandle-large-shift
5938 @kindex -mtrap-large-shift
5939 @kindex -mhandle-large-shift
5940 @cindex bit shift overflow (88k)
5941 @cindex large bit shifts (88k)
5942 Include code to detect bit-shifts of more than 31 bits; respectively,
5943 trap such shifts or emit code to handle them properly.  By default GCC
5944 makes no special provision for large bit shifts.
5945
5946 @item -mwarn-passed-structs
5947 @kindex -mwarn-passed-structs
5948 @cindex structure passing (88k)
5949 Warn when a function passes a struct as an argument or result.
5950 Structure-passing conventions have changed during the evolution of the C
5951 language, and are often the source of portability problems.  By default,
5952 GCC issues no such warning.
5953 @end table
5954
5955 @node RS/6000 and PowerPC Options
5956 @subsection IBM RS/6000 and PowerPC Options
5957 @cindex RS/6000 and PowerPC Options
5958 @cindex IBM RS/6000 and PowerPC Options
5959
5960 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
5961 @table @gcctabopt
5962 @item -mpower
5963 @itemx -mno-power
5964 @itemx -mpower2
5965 @itemx -mno-power2
5966 @itemx -mpowerpc
5967 @itemx -mno-powerpc
5968 @itemx -mpowerpc-gpopt
5969 @itemx -mno-powerpc-gpopt
5970 @itemx -mpowerpc-gfxopt
5971 @itemx -mno-powerpc-gfxopt
5972 @itemx -mpowerpc64
5973 @itemx -mno-powerpc64
5974 @kindex -mpower
5975 @kindex -mpower2
5976 @kindex -mpowerpc
5977 @kindex -mpowerpc-gpopt
5978 @kindex -mpowerpc-gfxopt
5979 @kindex -mpowerpc64
5980 GCC supports two related instruction set architectures for the
5981 RS/6000 and PowerPC.  The @dfn{POWER} instruction set are those
5982 instructions supported by the @samp{rios} chip set used in the original
5983 RS/6000 systems and the @dfn{PowerPC} instruction set is the
5984 architecture of the Motorola MPC5xx, MPC6xx, MPC8xx microprocessors, and
5985 the IBM 4xx microprocessors.
5986
5987 Neither architecture is a subset of the other.  However there is a
5988 large common subset of instructions supported by both.  An MQ
5989 register is included in processors supporting the POWER architecture.
5990
5991 You use these options to specify which instructions are available on the
5992 processor you are using.  The default value of these options is
5993 determined when configuring GCC.  Specifying the
5994 @samp{-mcpu=@var{cpu_type}} overrides the specification of these
5995 options.  We recommend you use the @samp{-mcpu=@var{cpu_type}} option
5996 rather than the options listed above.
5997
5998 The @samp{-mpower} option allows GCC to generate instructions that
5999 are found only in the POWER architecture and to use the MQ register.
6000 Specifying @samp{-mpower2} implies @samp{-power} and also allows GCC
6001 to generate instructions that are present in the POWER2 architecture but
6002 not the original POWER architecture.
6003
6004 The @samp{-mpowerpc} option allows GCC to generate instructions that
6005 are found only in the 32-bit subset of the PowerPC architecture.
6006 Specifying @samp{-mpowerpc-gpopt} implies @samp{-mpowerpc} and also allows
6007 GCC to use the optional PowerPC architecture instructions in the
6008 General Purpose group, including floating-point square root.  Specifying
6009 @samp{-mpowerpc-gfxopt} implies @samp{-mpowerpc} and also allows GCC to
6010 use the optional PowerPC architecture instructions in the Graphics
6011 group, including floating-point select.
6012
6013 The @samp{-mpowerpc64} option allows GCC to generate the additional
6014 64-bit instructions that are found in the full PowerPC64 architecture
6015 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
6016 @samp{-mno-powerpc64}.
6017
6018 If you specify both @samp{-mno-power} and @samp{-mno-powerpc}, GCC
6019 will use only the instructions in the common subset of both
6020 architectures plus some special AIX common-mode calls, and will not use
6021 the MQ register.  Specifying both @samp{-mpower} and @samp{-mpowerpc}
6022 permits GCC to use any instruction from either architecture and to
6023 allow use of the MQ register; specify this for the Motorola MPC601.
6024
6025 @item -mnew-mnemonics
6026 @itemx -mold-mnemonics
6027 @kindex -mnew-mnemonics
6028 @kindex -mold-mnemonics
6029 Select which mnemonics to use in the generated assembler code.
6030 @samp{-mnew-mnemonics} requests output that uses the assembler mnemonics
6031 defined for the PowerPC architecture, while @samp{-mold-mnemonics}
6032 requests the assembler mnemonics defined for the POWER architecture.
6033 Instructions defined in only one architecture have only one mnemonic;
6034 GCC uses that mnemonic irrespective of which of these options is
6035 specified.
6036
6037 GCC defaults to the mnemonics appropriate for the architecture in
6038 use.  Specifying @samp{-mcpu=@var{cpu_type}} sometimes overrides the
6039 value of these option.  Unless you are building a cross-compiler, you
6040 should normally not specify either @samp{-mnew-mnemonics} or
6041 @samp{-mold-mnemonics}, but should instead accept the default.
6042
6043 @item -mcpu=@var{cpu_type}
6044 @kindex -mcpu
6045 Set architecture type, register usage, choice of mnemonics, and
6046 instruction scheduling parameters for machine type @var{cpu_type}.
6047 Supported values for @var{cpu_type} are @samp{rios}, @samp{rios1},
6048 @samp{rsc}, @samp{rios2}, @samp{rs64a}, @samp{601}, @samp{602},
6049 @samp{603}, @samp{603e}, @samp{604}, @samp{604e}, @samp{620},
6050 @samp{630}, @samp{740}, @samp{750}, @samp{power}, @samp{power2},
6051 @samp{powerpc}, @samp{403}, @samp{505}, @samp{801}, @samp{821},
6052 @samp{823}, and @samp{860} and @samp{common}.  @samp{-mcpu=power},
6053 @samp{-mcpu=power2}, @samp{-mcpu=powerpc}, and @samp{-mcpu=powerpc64}
6054 specify generic POWER, POWER2, pure 32-bit PowerPC (i.e., not MPC601),
6055 and 64-bit PowerPC architecture machine types, with an appropriate,
6056 generic processor model assumed for scheduling purposes.@refill
6057
6058 Specifying any of the following options:
6059 @samp{-mcpu=rios1}, @samp{-mcpu=rios2}, @samp{-mcpu=rsc},
6060 @samp{-mcpu=power}, or @samp{-mcpu=power2}
6061 enables the @samp{-mpower} option and disables the @samp{-mpowerpc} option;
6062 @samp{-mcpu=601} enables both the @samp{-mpower} and @samp{-mpowerpc} options.
6063 All of @samp{-mcpu=rs64a}, @samp{-mcpu=602}, @samp{-mcpu=603},
6064 @samp{-mcpu=603e}, @samp{-mcpu=604}, @samp{-mcpu=620}, @samp{-mcpu=630},
6065 @samp{-mcpu=740}, and @samp{-mcpu=750}
6066 enable the @samp{-mpowerpc} option and disable the @samp{-mpower} option.
6067 Exactly similarly, all of @samp{-mcpu=403},
6068 @samp{-mcpu=505}, @samp{-mcpu=821}, @samp{-mcpu=860} and @samp{-mcpu=powerpc}
6069 enable the @samp{-mpowerpc} option and disable the @samp{-mpower} option.
6070 @samp{-mcpu=common} disables both the
6071 @samp{-mpower} and @samp{-mpowerpc} options.@refill
6072
6073 AIX versions 4 or greater selects @samp{-mcpu=common} by default, so
6074 that code will operate on all members of the RS/6000 POWER and PowerPC
6075 families.  In that case, GCC will use only the instructions in the
6076 common subset of both architectures plus some special AIX common-mode
6077 calls, and will not use the MQ register.  GCC assumes a generic
6078 processor model for scheduling purposes.
6079
6080 Specifying any of the options @samp{-mcpu=rios1}, @samp{-mcpu=rios2},
6081 @samp{-mcpu=rsc}, @samp{-mcpu=power}, or @samp{-mcpu=power2} also
6082 disables the @samp{new-mnemonics} option.  Specifying @samp{-mcpu=601},
6083 @samp{-mcpu=602}, @samp{-mcpu=603}, @samp{-mcpu=603e}, @samp{-mcpu=604},
6084 @samp{-mcpu=620}, @samp{-mcpu=630}, @samp{-mcpu=403}, @samp{-mcpu=505},
6085 @samp{-mcpu=821}, @samp{-mcpu=860} or @samp{-mcpu=powerpc} also enables
6086 the @samp{new-mnemonics} option.@refill
6087
6088 Specifying @samp{-mcpu=403}, @samp{-mcpu=821}, or @samp{-mcpu=860} also
6089 enables the @samp{-msoft-float} option.
6090
6091 @item -mtune=@var{cpu_type}
6092 Set the instruction scheduling parameters for machine type
6093 @var{cpu_type}, but do not set the architecture type, register usage,
6094 choice of mnemonics like @samp{-mcpu=}@var{cpu_type} would.  The same
6095 values for @var{cpu_type} are used for @samp{-mtune=}@var{cpu_type} as
6096 for @samp{-mcpu=}@var{cpu_type}.  The @samp{-mtune=}@var{cpu_type}
6097 option overrides the @samp{-mcpu=}@var{cpu_type} option in terms of
6098 instruction scheduling parameters.
6099
6100 @item -mfull-toc
6101 @itemx -mno-fp-in-toc
6102 @itemx -mno-sum-in-toc
6103 @itemx -mminimal-toc
6104 @kindex -mminimal-toc
6105 Modify generation of the TOC (Table Of Contents), which is created for
6106 every executable file.  The @samp{-mfull-toc} option is selected by
6107 default.  In that case, GCC will allocate at least one TOC entry for
6108 each unique non-automatic variable reference in your program.  GCC
6109 will also place floating-point constants in the TOC.  However, only
6110 16,384 entries are available in the TOC.
6111
6112 If you receive a linker error message that saying you have overflowed
6113 the available TOC space, you can reduce the amount of TOC space used
6114 with the @samp{-mno-fp-in-toc} and @samp{-mno-sum-in-toc} options.
6115 @samp{-mno-fp-in-toc} prevents GCC from putting floating-point
6116 constants in the TOC and @samp{-mno-sum-in-toc} forces GCC to
6117 generate code to calculate the sum of an address and a constant at
6118 run-time instead of putting that sum into the TOC.  You may specify one
6119 or both of these options.  Each causes GCC to produce very slightly
6120 slower and larger code at the expense of conserving TOC space.
6121
6122 If you still run out of space in the TOC even when you specify both of
6123 these options, specify @samp{-mminimal-toc} instead.  This option causes
6124 GCC to make only one TOC entry for every file.  When you specify this
6125 option, GCC will produce code that is slower and larger but which
6126 uses extremely little TOC space.  You may wish to use this option
6127 only on files that contain less frequently executed code. @refill
6128
6129 @item -maix64
6130 @itemx -maix32
6131 @kindex -maix64
6132 @kindex -maix32
6133 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
6134 @code{long} type, and the infrastructure needed to support them.
6135 Specifying @samp{-maix64} implies @samp{-mpowerpc64} and
6136 @samp{-mpowerpc}, while @samp{-maix32} disables the 64-bit ABI and
6137 implies @samp{-mno-powerpc64}.  GCC defaults to @samp{-maix32}.
6138
6139 @item -mxl-call
6140 @itemx -mno-xl-call
6141 @kindex -mxl-call
6142 On AIX, pass floating-point arguments to prototyped functions beyond the
6143 register save area (RSA) on the stack in addition to argument FPRs.  The
6144 AIX calling convention was extended but not initially documented to
6145 handle an obscure K&R C case of calling a function that takes the
6146 address of its arguments with fewer arguments than declared.  AIX XL
6147 compilers access floating point arguments which do not fit in the
6148 RSA from the stack when a subroutine is compiled without
6149 optimization.  Because always storing floating-point arguments on the
6150 stack is inefficient and rarely needed, this option is not enabled by
6151 default and only is necessary when calling subroutines compiled by AIX
6152 XL compilers without optimization.
6153
6154 @item -mthreads
6155 @kindex -mthreads
6156 Support @dfn{AIX Threads}.  Link an application written to use
6157 @dfn{pthreads} with special libraries and startup code to enable the
6158 application to run.
6159
6160 @item -mpe
6161 @kindex -mpe
6162 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE).  Link an
6163 application written to use message passing with special startup code to
6164 enable the application to run.  The system must have PE installed in the
6165 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
6166 must be overridden with the @samp{-specs=} option to specify the
6167 appropriate directory location.  The Parallel Environment does not
6168 support threads, so the @samp{-mpe} option and the @samp{-mthreads}
6169 option are incompatible.
6170
6171 @item -msoft-float
6172 @itemx -mhard-float
6173 @kindex -msoft-float
6174 Generate code that does not use (uses) the floating-point register set.
6175 Software floating point emulation is provided if you use the
6176 @samp{-msoft-float} option, and pass the option to GCC when linking.
6177
6178 @item -mmultiple
6179 @itemx -mno-multiple
6180 Generate code that uses (does not use) the load multiple word
6181 instructions and the store multiple word instructions.  These
6182 instructions are generated by default on POWER systems, and not
6183 generated on PowerPC systems.  Do not use @samp{-mmultiple} on little
6184 endian PowerPC systems, since those instructions do not work when the
6185 processor is in little endian mode.  The exceptions are PPC740 and
6186 PPC750 which permit the instructions usage in little endian mode.
6187
6188 @item -mstring
6189 @itemx -mno-string
6190 @kindex -mstring
6191 Generate code that uses (does not use) the load string instructions
6192 and the store string word instructions to save multiple registers and
6193 do small block moves.  These instructions are generated by default on
6194 POWER systems, and not generated on PowerPC systems.  Do not use
6195 @samp{-mstring} on little endian PowerPC systems, since those
6196 instructions do not work when the processor is in little endian mode.
6197 The exceptions are PPC740 and PPC750 which permit the instructions
6198 usage in little endian mode.
6199
6200 @item -mupdate
6201 @itemx -mno-update
6202 @kindex -mupdate
6203 Generate code that uses (does not use) the load or store instructions
6204 that update the base register to the address of the calculated memory
6205 location.  These instructions are generated by default.  If you use
6206 @samp{-mno-update}, there is a small window between the time that the
6207 stack pointer is updated and the address of the previous frame is
6208 stored, which means code that walks the stack frame across interrupts or
6209 signals may get corrupted data.
6210
6211 @item -mfused-madd
6212 @itemx -mno-fused-madd
6213 @kindex -mfused-madd
6214 Generate code that uses (does not use) the floating point multiply and
6215 accumulate instructions.  These instructions are generated by default if
6216 hardware floating is used.
6217
6218 @item -mno-bit-align
6219 @itemx -mbit-align
6220 @kindex -mbit-align
6221 On System V.4 and embedded PowerPC systems do not (do) force structures
6222 and unions that contain bit fields to be aligned to the base type of the
6223 bit field.
6224
6225 For example, by default a structure containing nothing but 8
6226 @code{unsigned} bitfields of length 1 would be aligned to a 4 byte
6227 boundary and have a size of 4 bytes.  By using @samp{-mno-bit-align},
6228 the structure would be aligned to a 1 byte boundary and be one byte in
6229 size.
6230
6231 @item -mno-strict-align
6232 @itemx -mstrict-align
6233 @kindex -mstrict-align
6234 On System V.4 and embedded PowerPC systems do not (do) assume that
6235 unaligned memory references will be handled by the system.
6236
6237 @item -mrelocatable
6238 @itemx -mno-relocatable
6239 @kindex -mrelocatable
6240 On embedded PowerPC systems generate code that allows (does not allow)
6241 the program to be relocated to a different address at runtime.  If you
6242 use @samp{-mrelocatable} on any module, all objects linked together must
6243 be compiled with @samp{-mrelocatable} or @samp{-mrelocatable-lib}.
6244
6245 @item -mrelocatable-lib
6246 @itemx -mno-relocatable-lib
6247 On embedded PowerPC systems generate code that allows (does not allow)
6248 the program to be relocated to a different address at runtime.  Modules
6249 compiled with @samp{-mrelocatable-lib} can be linked with either modules
6250 compiled without @samp{-mrelocatable} and @samp{-mrelocatable-lib} or
6251 with modules compiled with the @samp{-mrelocatable} options.
6252
6253 @item -mno-toc
6254 @itemx -mtoc
6255 On System V.4 and embedded PowerPC systems do not (do) assume that
6256 register 2 contains a pointer to a global area pointing to the addresses
6257 used in the program.
6258
6259 @item -mlittle
6260 @itemx -mlittle-endian
6261 On System V.4 and embedded PowerPC systems compile code for the
6262 processor in little endian mode.  The @samp{-mlittle-endian} option is
6263 the same as @samp{-mlittle}.
6264
6265 @item -mbig
6266 @itemx -mbig-endian
6267 On System V.4 and embedded PowerPC systems compile code for the
6268 processor in big endian mode.  The @samp{-mbig-endian} option is
6269 the same as @samp{-mbig}.
6270
6271 @item -mcall-sysv
6272 On System V.4 and embedded PowerPC systems compile code using calling
6273 conventions that adheres to the March 1995 draft of the System V
6274 Application Binary Interface, PowerPC processor supplement.  This is the
6275 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
6276
6277 @item -mcall-sysv-eabi
6278 Specify both @samp{-mcall-sysv} and @samp{-meabi} options.
6279
6280 @item -mcall-sysv-noeabi
6281 Specify both @samp{-mcall-sysv} and @samp{-mno-eabi} options.
6282
6283 @item -mcall-aix
6284 On System V.4 and embedded PowerPC systems compile code using calling
6285 conventions that are similar to those used on AIX.  This is the
6286 default if you configured GCC using @samp{powerpc-*-eabiaix}.
6287
6288 @item -mcall-solaris
6289 On System V.4 and embedded PowerPC systems compile code for the Solaris
6290 operating system.
6291
6292 @item -mcall-linux
6293 On System V.4 and embedded PowerPC systems compile code for the
6294 Linux-based GNU system.
6295
6296 @item -mprototype
6297 @itemx -mno-prototype
6298 On System V.4 and embedded PowerPC systems assume that all calls to
6299 variable argument functions are properly prototyped.  Otherwise, the
6300 compiler must insert an instruction before every non prototyped call to
6301 set or clear bit 6 of the condition code register (@var{CR}) to
6302 indicate whether floating point values were passed in the floating point
6303 registers in case the function takes a variable arguments.  With
6304 @samp{-mprototype}, only calls to prototyped variable argument functions
6305 will set or clear the bit.
6306
6307 @item -msim
6308 On embedded PowerPC systems, assume that the startup module is called
6309 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
6310 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
6311 configurations.
6312
6313 @item -mmvme
6314 On embedded PowerPC systems, assume that the startup module is called
6315 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
6316 @file{libc.a}.
6317
6318 @item -mads
6319 On embedded PowerPC systems, assume that the startup module is called
6320 @file{crt0.o} and the standard C libraries are @file{libads.a} and
6321 @file{libc.a}.
6322
6323 @item -myellowknife
6324 On embedded PowerPC systems, assume that the startup module is called
6325 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
6326 @file{libc.a}.
6327
6328 @item -mvxworks
6329 On System V.4 and embedded PowerPC systems, specify that you are
6330 compiling for a VxWorks system.
6331
6332 @item -memb
6333 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
6334 header to indicate that @samp{eabi} extended relocations are used.
6335
6336 @item -meabi
6337 @itemx -mno-eabi
6338 On System V.4 and embedded PowerPC systems do (do not) adhere to the
6339 Embedded Applications Binary Interface (eabi) which is a set of
6340 modifications to the System V.4 specifications.  Selecting @option{-meabi}
6341 means that the stack is aligned to an 8 byte boundary, a function
6342 @code{__eabi} is called to from @code{main} to set up the eabi
6343 environment, and the @samp{-msdata} option can use both @code{r2} and
6344 @code{r13} to point to two separate small data areas.  Selecting
6345 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
6346 do not call an initialization function from @code{main}, and the
6347 @samp{-msdata} option will only use @code{r13} to point to a single
6348 small data area.  The @samp{-meabi} option is on by default if you
6349 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
6350
6351 @item -msdata=eabi
6352 On System V.4 and embedded PowerPC systems, put small initialized
6353 @code{const} global and static data in the @samp{.sdata2} section, which
6354 is pointed to by register @code{r2}.  Put small initialized
6355 non-@code{const} global and static data in the @samp{.sdata} section,
6356 which is pointed to by register @code{r13}.  Put small uninitialized
6357 global and static data in the @samp{.sbss} section, which is adjacent to
6358 the @samp{.sdata} section.  The @samp{-msdata=eabi} option is
6359 incompatible with the @samp{-mrelocatable} option.  The
6360 @samp{-msdata=eabi} option also sets the @samp{-memb} option.
6361
6362 @item -msdata=sysv
6363 On System V.4 and embedded PowerPC systems, put small global and static
6364 data in the @samp{.sdata} section, which is pointed to by register
6365 @code{r13}.  Put small uninitialized global and static data in the
6366 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
6367 The @samp{-msdata=sysv} option is incompatible with the
6368 @samp{-mrelocatable} option.
6369
6370 @item -msdata=default
6371 @itemx -msdata
6372 On System V.4 and embedded PowerPC systems, if @samp{-meabi} is used,
6373 compile code the same as @samp{-msdata=eabi}, otherwise compile code the
6374 same as @samp{-msdata=sysv}.
6375
6376 @item -msdata-data
6377 On System V.4 and embedded PowerPC systems, put small global and static
6378 data in the @samp{.sdata} section.  Put small uninitialized global and
6379 static data in the @samp{.sbss} section.  Do not use register @code{r13}
6380 to address small data however.  This is the default behavior unless
6381 other @samp{-msdata} options are used.
6382
6383 @item -msdata=none
6384 @itemx -mno-sdata
6385 On embedded PowerPC systems, put all initialized global and static data
6386 in the @samp{.data} section, and all uninitialized data in the
6387 @samp{.bss} section.
6388
6389 @item -G @var{num}
6390 @cindex smaller data references (PowerPC)
6391 @cindex .sdata/.sdata2 references (PowerPC)
6392 On embedded PowerPC systems, put global and static items less than or
6393 equal to @var{num} bytes into the small data or bss sections instead of
6394 the normal data or bss section.  By default, @var{num} is 8.  The
6395 @samp{-G @var{num}} switch is also passed to the linker.
6396 All modules should be compiled with the same @samp{-G @var{num}} value.
6397
6398 @item -mregnames
6399 @itemx -mno-regnames
6400 On System V.4 and embedded PowerPC systems do (do not) emit register
6401 names in the assembly language output using symbolic forms.
6402
6403 @end table
6404
6405 @node RT Options
6406 @subsection IBM RT Options
6407 @cindex RT options
6408 @cindex IBM RT options
6409
6410 These @samp{-m} options are defined for the IBM RT PC:
6411
6412 @table @gcctabopt
6413 @item -min-line-mul
6414 Use an in-line code sequence for integer multiplies.  This is the
6415 default.
6416
6417 @item -mcall-lib-mul
6418 Call @code{lmul$$} for integer multiples.
6419
6420 @item -mfull-fp-blocks
6421 Generate full-size floating point data blocks, including the minimum
6422 amount of scratch space recommended by IBM.  This is the default.
6423
6424 @item -mminimum-fp-blocks
6425 Do not include extra scratch space in floating point data blocks.  This
6426 results in smaller code, but slower execution, since scratch space must
6427 be allocated dynamically.
6428
6429 @cindex @file{varargs.h} and RT PC
6430 @cindex @file{stdarg.h} and RT PC
6431 @item -mfp-arg-in-fpregs
6432 Use a calling sequence incompatible with the IBM calling convention in
6433 which floating point arguments are passed in floating point registers.
6434 Note that @code{varargs.h} and @code{stdargs.h} will not work with
6435 floating point operands if this option is specified.
6436
6437 @item -mfp-arg-in-gregs
6438 Use the normal calling convention for floating point arguments.  This is
6439 the default.
6440
6441 @item -mhc-struct-return
6442 Return structures of more than one word in memory, rather than in a
6443 register.  This provides compatibility with the MetaWare HighC (hc)
6444 compiler.  Use the option @samp{-fpcc-struct-return} for compatibility
6445 with the Portable C Compiler (pcc).
6446
6447 @item -mnohc-struct-return
6448 Return some structures of more than one word in registers, when
6449 convenient.  This is the default.  For compatibility with the
6450 IBM-supplied compilers, use the option @samp{-fpcc-struct-return} or the
6451 option @samp{-mhc-struct-return}.
6452 @end table
6453
6454 @node MIPS Options
6455 @subsection MIPS Options
6456 @cindex MIPS options
6457
6458 These @samp{-m} options are defined for the MIPS family of computers:
6459
6460 @table @gcctabopt
6461 @item -mcpu=@var{cpu type}
6462 Assume the defaults for the machine type @var{cpu type} when scheduling
6463 instructions.  The choices for @var{cpu type} are @samp{r2000}, @samp{r3000},
6464 @samp{r3900}, @samp{r4000}, @samp{r4100}, @samp{r4300}, @samp{r4400},
6465 @samp{r4600}, @samp{r4650}, @samp{r5000}, @samp{r6000}, @samp{r8000},
6466 and @samp{orion}.  Additionally, the @samp{r2000}, @samp{r3000},
6467 @samp{r4000}, @samp{r5000}, and @samp{r6000} can be abbreviated as
6468 @samp{r2k} (or @samp{r2K}), @samp{r3k}, etc.  While picking a specific
6469 @var{cpu type} will schedule things appropriately for that particular
6470 chip, the compiler will not generate any code that does not meet level 1
6471 of the MIPS ISA (instruction set architecture) without a @samp{-mipsX}
6472 or @samp{-mabi} switch being used.
6473
6474 @item -mips1
6475 Issue instructions from level 1 of the MIPS ISA.  This is the default.
6476 @samp{r3000} is the default @var{cpu type} at this ISA level.
6477
6478 @item -mips2
6479 Issue instructions from level 2 of the MIPS ISA (branch likely, square
6480 root instructions).  @samp{r6000} is the default @var{cpu type} at this
6481 ISA level.
6482
6483 @item -mips3
6484 Issue instructions from level 3 of the MIPS ISA (64-bit instructions).
6485 @samp{r4000} is the default @var{cpu type} at this ISA level.
6486
6487 @item -mips4
6488 Issue instructions from level 4 of the MIPS ISA (conditional move,
6489 prefetch, enhanced FPU instructions).  @samp{r8000} is the default
6490 @var{cpu type} at this ISA level.
6491
6492 @item -mfp32
6493 Assume that 32 32-bit floating point registers are available.  This is
6494 the default.
6495
6496 @item -mfp64
6497 Assume that 32 64-bit floating point registers are available.  This is
6498 the default when the @samp{-mips3} option is used.
6499
6500 @item -mgp32
6501 Assume that 32 32-bit general purpose registers are available.  This is
6502 the default.
6503
6504 @item -mgp64
6505 Assume that 32 64-bit general purpose registers are available.  This is
6506 the default when the @samp{-mips3} option is used.
6507
6508 @item -mint64
6509 Force int and long types to be 64 bits wide.  See @samp{-mlong32} for an
6510 explanation of the default, and the width of pointers.
6511
6512 @item -mlong64
6513 Force long types to be 64 bits wide.  See @samp{-mlong32} for an
6514 explanation of the default, and the width of pointers.
6515
6516 @item -mlong32
6517 Force long, int, and pointer types to be 32 bits wide.
6518
6519 If none of @samp{-mlong32}, @samp{-mlong64}, or @samp{-mint64} are set,
6520 the size of ints, longs, and pointers depends on the ABI and ISA chosen.
6521 For @samp{-mabi=32}, and @samp{-mabi=n32}, ints and longs are 32 bits
6522 wide.  For @samp{-mabi=64}, ints are 32 bits, and longs are 64 bits wide.
6523 For @samp{-mabi=eabi} and either @samp{-mips1} or @samp{-mips2}, ints
6524 and longs are 32 bits wide.  For @samp{-mabi=eabi} and higher ISAs, ints
6525 are 32 bits, and longs are 64 bits wide.  The width of pointer types is
6526 the smaller of the width of longs or the width of general purpose
6527 registers (which in turn depends on the ISA).
6528
6529 @item -mabi=32
6530 @itemx -mabi=o64
6531 @itemx -mabi=n32
6532 @itemx -mabi=64
6533 @itemx -mabi=eabi
6534 Generate code for the indicated ABI.  The default instruction level is
6535 @samp{-mips1} for @samp{32}, @samp{-mips3} for @samp{n32}, and
6536 @samp{-mips4} otherwise.  Conversely, with @samp{-mips1} or
6537 @samp{-mips2}, the default ABI is @samp{32}; otherwise, the default ABI
6538 is @samp{64}.
6539
6540 @item -mmips-as
6541 Generate code for the MIPS assembler, and invoke @file{mips-tfile} to
6542 add normal debug information.  This is the default for all
6543 platforms except for the OSF/1 reference platform, using the OSF/rose
6544 object format.  If the either of the @samp{-gstabs} or @samp{-gstabs+}
6545 switches are used, the @file{mips-tfile} program will encapsulate the
6546 stabs within MIPS ECOFF.
6547
6548 @item -mgas
6549 Generate code for the GNU assembler.  This is the default on the OSF/1
6550 reference platform, using the OSF/rose object format.  Also, this is
6551 the default if the configure option @samp{--with-gnu-as} is used.
6552
6553 @item -msplit-addresses
6554 @itemx -mno-split-addresses
6555 Generate code to load the high and low parts of address constants separately.
6556 This allows @code{gcc} to optimize away redundant loads of the high order
6557 bits of addresses.  This optimization requires GNU as and GNU ld.
6558 This optimization is enabled by default for some embedded targets where
6559 GNU as and GNU ld are standard.
6560
6561 @item -mrnames
6562 @itemx -mno-rnames
6563 The @samp{-mrnames} switch says to output code using the MIPS software
6564 names for the registers, instead of the hardware names (ie, @var{a0}
6565 instead of @var{$4}).  The only known assembler that supports this option
6566 is the Algorithmics assembler.
6567
6568 @item -mgpopt
6569 @itemx -mno-gpopt
6570 The @samp{-mgpopt} switch says to write all of the data declarations
6571 before the instructions in the text section, this allows the MIPS
6572 assembler to generate one word memory references instead of using two
6573 words for short global or static data items.  This is on by default if
6574 optimization is selected.
6575
6576 @item -mstats
6577 @itemx -mno-stats
6578 For each non-inline function processed, the @samp{-mstats} switch
6579 causes the compiler to emit one line to the standard error file to
6580 print statistics about the program (number of registers saved, stack
6581 size, etc.).
6582
6583 @item -mmemcpy
6584 @itemx -mno-memcpy
6585 The @samp{-mmemcpy} switch makes all block moves call the appropriate
6586 string function (@samp{memcpy} or @samp{bcopy}) instead of possibly
6587 generating inline code.
6588
6589 @item -mmips-tfile
6590 @itemx -mno-mips-tfile
6591 The @samp{-mno-mips-tfile} switch causes the compiler not
6592 postprocess the object file with the @file{mips-tfile} program,
6593 after the MIPS assembler has generated it to add debug support.  If
6594 @file{mips-tfile} is not run, then no local variables will be
6595 available to the debugger.  In addition, @file{stage2} and
6596 @file{stage3} objects will have the temporary file names passed to the
6597 assembler embedded in the object file, which means the objects will
6598 not compare the same.  The @samp{-mno-mips-tfile} switch should only
6599 be used when there are bugs in the @file{mips-tfile} program that
6600 prevents compilation.
6601
6602 @item -msoft-float
6603 Generate output containing library calls for floating point.
6604 @strong{Warning:} the requisite libraries are not part of GCC.
6605 Normally the facilities of the machine's usual C compiler are used, but
6606 this can't be done directly in cross-compilation.  You must make your
6607 own arrangements to provide suitable library functions for
6608 cross-compilation.
6609
6610 @item -mhard-float
6611 Generate output containing floating point instructions.  This is the
6612 default if you use the unmodified sources.
6613
6614 @item -mabicalls
6615 @itemx -mno-abicalls
6616 Emit (or do not emit) the pseudo operations @samp{.abicalls},
6617 @samp{.cpload}, and @samp{.cprestore} that some System V.4 ports use for
6618 position independent code.
6619
6620 @item -mlong-calls
6621 @itemx -mno-long-calls
6622 Do all calls with the @samp{JALR} instruction, which requires
6623 loading up a function's address into a register before the call.
6624 You need to use this switch, if you call outside of the current
6625 512 megabyte segment to functions that are not through pointers.
6626
6627 @item -mhalf-pic
6628 @itemx -mno-half-pic
6629 Put pointers to extern references into the data section and load them
6630 up, rather than put the references in the text section.
6631
6632 @item -membedded-pic
6633 @itemx -mno-embedded-pic
6634 Generate PIC code suitable for some embedded systems.  All calls are
6635 made using PC relative address, and all data is addressed using the $gp
6636 register.  No more than 65536 bytes of global data may be used.  This
6637 requires GNU as and GNU ld which do most of the work.  This currently
6638 only works on targets which use ECOFF; it does not work with ELF.
6639
6640 @item -membedded-data
6641 @itemx -mno-embedded-data
6642 Allocate variables to the read-only data section first if possible, then
6643 next in the small data section if possible, otherwise in data.  This gives
6644 slightly slower code than the default, but reduces the amount of RAM required
6645 when executing, and thus may be preferred for some embedded systems.
6646
6647 @item -muninit-const-in-rodata
6648 @itemx -mno-uninit-const-in-rodata
6649 When used together with -membedded-data, it will always store uninitialized
6650 const variables in the read-only data section.
6651
6652 @item -msingle-float
6653 @itemx -mdouble-float
6654 The @samp{-msingle-float} switch tells gcc to assume that the floating
6655 point coprocessor only supports single precision operations, as on the
6656 @samp{r4650} chip.  The @samp{-mdouble-float} switch permits gcc to use
6657 double precision operations.  This is the default.
6658
6659 @item -mmad
6660 @itemx -mno-mad
6661 Permit use of the @samp{mad}, @samp{madu} and @samp{mul} instructions,
6662 as on the @samp{r4650} chip.
6663
6664 @item -m4650
6665 Turns on @samp{-msingle-float}, @samp{-mmad}, and, at least for now,
6666 @samp{-mcpu=r4650}.
6667
6668 @item -mips16
6669 @itemx -mno-mips16
6670 Enable 16-bit instructions.
6671
6672 @item -mentry
6673 Use the entry and exit pseudo ops.  This option can only be used with
6674 @samp{-mips16}.
6675
6676 @item -EL
6677 Compile code for the processor in little endian mode.
6678 The requisite libraries are assumed to exist.
6679
6680 @item -EB
6681 Compile code for the processor in big endian mode.
6682 The requisite libraries are assumed to exist.
6683
6684 @item -G @var{num}
6685 @cindex smaller data references (MIPS)
6686 @cindex gp-relative references (MIPS)
6687 Put global and static items less than or equal to @var{num} bytes into
6688 the small data or bss sections instead of the normal data or bss
6689 section.  This allows the assembler to emit one word memory reference
6690 instructions based on the global pointer (@var{gp} or @var{$28}),
6691 instead of the normal two words used.  By default, @var{num} is 8 when
6692 the MIPS assembler is used, and 0 when the GNU assembler is used.  The
6693 @samp{-G @var{num}} switch is also passed to the assembler and linker.
6694 All modules should be compiled with the same @samp{-G @var{num}}
6695 value.
6696
6697 @item -nocpp
6698 Tell the MIPS assembler to not run its preprocessor over user
6699 assembler files (with a @samp{.s} suffix) when assembling them.
6700
6701 @item -mfix7000
6702 Pass an option to gas which will cause nops to be inserted if
6703 the read of the destination register of an mfhi or mflo instruction
6704 occurs in the following two instructions.
6705
6706 @item -no-crt0
6707 Do not include the default crt0.
6708 @end table
6709
6710 @ifset INTERNALS
6711 These options are defined by the macro
6712 @code{TARGET_SWITCHES} in the machine description.  The default for the
6713 options is also defined by that macro, which enables you to change the
6714 defaults.
6715 @end ifset
6716
6717 @node i386 Options
6718 @subsection Intel 386 Options
6719 @cindex i386 Options
6720 @cindex Intel 386 Options
6721
6722 These @samp{-m} options are defined for the i386 family of computers:
6723
6724 @table @gcctabopt
6725 @item -mcpu=@var{cpu type}
6726 Assume the defaults for the machine type @var{cpu type} when scheduling
6727 instructions.  The choices for @var{cpu type} are @samp{i386},
6728 @samp{i486}, @samp{i586}, @samp{i686}, @samp{pentium},
6729 @samp{pentiumpro}, @samp{pentium4}, @samp{k6}, and @samp{athlon}
6730
6731 While picking a specific @var{cpu type} will schedule things appropriately
6732 for that particular chip, the compiler will not generate any code that
6733 does not run on the i386 without the @samp{-march=@var{cpu type}} option
6734 being used.  @samp{i586} is equivalent to @samp{pentium} and @samp{i686}
6735 is equivalent to @samp{pentiumpro}.  @samp{k6} and @samp{athlon} are the
6736 AMD chips as opposed to the Intel ones.
6737
6738 @item -march=@var{cpu type}
6739 Generate instructions for the machine type @var{cpu type}.  The choices
6740 for @var{cpu type} are the same as for @samp{-mcpu}.  Moreover,
6741 specifying @samp{-march=@var{cpu type}} implies @samp{-mcpu=@var{cpu type}}.
6742
6743 @item -m386
6744 @itemx -m486
6745 @itemx -mpentium
6746 @itemx -mpentiumpro
6747 Synonyms for -mcpu=i386, -mcpu=i486, -mcpu=pentium, and -mcpu=pentiumpro
6748 respectively.  These synonyms are deprecated.
6749
6750 @item -mintel-syntax
6751 Emit assembly using Intel syntax opcodes instead of AT&T syntax.
6752
6753 @item -mieee-fp
6754 @itemx -mno-ieee-fp
6755 Control whether or not the compiler uses IEEE floating point
6756 comparisons.  These handle correctly the case where the result of a
6757 comparison is unordered.
6758
6759 @item -msoft-float
6760 Generate output containing library calls for floating point.
6761 @strong{Warning:} the requisite libraries are not part of GCC.
6762 Normally the facilities of the machine's usual C compiler are used, but
6763 this can't be done directly in cross-compilation.  You must make your
6764 own arrangements to provide suitable library functions for
6765 cross-compilation.
6766
6767 On machines where a function returns floating point results in the 80387
6768 register stack, some floating point opcodes may be emitted even if
6769 @samp{-msoft-float} is used.
6770
6771 @item -mno-fp-ret-in-387
6772 Do not use the FPU registers for return values of functions.
6773
6774 The usual calling convention has functions return values of types
6775 @code{float} and @code{double} in an FPU register, even if there
6776 is no FPU.  The idea is that the operating system should emulate
6777 an FPU.
6778
6779 The option @samp{-mno-fp-ret-in-387} causes such values to be returned
6780 in ordinary CPU registers instead.
6781
6782 @item -mno-fancy-math-387
6783 Some 387 emulators do not support the @code{sin}, @code{cos} and
6784 @code{sqrt} instructions for the 387.  Specify this option to avoid
6785 generating those instructions. This option is the default on FreeBSD.
6786 As of revision 2.6.1, these instructions are not generated unless you
6787 also use the @samp{-funsafe-math-optimizations} switch.
6788
6789 @item -malign-double
6790 @itemx -mno-align-double
6791 Control whether GCC aligns @code{double}, @code{long double}, and
6792 @code{long long} variables on a two word boundary or a one word
6793 boundary.  Aligning @code{double} variables on a two word boundary will
6794 produce code that runs somewhat faster on a @samp{Pentium} at the
6795 expense of more memory.
6796
6797 @item -m128bit-long-double
6798 @itemx -m128bit-long-double
6799 Control the size of @code{long double} type. i386 application binary interface
6800 specify the size to be 12 bytes, while modern architectures (Pentium and newer)
6801 preffer @code{long double} aligned to 8 or 16 byte boundary.  This is
6802 impossible to reach with 12 byte long doubles in the array accesses.
6803
6804 @strong{Warning:} if you use the @samp{-m128bit-long-double} switch, the
6805 structures and arrays containing @code{long double} will change their size as
6806 well as function calling convention for function taking @code{long double}
6807 will be modified.
6808
6809 @item -m96bit-long-double
6810 @itemx -m96bit-long-double
6811 Set the size of @code{long double} to 96 bits as required by the i386
6812 application binary interface.  This is the default.
6813
6814 @item -msvr3-shlib
6815 @itemx -mno-svr3-shlib
6816 Control whether GCC places uninitialized locals into @code{bss} or
6817 @code{data}.  @samp{-msvr3-shlib} places these locals into @code{bss}.
6818 These options are meaningful only on System V Release 3.
6819
6820 @item -mno-wide-multiply
6821 @itemx -mwide-multiply
6822 Control whether GCC uses the @code{mul} and @code{imul} that produce
6823 64-bit results in @code{eax:edx} from 32-bit operands to do @code{long
6824 long} multiplies and 32-bit division by constants.
6825
6826 @item -mrtd
6827 Use a different function-calling convention, in which functions that
6828 take a fixed number of arguments return with the @code{ret} @var{num}
6829 instruction, which pops their arguments while returning.  This saves one
6830 instruction in the caller since there is no need to pop the arguments
6831 there.
6832
6833 You can specify that an individual function is called with this calling
6834 sequence with the function attribute @samp{stdcall}.  You can also
6835 override the @samp{-mrtd} option by using the function attribute
6836 @samp{cdecl}.  @xref{Function Attributes}.
6837
6838 @strong{Warning:} this calling convention is incompatible with the one
6839 normally used on Unix, so you cannot use it if you need to call
6840 libraries compiled with the Unix compiler.
6841
6842 Also, you must provide function prototypes for all functions that
6843 take variable numbers of arguments (including @code{printf});
6844 otherwise incorrect code will be generated for calls to those
6845 functions.
6846
6847 In addition, seriously incorrect code will result if you call a
6848 function with too many arguments.  (Normally, extra arguments are
6849 harmlessly ignored.)
6850
6851 @item -mregparm=@var{num}
6852 Control how many registers are used to pass integer arguments.  By
6853 default, no registers are used to pass arguments, and at most 3
6854 registers can be used.  You can control this behavior for a specific
6855 function by using the function attribute @samp{regparm}.
6856 @xref{Function Attributes}.
6857
6858 @strong{Warning:} if you use this switch, and
6859 @var{num} is nonzero, then you must build all modules with the same
6860 value, including any libraries.  This includes the system libraries and
6861 startup modules.
6862
6863 @item -mpreferred-stack-boundary=@var{num}
6864 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
6865 byte boundary.  If @samp{-mpreferred-stack-boundary} is not specified,
6866 the default is 4 (16 bytes or 128 bits).
6867
6868 The stack is required to be aligned on a 4 byte boundary.  On Pentium
6869 and PentiumPro, @code{double} and @code{long double} values should be
6870 aligned to an 8 byte boundary (see @samp{-malign-double}) or suffer
6871 significant run time performance penalties.  On Pentium III, the
6872 Streaming SIMD Extension (SSE) data type @code{__m128} suffers similar
6873 penalties if it is not 16 byte aligned.
6874
6875 To ensure proper alignment of this values on the stack, the stack boundary
6876 must be as aligned as that required by any value stored on the stack.
6877 Further, every function must be generated such that it keeps the stack
6878 aligned.  Thus calling a function compiled with a higher preferred
6879 stack boundary from a function compiled with a lower preferred stack
6880 boundary will most likely misalign the stack.  It is recommended that
6881 libraries that use callbacks always use the default setting.
6882
6883 This extra alignment does consume extra stack space.  Code that is sensitive
6884 to stack space usage, such as embedded systems and operating system kernels,
6885 may want to reduce the preferred alignment to
6886 @samp{-mpreferred-stack-boundary=2}.
6887
6888 @item -mpush-args
6889 @kindex -mpush-args
6890 Use PUSH operations to store outgoing parameters. This method is shorter
6891 and usually equally fast as method using SUB/MOV operations and is enabled
6892 by default. In some cases disabling it may improve performance because of
6893 improved scheduling and reduced dependencies.
6894
6895 @item -maccumulate-outgoing-args
6896 @kindex -maccumulate-outgoing-args
6897 If enabled, the maximum amount of space required for outgoing arguments will be
6898 computed in the function prologue. This in faster on most modern CPUs
6899 because of reduced dependencies, improved scheduling and reduced stack usage
6900 when preferred stack boundary is not equal to 2.  The drawback is a notable
6901 increase in code size. This switch implies -mno-push-args.
6902
6903 @item -mthreads
6904 @kindex -mthreads
6905 Support thread-safe exception handling on @samp{Mingw32}. Code that relies
6906 on thread-safe exception handling must compile and link all code with the
6907 @samp{-mthreads} option. When compiling, @samp{-mthreads} defines
6908 @samp{-D_MT}; when linking, it links in a special thread helper library
6909 @samp{-lmingwthrd} which cleans up per thread exception handling data.
6910
6911 @item -mno-align-stringops
6912 @kindex -mno-align-stringops
6913 Do not align destination of inlined string operations. This switch reduces
6914 code size and improves performance in case the destination is already aligned,
6915 but gcc don't know about it.
6916
6917 @item -minline-all-stringops
6918 @kindex -minline-all-stringops
6919 By default GCC inlines string operations only when destination is known to be
6920 aligned at least to 4 byte boundary. This enables more inlining, increase code
6921 size, but may improve performance of code that depends on fast memcpy, strlen
6922 and memset for short lengths.
6923
6924 @item -momit-leaf-frame-pointer
6925 @kindex -momit-leaf-frame-pointer
6926 Don't keep the frame pointer in a register for leaf functions.  This
6927 avoids the instructions to save, set up and restore frame pointers and
6928 makes an extra register available in leaf functions.  The option
6929 @samp{-fomit-frame-pointer} removes the frame pointer for all functions
6930 which might make debugging harder.
6931 @end table
6932
6933 @node HPPA Options
6934 @subsection HPPA Options
6935 @cindex HPPA Options
6936
6937 These @samp{-m} options are defined for the HPPA family of computers:
6938
6939 @table @gcctabopt
6940 @item -march=@var{architecture type}
6941 Generate code for the specified architecture.  The choices for
6942 @var{architecture type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
6943 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
6944 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
6945 architecture option for your machine.  Code compiled for lower numbered
6946 architectures will run on higher numbered architectures, but not the
6947 other way around.
6948
6949 PA 2.0 support currently requires gas snapshot 19990413 or later.  The
6950 next release of binutils (current is 2.9.1) will probably contain PA 2.0
6951 support.
6952
6953 @item -mpa-risc-1-0
6954 @itemx -mpa-risc-1-1
6955 @itemx -mpa-risc-2-0
6956 Synonyms for -march=1.0, -march=1.1, and -march=2.0 respectively.
6957
6958 @item -mbig-switch
6959 Generate code suitable for big switch tables.  Use this option only if
6960 the assembler/linker complain about out of range branches within a switch
6961 table.
6962
6963 @item -mjump-in-delay
6964 Fill delay slots of function calls with unconditional jump instructions
6965 by modifying the return pointer for the function call to be the target
6966 of the conditional jump.
6967
6968 @item -mdisable-fpregs
6969 Prevent floating point registers from being used in any manner.  This is
6970 necessary for compiling kernels which perform lazy context switching of
6971 floating point registers.  If you use this option and attempt to perform
6972 floating point operations, the compiler will abort.
6973
6974 @item -mdisable-indexing
6975 Prevent the compiler from using indexing address modes.  This avoids some
6976 rather obscure problems when compiling MIG generated code under MACH.
6977
6978 @item -mno-space-regs
6979 Generate code that assumes the target has no space registers.  This allows
6980 GCC to generate faster indirect calls and use unscaled index address modes.
6981
6982 Such code is suitable for level 0 PA systems and kernels.
6983
6984 @item -mfast-indirect-calls
6985 Generate code that assumes calls never cross space boundaries.  This
6986 allows GCC to emit code which performs faster indirect calls.
6987
6988 This option will not work in the presence of shared libraries or nested
6989 functions.
6990
6991 @item -mlong-load-store
6992 Generate 3-instruction load and store sequences as sometimes required by
6993 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
6994 the HP compilers.
6995
6996 @item -mportable-runtime
6997 Use the portable calling conventions proposed by HP for ELF systems.
6998
6999 @item -mgas
7000 Enable the use of assembler directives only GAS understands.
7001
7002 @item -mschedule=@var{cpu type}
7003 Schedule code according to the constraints for the machine type
7004 @var{cpu type}.  The choices for @var{cpu type} are @samp{700}
7005 @samp{7100}, @samp{7100LC}, @samp{7200}, and @samp{8000}.  Refer to
7006 @file{/usr/lib/sched.models} on an HP-UX system to determine the
7007 proper scheduling option for your machine.
7008
7009 @item -mlinker-opt
7010 Enable the optimization pass in the HPUX linker.  Note this makes symbolic
7011 debugging impossible.  It also triggers a bug in the HPUX 8 and HPUX 9 linkers
7012 in which they give bogus error messages when linking some programs.
7013
7014 @item -msoft-float
7015 Generate output containing library calls for floating point.
7016 @strong{Warning:} the requisite libraries are not available for all HPPA
7017 targets.  Normally the facilities of the machine's usual C compiler are
7018 used, but this cannot be done directly in cross-compilation.  You must make
7019 your own arrangements to provide suitable library functions for
7020 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
7021 does provide software floating point support.
7022
7023 @samp{-msoft-float} changes the calling convention in the output file;
7024 therefore, it is only useful if you compile @emph{all} of a program with
7025 this option.  In particular, you need to compile @file{libgcc.a}, the
7026 library that comes with GCC, with @samp{-msoft-float} in order for
7027 this to work.
7028 @end table
7029
7030 @node Intel 960 Options
7031 @subsection Intel 960 Options
7032
7033 These @samp{-m} options are defined for the Intel 960 implementations:
7034
7035 @table @gcctabopt
7036 @item -m@var{cpu type}
7037 Assume the defaults for the machine type @var{cpu type} for some of
7038 the other options, including instruction scheduling, floating point
7039 support, and addressing modes.  The choices for @var{cpu type} are
7040 @samp{ka}, @samp{kb}, @samp{mc}, @samp{ca}, @samp{cf},
7041 @samp{sa}, and @samp{sb}.
7042 The default is
7043 @samp{kb}.
7044
7045 @item -mnumerics
7046 @itemx -msoft-float
7047 The @samp{-mnumerics} option indicates that the processor does support
7048 floating-point instructions.  The @samp{-msoft-float} option indicates
7049 that floating-point support should not be assumed.
7050
7051 @item -mleaf-procedures
7052 @itemx -mno-leaf-procedures
7053 Do (or do not) attempt to alter leaf procedures to be callable with the
7054 @code{bal} instruction as well as @code{call}.  This will result in more
7055 efficient code for explicit calls when the @code{bal} instruction can be
7056 substituted by the assembler or linker, but less efficient code in other
7057 cases, such as calls via function pointers, or using a linker that doesn't
7058 support this optimization.
7059
7060 @item -mtail-call
7061 @itemx -mno-tail-call
7062 Do (or do not) make additional attempts (beyond those of the
7063 machine-independent portions of the compiler) to optimize tail-recursive
7064 calls into branches.  You may not want to do this because the detection of
7065 cases where this is not valid is not totally complete.  The default is
7066 @samp{-mno-tail-call}.
7067
7068 @item -mcomplex-addr
7069 @itemx -mno-complex-addr
7070 Assume (or do not assume) that the use of a complex addressing mode is a
7071 win on this implementation of the i960.  Complex addressing modes may not
7072 be worthwhile on the K-series, but they definitely are on the C-series.
7073 The default is currently @samp{-mcomplex-addr} for all processors except
7074 the CB and CC.
7075
7076 @item -mcode-align
7077 @itemx -mno-code-align
7078 Align code to 8-byte boundaries for faster fetching (or don't bother).
7079 Currently turned on by default for C-series implementations only.
7080
7081 @ignore
7082 @item -mclean-linkage
7083 @itemx -mno-clean-linkage
7084 These options are not fully implemented.
7085 @end ignore
7086
7087 @item -mic-compat
7088 @itemx -mic2.0-compat
7089 @itemx -mic3.0-compat
7090 Enable compatibility with iC960 v2.0 or v3.0.
7091
7092 @item -masm-compat
7093 @itemx -mintel-asm
7094 Enable compatibility with the iC960 assembler.
7095
7096 @item -mstrict-align
7097 @itemx -mno-strict-align
7098 Do not permit (do permit) unaligned accesses.
7099
7100 @item -mold-align
7101 Enable structure-alignment compatibility with Intel's gcc release version
7102 1.3 (based on gcc 1.37).  This option implies @samp{-mstrict-align}.
7103
7104 @item -mlong-double-64
7105 Implement type @samp{long double} as 64-bit floating point numbers.
7106 Without the option @samp{long double} is implemented by 80-bit
7107 floating point numbers.  The only reason we have it because there is
7108 no 128-bit @samp{long double} support in @samp{fp-bit.c} yet.  So it
7109 is only useful for people using soft-float targets.  Otherwise, we
7110 should recommend against use of it.
7111
7112 @end table
7113
7114 @node DEC Alpha Options
7115 @subsection DEC Alpha Options
7116
7117 These @samp{-m} options are defined for the DEC Alpha implementations:
7118
7119 @table @gcctabopt
7120 @item -mno-soft-float
7121 @itemx -msoft-float
7122 Use (do not use) the hardware floating-point instructions for
7123 floating-point operations.  When @option{-msoft-float} is specified,
7124 functions in @file{libgcc.a} will be used to perform floating-point
7125 operations.  Unless they are replaced by routines that emulate the
7126 floating-point operations, or compiled in such a way as to call such
7127 emulations routines, these routines will issue floating-point
7128 operations.   If you are compiling for an Alpha without floating-point
7129 operations, you must ensure that the library is built so as not to call
7130 them.
7131
7132 Note that Alpha implementations without floating-point operations are
7133 required to have floating-point registers.
7134
7135 @item -mfp-reg
7136 @itemx -mno-fp-regs
7137 Generate code that uses (does not use) the floating-point register set.
7138 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
7139 register set is not used, floating point operands are passed in integer
7140 registers as if they were integers and floating-point results are passed
7141 in $0 instead of $f0.  This is a non-standard calling sequence, so any
7142 function with a floating-point argument or return value called by code
7143 compiled with @option{-mno-fp-regs} must also be compiled with that
7144 option.
7145
7146 A typical use of this option is building a kernel that does not use,
7147 and hence need not save and restore, any floating-point registers.
7148
7149 @item -mieee
7150 The Alpha architecture implements floating-point hardware optimized for
7151 maximum performance.  It is mostly compliant with the IEEE floating
7152 point standard.  However, for full compliance, software assistance is
7153 required.  This option generates code fully IEEE compliant code
7154 @emph{except} that the @var{inexact flag} is not maintained (see below).
7155 If this option is turned on, the CPP macro @code{_IEEE_FP} is defined
7156 during compilation.  The option is a shorthand for: @samp{-D_IEEE_FP
7157 -mfp-trap-mode=su -mtrap-precision=i -mieee-conformant}.  The resulting
7158 code is less efficient but is able to correctly support denormalized
7159 numbers and exceptional IEEE values such as not-a-number and plus/minus
7160 infinity.  Other Alpha compilers call this option
7161 @option{-ieee_with_no_inexact}.
7162
7163 @item -mieee-with-inexact
7164 @c overfull hbox here --bob 22 jul96
7165 @c original text between ignore ... end ignore
7166 @ignore
7167 This is like @samp{-mieee} except the generated code also maintains the
7168 IEEE @var{inexact flag}.  Turning on this option causes the generated
7169 code to implement fully-compliant IEEE math.  The option is a shorthand
7170 for @samp{-D_IEEE_FP -D_IEEE_FP_INEXACT} plus @samp{-mieee-conformant},
7171 @samp{-mfp-trap-mode=sui}, and @samp{-mtrap-precision=i}.  On some Alpha
7172 implementations the resulting code may execute significantly slower than
7173 the code generated by default.  Since there is very little code that
7174 depends on the @var{inexact flag}, you should normally not specify this
7175 option.  Other Alpha compilers call this option
7176 @samp{-ieee_with_inexact}.
7177 @end ignore
7178 @c            changed paragraph
7179 This is like @samp{-mieee} except the generated code also maintains the
7180 IEEE @var{inexact flag}.  Turning on this option causes the generated
7181 code to implement fully-compliant IEEE math.  The option is a shorthand
7182 for @samp{-D_IEEE_FP -D_IEEE_FP_INEXACT} plus the three following:
7183 @samp{-mieee-conformant},
7184 @samp{-mfp-trap-mode=sui},
7185 and @samp{-mtrap-precision=i}.
7186 On some Alpha implementations the resulting code may execute
7187 significantly slower than the code generated by default.  Since there
7188 is very little code that depends on the @var{inexact flag}, you should
7189 normally not specify this option.  Other Alpha compilers call this
7190 option @samp{-ieee_with_inexact}.
7191 @c             end changes to prevent overfull hboxes
7192
7193 @item -mfp-trap-mode=@var{trap mode}
7194 This option controls what floating-point related traps are enabled.
7195 Other Alpha compilers call this option @samp{-fptm }@var{trap mode}.
7196 The trap mode can be set to one of four values:
7197
7198 @table @samp
7199 @item n
7200 This is the default (normal) setting.  The only traps that are enabled
7201 are the ones that cannot be disabled in software (e.g., division by zero
7202 trap).
7203
7204 @item u
7205 In addition to the traps enabled by @samp{n}, underflow traps are enabled
7206 as well.
7207
7208 @item su
7209 Like @samp{su}, but the instructions are marked to be safe for software
7210 completion (see Alpha architecture manual for details).
7211
7212 @item sui
7213 Like @samp{su}, but inexact traps are enabled as well.
7214 @end table
7215
7216 @item -mfp-rounding-mode=@var{rounding mode}
7217 Selects the IEEE rounding mode.  Other Alpha compilers call this option
7218 @samp{-fprm }@var{rounding mode}.  The @var{rounding mode} can be one
7219 of:
7220
7221 @table @samp
7222 @item n
7223 Normal IEEE rounding mode.  Floating point numbers are rounded towards
7224 the nearest machine number or towards the even machine number in case
7225 of a tie.
7226
7227 @item m
7228 Round towards minus infinity.
7229
7230 @item c
7231 Chopped rounding mode.  Floating point numbers are rounded towards zero.
7232
7233 @item d
7234 Dynamic rounding mode.  A field in the floating point control register
7235 (@var{fpcr}, see Alpha architecture reference manual) controls the
7236 rounding mode in effect.  The C library initializes this register for
7237 rounding towards plus infinity.  Thus, unless your program modifies the
7238 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
7239 @end table
7240
7241 @item -mtrap-precision=@var{trap precision}
7242 In the Alpha architecture, floating point traps are imprecise.  This
7243 means without software assistance it is impossible to recover from a
7244 floating trap and program execution normally needs to be terminated.
7245 GCC can generate code that can assist operating system trap handlers
7246 in determining the exact location that caused a floating point trap.
7247 Depending on the requirements of an application, different levels of
7248 precisions can be selected:
7249
7250 @table @samp
7251 @item p
7252 Program precision.  This option is the default and means a trap handler
7253 can only identify which program caused a floating point exception.
7254
7255 @item f
7256 Function precision.  The trap handler can determine the function that
7257 caused a floating point exception.
7258
7259 @item i
7260 Instruction precision.  The trap handler can determine the exact
7261 instruction that caused a floating point exception.
7262 @end table
7263
7264 Other Alpha compilers provide the equivalent options called
7265 @samp{-scope_safe} and @samp{-resumption_safe}.
7266
7267 @item -mieee-conformant
7268 This option marks the generated code as IEEE conformant.  You must not
7269 use this option unless you also specify @samp{-mtrap-precision=i} and either
7270 @samp{-mfp-trap-mode=su} or @samp{-mfp-trap-mode=sui}.  Its only effect
7271 is to emit the line @samp{.eflag 48} in the function prologue of the
7272 generated assembly file.  Under DEC Unix, this has the effect that
7273 IEEE-conformant math library routines will be linked in.
7274
7275 @item -mbuild-constants
7276 Normally GCC examines a 32- or 64-bit integer constant to
7277 see if it can construct it from smaller constants in two or three
7278 instructions.  If it cannot, it will output the constant as a literal and
7279 generate code to load it from the data segment at runtime.
7280
7281 Use this option to require GCC to construct @emph{all} integer constants
7282 using code, even if it takes more instructions (the maximum is six).
7283
7284 You would typically use this option to build a shared library dynamic
7285 loader.  Itself a shared library, it must relocate itself in memory
7286 before it can find the variables and constants in its own data segment.
7287
7288 @item -malpha-as
7289 @itemx -mgas
7290 Select whether to generate code to be assembled by the vendor-supplied
7291 assembler (@samp{-malpha-as}) or by the GNU assembler @samp{-mgas}.
7292
7293 @item -mbwx
7294 @itemx -mno-bwx
7295 @itemx -mcix
7296 @itemx -mno-cix
7297 @itemx -mmax
7298 @itemx -mno-max
7299 Indicate whether GCC should generate code to use the optional BWX,
7300 CIX, and MAX instruction sets.  The default is to use the instruction sets
7301 supported by the CPU type specified via @samp{-mcpu=} option or that
7302 of the CPU on which GCC was built if none was specified.
7303
7304 @item -mcpu=@var{cpu_type}
7305 Set the instruction set, register set, and instruction scheduling
7306 parameters for machine type @var{cpu_type}.  You can specify either the
7307 @samp{EV} style name or the corresponding chip number.  GCC
7308 supports scheduling parameters for the EV4 and EV5 family of processors
7309 and will choose the default values for the instruction set from
7310 the processor you specify.  If you do not specify a processor type,
7311 GCC will default to the processor on which the compiler was built.
7312
7313 Supported values for @var{cpu_type} are
7314
7315 @table @samp
7316 @item ev4
7317 @itemx 21064
7318 Schedules as an EV4 and has no instruction set extensions.
7319
7320 @item ev5
7321 @itemx 21164
7322 Schedules as an EV5 and has no instruction set extensions.
7323
7324 @item ev56
7325 @itemx 21164a
7326 Schedules as an EV5 and supports the BWX extension.
7327
7328 @item pca56
7329 @itemx 21164pc
7330 @itemx 21164PC
7331 Schedules as an EV5 and supports the BWX and MAX extensions.
7332
7333 @item ev6
7334 @itemx 21264
7335 Schedules as an EV5 (until Digital releases the scheduling parameters
7336 for the EV6) and supports the BWX, CIX, and MAX extensions.
7337 @end table
7338
7339 @item -mmemory-latency=@var{time}
7340 Sets the latency the scheduler should assume for typical memory
7341 references as seen by the application.  This number is highly
7342 dependent on the memory access patterns used by the application
7343 and the size of the external cache on the machine.
7344
7345 Valid options for @var{time} are
7346
7347 @table @samp
7348 @item @var{number}
7349 A decimal number representing clock cycles.
7350
7351 @item L1
7352 @itemx L2
7353 @itemx L3
7354 @itemx main
7355 The compiler contains estimates of the number of clock cycles for
7356 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
7357 (also called Dcache, Scache, and Bcache), as well as to main memory.
7358 Note that L3 is only valid for EV5.
7359
7360 @end table
7361 @end table
7362
7363 @node Clipper Options
7364 @subsection Clipper Options
7365
7366 These @samp{-m} options are defined for the Clipper implementations:
7367
7368 @table @gcctabopt
7369 @item -mc300
7370 Produce code for a C300 Clipper processor. This is the default.
7371
7372 @item -mc400
7373 Produce code for a C400 Clipper processor i.e. use floating point
7374 registers f8..f15.
7375 @end table
7376
7377 @node H8/300 Options
7378 @subsection H8/300 Options
7379
7380 These @samp{-m} options are defined for the H8/300 implementations:
7381
7382 @table @gcctabopt
7383 @item -mrelax
7384 Shorten some address references at link time, when possible; uses the
7385 linker option @samp{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
7386 ld.info, Using ld}, for a fuller description.
7387
7388 @item -mh
7389 Generate code for the H8/300H.
7390
7391 @item -ms
7392 Generate code for the H8/S.
7393
7394 @item -ms2600
7395 Generate code for the H8/S2600.  This switch must be used with -ms.
7396
7397 @item -mint32
7398 Make @code{int} data 32 bits by default.
7399
7400 @item -malign-300
7401 On the H8/300H and H8/S, use the same alignment rules as for the H8/300.
7402 The default for the H8/300H and H8/S is to align longs and floats on 4
7403 byte boundaries.
7404 @samp{-malign-300} causes them to be aligned on 2 byte boundaries.
7405 This option has no effect on the H8/300.
7406 @end table
7407
7408 @node SH Options
7409 @subsection SH Options
7410
7411 These @samp{-m} options are defined for the SH implementations:
7412
7413 @table @gcctabopt
7414 @item -m1
7415 Generate code for the SH1.
7416
7417 @item -m2
7418 Generate code for the SH2.
7419
7420 @item -m3
7421 Generate code for the SH3.
7422
7423 @item -m3e
7424 Generate code for the SH3e.
7425
7426 @item -m4-nofpu
7427 Generate code for the SH4 without a floating-point unit.
7428
7429 @item -m4-single-only
7430 Generate code for the SH4 with a floating-point unit that only
7431 supports single-precision arithmentic.
7432
7433 @item -m4-single
7434 Generate code for the SH4 assuming the floating-point unit is in
7435 single-precision mode by default.
7436
7437 @item -m4
7438 Generate code for the SH4.
7439
7440 @item -mb
7441 Compile code for the processor in big endian mode.
7442
7443 @item -ml
7444 Compile code for the processor in little endian mode.
7445
7446 @item -mdalign
7447 Align doubles at 64-bit boundaries.  Note that this changes the calling
7448 conventions, and thus some functions from the standard C library will
7449 not work unless you recompile it first with -mdalign.
7450
7451 @item -mrelax
7452 Shorten some address references at link time, when possible; uses the
7453 linker option @samp{-relax}.
7454
7455 @item -mbigtable
7456 Use 32-bit offsets in @code{switch} tables.  The default is to use
7457 16-bit offsets.
7458
7459 @item -mfmovd
7460 Enable the use of the instruction @code{fmovd}.
7461
7462 @item -mhitachi
7463 Comply with the calling conventions defined by Hitachi.
7464
7465 @item -mnomacsave
7466 Mark the @code{MAC} register as call-clobbered, even if
7467 @option{-mhitachi} is given.
7468
7469 @item -misize
7470 Dump instruction size and location in the assembly code.
7471
7472 @item -mpadstruct
7473 This option is deprecated.  It pads structures to multiple of 4 bytes,
7474 which is incompatible with the SH ABI.
7475
7476 @item -mspace
7477 Optimize for space instead of speed.  Implied by @option{-Os}.
7478
7479 @item -mprefergot
7480 When generating position-independent code, emit function calls using
7481 the Global Offset Table instead of the Procedure Linkage Table.
7482
7483 @item -musermode
7484 Generate a library function call to invalidate instruction cache
7485 entries, after fixing up a trampoline.  This library function call
7486 doesn't assume it can write to the whole memory address space.  This
7487 is the default when the target is @code{sh-*-linux*}.
7488 @end table
7489
7490 @node System V Options
7491 @subsection Options for System V
7492
7493 These additional options are available on System V Release 4 for
7494 compatibility with other compilers on those systems:
7495
7496 @table @gcctabopt
7497 @item -G
7498 Create a shared object.
7499 It is recommended that @samp{-symbolic} or @samp{-shared} be used instead.
7500
7501 @item -Qy
7502 Identify the versions of each tool used by the compiler, in a
7503 @code{.ident} assembler directive in the output.
7504
7505 @item -Qn
7506 Refrain from adding @code{.ident} directives to the output file (this is
7507 the default).
7508
7509 @item -YP\,@var{dirs}
7510 Search the directories @var{dirs}, and no others, for libraries
7511 specified with @samp{-l}.
7512
7513 @item -Ym\,@var{dir}
7514 Look in the directory @var{dir} to find the M4 preprocessor.
7515 The assembler uses this option.
7516 @c This is supposed to go with a -Yd for predefined M4 macro files, but
7517 @c the generic assembler that comes with Solaris takes just -Ym.
7518 @end table
7519
7520 @node TMS320C3x/C4x Options
7521 @subsection TMS320C3x/C4x Options
7522 @cindex TMS320C3x/C4x Options
7523
7524 These @samp{-m} options are defined for TMS320C3x/C4x implementations:
7525
7526 @table @gcctabopt
7527
7528 @item -mcpu=@var{cpu_type}
7529 Set the instruction set, register set, and instruction scheduling
7530 parameters for machine type @var{cpu_type}.  Supported values for
7531 @var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
7532 @samp{c44}.  The default is @samp{c40} to generate code for the
7533 TMS320C40.
7534
7535 @item -mbig-memory
7536 @item -mbig
7537 @itemx -msmall-memory
7538 @itemx -msmall
7539 Generates code for the big or small memory model.  The small memory
7540 model assumed that all data fits into one 64K word page.  At run-time
7541 the data page (DP) register must be set to point to the 64K page
7542 containing the .bss and .data program sections.  The big memory model is
7543 the default and requires reloading of the DP register for every direct
7544 memory access.
7545
7546 @item -mbk
7547 @itemx -mno-bk
7548 Allow (disallow) allocation of general integer operands into the block
7549 count register BK.
7550
7551 @item -mdb
7552 @itemx -mno-db
7553 Enable (disable) generation of code using decrement and branch,
7554 DBcond(D), instructions.  This is enabled by default for the C4x.  To be
7555 on the safe side, this is disabled for the C3x, since the maximum
7556 iteration count on the C3x is 2^23 + 1 (but who iterates loops more than
7557 2^23 times on the C3x?).  Note that GCC will try to reverse a loop so
7558 that it can utilise the decrement and branch instruction, but will give
7559 up if there is more than one memory reference in the loop.  Thus a loop
7560 where the loop counter is decremented can generate slightly more
7561 efficient code, in cases where the RPTB instruction cannot be utilised.
7562
7563 @item -mdp-isr-reload
7564 @itemx -mparanoid
7565 Force the DP register to be saved on entry to an interrupt service
7566 routine (ISR), reloaded to point to the data section, and restored on
7567 exit from the ISR.  This should not be required unless someone has
7568 violated the small memory model by modifying the DP register, say within
7569 an object library.
7570
7571 @item -mmpyi
7572 @itemx -mno-mpyi
7573 For the C3x use the 24-bit MPYI instruction for integer multiplies
7574 instead of a library call to guarantee 32-bit results.  Note that if one
7575 of the operands is a constant, then the multiplication will be performed
7576 using shifts and adds.  If the -mmpyi option is not specified for the C3x,
7577 then squaring operations are performed inline instead of a library call.
7578
7579 @item -mfast-fix
7580 @itemx -mno-fast-fix
7581 The C3x/C4x FIX instruction to convert a floating point value to an
7582 integer value chooses the nearest integer less than or equal to the
7583 floating point value rather than to the nearest integer.  Thus if the
7584 floating point number is negative, the result will be incorrectly
7585 truncated an additional code is necessary to detect and correct this
7586 case.  This option can be used to disable generation of the additional
7587 code required to correct the result.
7588
7589 @item -mrptb
7590 @itemx -mno-rptb
7591 Enable (disable) generation of repeat block sequences using the RPTB
7592 instruction for zero overhead looping.  The RPTB construct is only used
7593 for innermost loops that do not call functions or jump across the loop
7594 boundaries.  There is no advantage having nested RPTB loops due to the
7595 overhead required to save and restore the RC, RS, and RE registers.
7596 This is enabled by default with -O2.
7597
7598 @item -mrpts=@var{count}
7599 @itemx -mno-rpts
7600 Enable (disable) the use of the single instruction repeat instruction
7601 RPTS.  If a repeat block contains a single instruction, and the loop
7602 count can be guaranteed to be less than the value @var{count}, GCC will
7603 emit a RPTS instruction instead of a RPTB.  If no value is specified,
7604 then a RPTS will be emitted even if the loop count cannot be determined
7605 at compile time.  Note that the repeated instruction following RPTS does
7606 not have to be reloaded from memory each iteration, thus freeing up the
7607 CPU buses for operands.  However, since interrupts are blocked by this
7608 instruction, it is disabled by default.
7609
7610 @item -mloop-unsigned
7611 @itemx -mno-loop-unsigned
7612 The maximum iteration count when using RPTS and RPTB (and DB on the C40)
7613 is 2^31 + 1 since these instructions test if the iteration count is
7614 negative to terminate the loop.  If the iteration count is unsigned
7615 there is a possibility than the 2^31 + 1 maximum iteration count may be
7616 exceeded.  This switch allows an unsigned iteration count.
7617
7618 @item -mti
7619 Try to emit an assembler syntax that the TI assembler (asm30) is happy
7620 with.  This also enforces compatibility with the API employed by the TI
7621 C3x C compiler.  For example, long doubles are passed as structures
7622 rather than in floating point registers.
7623
7624 @item -mregparm
7625 @itemx -mmemparm
7626 Generate code that uses registers (stack) for passing arguments to functions.
7627 By default, arguments are passed in registers where possible rather
7628 than by pushing arguments on to the stack.
7629
7630 @item -mparallel-insns
7631 @itemx -mno-parallel-insns
7632 Allow the generation of parallel instructions.  This is enabled by
7633 default with -O2.
7634
7635 @item -mparallel-mpy
7636 @itemx -mno-parallel-mpy
7637 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
7638 provided -mparallel-insns is also specified.  These instructions have
7639 tight register constraints which can pessimize the code generation
7640 of large functions.
7641
7642 @end table
7643
7644 @node V850 Options
7645 @subsection V850 Options
7646 @cindex V850 Options
7647
7648 These @samp{-m} options are defined for V850 implementations:
7649
7650 @table @gcctabopt
7651 @item -mlong-calls
7652 @itemx -mno-long-calls
7653 Treat all calls as being far away (near).  If calls are assumed to be
7654 far away, the compiler will always load the functions address up into a
7655 register, and call indirect through the pointer.
7656
7657 @item -mno-ep
7658 @itemx -mep
7659 Do not optimize (do optimize) basic blocks that use the same index
7660 pointer 4 or more times to copy pointer into the @code{ep} register, and
7661 use the shorter @code{sld} and @code{sst} instructions.  The @samp{-mep}
7662 option is on by default if you optimize.
7663
7664 @item -mno-prolog-function
7665 @itemx -mprolog-function
7666 Do not use (do use) external functions to save and restore registers at
7667 the prolog and epilog of a function.  The external functions are slower,
7668 but use less code space if more than one function saves the same number
7669 of registers.  The @samp{-mprolog-function} option is on by default if
7670 you optimize.
7671
7672 @item -mspace
7673 Try to make the code as small as possible.  At present, this just turns
7674 on the @samp{-mep} and @samp{-mprolog-function} options.
7675
7676 @item -mtda=@var{n}
7677 Put static or global variables whose size is @var{n} bytes or less into
7678 the tiny data area that register @code{ep} points to.  The tiny data
7679 area can hold up to 256 bytes in total (128 bytes for byte references).
7680
7681 @item -msda=@var{n}
7682 Put static or global variables whose size is @var{n} bytes or less into
7683 the small data area that register @code{gp} points to.  The small data
7684 area can hold up to 64 kilobytes.
7685
7686 @item -mzda=@var{n}
7687 Put static or global variables whose size is @var{n} bytes or less into
7688 the first 32 kilobytes of memory.
7689
7690 @item -mv850
7691 Specify that the target processor is the V850.
7692
7693 @item -mbig-switch
7694 Generate code suitable for big switch tables.  Use this option only if
7695 the assembler/linker complain about out of range branches within a switch
7696 table.
7697 @end table
7698
7699 @node ARC Options
7700 @subsection ARC Options
7701 @cindex ARC Options
7702
7703 These options are defined for ARC implementations:
7704
7705 @table @gcctabopt
7706 @item -EL
7707 Compile code for little endian mode.  This is the default.
7708
7709 @item -EB
7710 Compile code for big endian mode.
7711
7712 @item -mmangle-cpu
7713 Prepend the name of the cpu to all public symbol names.
7714 In multiple-processor systems, there are many ARC variants with different
7715 instruction and register set characteristics.  This flag prevents code
7716 compiled for one cpu to be linked with code compiled for another.
7717 No facility exists for handling variants that are "almost identical".
7718 This is an all or nothing option.
7719
7720 @item -mcpu=@var{cpu}
7721 Compile code for ARC variant @var{cpu}.
7722 Which variants are supported depend on the configuration.
7723 All variants support @samp{-mcpu=base}, this is the default.
7724
7725 @item -mtext=@var{text section}
7726 @itemx -mdata=@var{data section}
7727 @itemx -mrodata=@var{readonly data section}
7728 Put functions, data, and readonly data in @var{text section},
7729 @var{data section}, and @var{readonly data section} respectively
7730 by default.  This can be overridden with the @code{section} attribute.
7731 @xref{Variable Attributes}.
7732
7733 @end table
7734
7735 @node NS32K Options
7736 @subsection NS32K Options
7737 @cindex NS32K options
7738
7739 These are the @samp{-m} options defined for the 32000 series.  The default
7740 values for these options depends on which style of 32000 was selected when
7741 the compiler was configured; the defaults for the most common choices are
7742 given below.
7743
7744 @table @gcctabopt
7745 @item -m32032
7746 @itemx -m32032
7747 Generate output for a 32032.  This is the default
7748 when the compiler is configured for 32032 and 32016 based systems.
7749
7750 @item -m32332
7751 @itemx -m32332
7752 Generate output for a 32332.  This is the default
7753 when the compiler is configured for 32332-based systems.
7754
7755 @item -m32532
7756 @itemx -m32532
7757 Generate output for a 32532.  This is the default
7758 when the compiler is configured for 32532-based systems.
7759
7760 @item -m32081
7761 Generate output containing 32081 instructions for floating point.
7762 This is the default for all systems.
7763
7764 @item -m32381
7765 Generate output containing 32381 instructions for floating point.  This
7766 also implies @samp{-m32081}. The 32381 is only compatible with the 32332
7767 and 32532 cpus. This is the default for the pc532-netbsd configuration.
7768
7769 @item -mmulti-add
7770 Try and generate multiply-add floating point instructions @code{polyF}
7771 and @code{dotF}. This option is only available if the @samp{-m32381}
7772 option is in effect. Using these instructions requires changes to to
7773 register allocation which generally has a negative impact on
7774 performance.  This option should only be enabled when compiling code
7775 particularly likely to make heavy use of multiply-add instructions.
7776
7777 @item -mnomulti-add
7778 Do not try and generate multiply-add floating point instructions
7779 @code{polyF} and @code{dotF}. This is the default on all platforms.
7780
7781 @item -msoft-float
7782 Generate output containing library calls for floating point.
7783 @strong{Warning:} the requisite libraries may not be available.
7784
7785 @item -mnobitfield
7786 Do not use the bit-field instructions. On some machines it is faster to
7787 use shifting and masking operations. This is the default for the pc532.
7788
7789 @item -mbitfield
7790 Do use the bit-field instructions. This is the default for all platforms
7791 except the pc532.
7792
7793 @item -mrtd
7794 Use a different function-calling convention, in which functions
7795 that take a fixed number of arguments return pop their
7796 arguments on return with the @code{ret} instruction.
7797
7798 This calling convention is incompatible with the one normally
7799 used on Unix, so you cannot use it if you need to call libraries
7800 compiled with the Unix compiler.
7801
7802 Also, you must provide function prototypes for all functions that
7803 take variable numbers of arguments (including @code{printf});
7804 otherwise incorrect code will be generated for calls to those
7805 functions.
7806
7807 In addition, seriously incorrect code will result if you call a
7808 function with too many arguments.  (Normally, extra arguments are
7809 harmlessly ignored.)
7810
7811 This option takes its name from the 680x0 @code{rtd} instruction.
7812
7813
7814 @item -mregparam
7815 Use a different function-calling convention where the first two arguments
7816 are passed in registers.
7817
7818 This calling convention is incompatible with the one normally
7819 used on Unix, so you cannot use it if you need to call libraries
7820 compiled with the Unix compiler.
7821
7822 @item -mnoregparam
7823 Do not pass any arguments in registers. This is the default for all
7824 targets.
7825
7826 @item -msb
7827 It is OK to use the sb as an index register which is always loaded with
7828 zero. This is the default for the pc532-netbsd target.
7829
7830 @item -mnosb
7831 The sb register is not available for use or has not been initialized to
7832 zero by the run time system. This is the default for all targets except
7833 the pc532-netbsd. It is also implied whenever @samp{-mhimem} or
7834 @samp{-fpic} is set.
7835
7836 @item -mhimem
7837 Many ns32000 series addressing modes use displacements of up to 512MB.
7838 If an address is above 512MB then displacements from zero can not be used.
7839 This option causes code to be generated which can be loaded above 512MB.
7840 This may be useful for operating systems or ROM code.
7841
7842 @item -mnohimem
7843 Assume code will be loaded in the first 512MB of virtual address space.
7844 This is the default for all platforms.
7845
7846
7847 @end table
7848
7849 @node AVR Options
7850 @subsection AVR Options
7851 @cindex AVR Options
7852
7853 These options are defined for AVR implementations:
7854
7855 @table @gcctabopt
7856 @item -mmcu=@var{mcu}
7857 Specify ATMEL AVR instruction set or MCU type.
7858
7859 Instruction set avr1 is for the minimal AVR core, not supported by the C
7860 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
7861 attiny11, attiny12, attiny15, attiny28).
7862
7863 Instruction set avr2 (default) is for the classic AVR core with up to
7864 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
7865 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
7866 at90c8534, at90s8535).
7867
7868 Instruction set avr3 is for the classic AVR core with up to 128K program
7869 memory space (MCU types: atmega103, atmega603).
7870
7871 Instruction set avr4 is for the enhanced AVR core with up to 8K program
7872 memory space (MCU types: atmega83, atmega85).
7873
7874 Instruction set avr5 is for the enhanced AVR core with up to 128K program
7875 memory space (MCU types: atmega161, atmega163, atmega32, at94k).
7876
7877 @item -msize
7878 Output instruction sizes to the asm file.
7879
7880 @item -minit-stack=@var{N}
7881 Specify the initial stack address, which may be a symbol or numeric value,
7882 __stack is the default.
7883
7884 @item -mno-interrupts
7885 Generated code is not compatible with hardware interrupts.
7886 Code size will be smaller.
7887
7888 @item -mcall-prologues
7889 Functions prologues/epilogues expanded as call to appropriate
7890 subroutines. Code size will be smaller.
7891
7892 @item -mno-tablejump
7893 Do not generate tablejump insns which sometimes increase code size.
7894
7895 @item -mtiny-stack
7896 Change only the low 8 bits of the stack pointer.
7897 @end table
7898
7899 @node MCore Options
7900 @subsection MCore Options
7901 @cindex MCore options
7902
7903 These are the @samp{-m} options defined for the Motorola M*Core
7904 processors.
7905
7906 @table @gcctabopt
7907
7908 @item -mhardlit
7909 @itemx -mhardlit
7910 @itemx -mno-hardlit
7911 Inline constants into the code stream if it can be done in two
7912 instructions or less.
7913
7914 @item -mdiv
7915 @itemx -mdiv
7916 @itemx -mno-div
7917 Use the divide instruction.  (Enabled by default).
7918
7919 @item -mrelax-immediate
7920 @itemx -mrelax-immediate
7921 @itemx -mno-relax-immediate
7922 Allow arbitrary sized immediates in bit operations.
7923
7924 @item -mwide-bitfields
7925 @itemx -mwide-bitfields
7926 @itemx -mno-wide-bitfields
7927 Always treat bitfields as int-sized.
7928
7929 @item -m4byte-functions
7930 @itemx -m4byte-functions
7931 @itemx -mno-4byte-functions
7932 Force all functions to be aligned to a four byte boundary.
7933
7934 @item -mcallgraph-data
7935 @itemx -mcallgraph-data
7936 @itemx -mno-callgraph-data
7937 Emit callgraph information.
7938
7939 @item -mslow-bytes
7940 @itemx -mslow-bytes
7941 @itemx -mno-slow-bytes
7942 Prefer word access when reading byte quantities.
7943
7944 @item -mlittle-endian
7945 @itemx -mlittle-endian
7946 @itemx -mbig-endian
7947 Generate code for a little endian target.
7948
7949 @item -m210
7950 @itemx -m210
7951 @itemx -m340
7952 Generate code for the 210 processor.
7953 @end table
7954
7955 @node IA-64 Options
7956 @subsection IA-64 Options
7957 @cindex IA-64 Options
7958
7959 These are the @samp{-m} options defined for the Intel IA-64 architecture.
7960
7961 @table @gcctabopt
7962 @item -mbig-endian
7963 Generate code for a big endian target.  This is the default for HPUX.
7964
7965 @item -mlittle-endian
7966 Generate code for a little endian target.  This is the default for AIX5
7967 and Linux.
7968
7969 @item -mgnu-as
7970 @itemx -mno-gnu-as
7971 Generate (or don't) code for the GNU assembler.  This is the default.
7972 @c Also, this is the default if the configure option @samp{--with-gnu-as}
7973 @c is used.
7974
7975 @item -mgnu-ld
7976 @itemx -mno-gnu-ld
7977 Generate (or don't) code for the GNU linker.  This is the default.
7978 @c Also, this is the default if the configure option @samp{--with-gnu-ld}
7979 @c is used.
7980
7981 @item -mno-pic
7982 Generate code that does not use a global pointer register.  The result
7983 is not position independent code, and violates the IA-64 ABI.
7984
7985 @item -mvolatile-asm-stop
7986 @itemx -mno-volatile-asm-stop
7987 Generate (or don't) a stop bit immediately before and after volatile asm
7988 statements.
7989
7990 @item -mb-step
7991 Generate code that works around Itanium B step errata.
7992
7993 @item -mregister-names
7994 @itemx -mno-register-names
7995 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
7996 the stacked registers.  This may make assembler output more readable.
7997
7998 @item -mno-sdata
7999 @itemx -msdata
8000 Disable (or enable) optimizations that use the small data section.  This may
8001 be useful for working around optimizer bugs.
8002
8003 @item -mconstant-gp
8004 Generate code that uses a single constant global pointer value.  This is
8005 useful when compiling kernel code.
8006
8007 @item -mauto-pic
8008 Generate code that is self-relocatable.  This implies @samp{-mconstant-gp}.
8009 This is useful when compiling firmware code.
8010
8011 @item -minline-divide-min-latency
8012 Generate code for inline divides using the minimum latency algorithm.
8013
8014 @item -minline-divide-max-throughput
8015 Generate code for inline divides using the maximum throughput algorithm.
8016
8017 @item -mno-dwarf2-asm
8018 @itemx -mdwarf2-asm
8019 Don't (or do) generate assembler code for the DWARF2 line number debugging
8020 info.  This may be useful when not using the GNU assembler.
8021
8022 @item -mfixed-range=@var{register range}
8023 Generate code treating the given register range as fixed registers.
8024 A fixed register is one that the register allocator can not use.  This is
8025 useful when compiling kernel code.  A register range is specified as
8026 two registers separated by a dash.  Multiple register ranges can be
8027 specified separated by a comma.
8028 @end table
8029
8030 @node D30V Options
8031 @subsection D30V Options
8032 @cindex D30V Options
8033
8034 These @samp{-m} options are defined for D30V implementations:
8035
8036 @table @gcctabopt
8037 @item -mextmem
8038 Link the @samp{.text}, @samp{.data}, @samp{.bss}, @samp{.strings},
8039 @samp{.rodata}, @samp{.rodata1}, @samp{.data1} sections into external
8040 memory, which starts at location @code{0x80000000}.
8041
8042 @item -mextmemory
8043 Same as the @samp{-mextmem} switch.
8044
8045 @item -monchip
8046 Link the @samp{.text} section into onchip text memory, which starts at
8047 location @code{0x0}.  Also link @samp{.data}, @samp{.bss},
8048 @samp{.strings}, @samp{.rodata}, @samp{.rodata1}, @samp{.data1} sections
8049 into onchip data memory, which starts at location @code{0x20000000}.
8050
8051 @item -mno-asm-optimize
8052 @itemx -masm-optimize
8053 Disable (enable) passing @samp{-O} to the assembler when optimizing.
8054 The assembler uses the @samp{-O} option to automatically parallelize
8055 adjacent short instructions where possible.
8056
8057 @item -mbranch-cost=@var{n}
8058 Increase the internal costs of branches to @var{n}.  Higher costs means
8059 that the compiler will issue more instructions to avoid doing a branch.
8060 The default is 2.
8061
8062 @item -mcond-exec=@var{n}
8063 Specify the maximum number of conditionally executed instructions that
8064 replace a branch.  The default is 4.
8065 @end table
8066
8067 @node Code Gen Options
8068 @section Options for Code Generation Conventions
8069 @cindex code generation conventions
8070 @cindex options, code generation
8071 @cindex run-time options
8072
8073 These machine-independent options control the interface conventions
8074 used in code generation.
8075
8076 Most of them have both positive and negative forms; the negative form
8077 of @samp{-ffoo} would be @samp{-fno-foo}.  In the table below, only
8078 one of the forms is listed---the one which is not the default.  You
8079 can figure out the other form by either removing @samp{no-} or adding
8080 it.
8081
8082 @table @gcctabopt
8083 @item -fexceptions
8084 Enable exception handling. Generates extra code needed to propagate
8085 exceptions.  For some targets, this implies GNU CC will generate frame
8086 unwind information for all functions, which can produce significant data
8087 size overhead, although it does not affect execution.  If you do not
8088 specify this option, GNU CC will enable it by default for languages like
8089 C++ which normally require exception handling, and disable it for
8090 languages like C that do not normally require it.  However, you may need
8091 to enable this option when compiling C code that needs to interoperate
8092 properly with exception handlers written in C++.  You may also wish to
8093 disable this option if you are compiling older C++ programs that don't
8094 use exception handling.
8095
8096 @item -funwind-tables
8097 Similar to @option{-fexceptions}, except that it will just generate any needed
8098 static data, but will not affect the generated code in any other way.
8099 You will normally not enable this option; instead, a language processor
8100 that needs this handling would enable it on your behalf.
8101
8102 @item -fpcc-struct-return
8103 Return ``short'' @code{struct} and @code{union} values in memory like
8104 longer ones, rather than in registers.  This convention is less
8105 efficient, but it has the advantage of allowing intercallability between
8106 GCC-compiled files and files compiled with other compilers.
8107
8108 The precise convention for returning structures in memory depends
8109 on the target configuration macros.
8110
8111 Short structures and unions are those whose size and alignment match
8112 that of some integer type.
8113
8114 @item -freg-struct-return
8115 Use the convention that @code{struct} and @code{union} values are
8116 returned in registers when possible.  This is more efficient for small
8117 structures than @samp{-fpcc-struct-return}.
8118
8119 If you specify neither @samp{-fpcc-struct-return} nor its contrary
8120 @samp{-freg-struct-return}, GCC defaults to whichever convention is
8121 standard for the target.  If there is no standard convention, GCC
8122 defaults to @samp{-fpcc-struct-return}, except on targets where GCC
8123 is the principal compiler.  In those cases, we can choose the standard,
8124 and we chose the more efficient register return alternative.
8125
8126 @item -fshort-enums
8127 Allocate to an @code{enum} type only as many bytes as it needs for the
8128 declared range of possible values.  Specifically, the @code{enum} type
8129 will be equivalent to the smallest integer type which has enough room.
8130
8131 @item -fshort-double
8132 Use the same size for @code{double} as for @code{float}.
8133
8134 @item -fshared-data
8135 Requests that the data and non-@code{const} variables of this
8136 compilation be shared data rather than private data.  The distinction
8137 makes sense only on certain operating systems, where shared data is
8138 shared between processes running the same program, while private data
8139 exists in one copy per process.
8140
8141 @item -fno-common
8142 In C, allocate even uninitialized global variables in the data section of the
8143 object file, rather than generating them as common blocks.  This has the
8144 effect that if the same variable is declared (without @code{extern}) in
8145 two different compilations, you will get an error when you link them.
8146 The only reason this might be useful is if you wish to verify that the
8147 program will work on other systems which always work this way.
8148
8149 @item -fno-ident
8150 Ignore the @samp{#ident} directive.
8151
8152 @item -fno-gnu-linker
8153 Do not output global initializations (such as C++ constructors and
8154 destructors) in the form used by the GNU linker (on systems where the GNU
8155 linker is the standard method of handling them).  Use this option when
8156 you want to use a non-GNU linker, which also requires using the
8157 @command{collect2} program to make sure the system linker includes
8158 constructors and destructors.  (@command{collect2} is included in the GCC
8159 distribution.)  For systems which @emph{must} use @command{collect2}, the
8160 compiler driver @command{gcc} is configured to do this automatically.
8161
8162 @item -finhibit-size-directive
8163 Don't output a @code{.size} assembler directive, or anything else that
8164 would cause trouble if the function is split in the middle, and the
8165 two halves are placed at locations far apart in memory.  This option is
8166 used when compiling @file{crtstuff.c}; you should not need to use it
8167 for anything else.
8168
8169 @item -fverbose-asm
8170 Put extra commentary information in the generated assembly code to
8171 make it more readable.  This option is generally only of use to those
8172 who actually need to read the generated assembly code (perhaps while
8173 debugging the compiler itself).
8174
8175 @samp{-fno-verbose-asm}, the default, causes the
8176 extra information to be omitted and is useful when comparing two assembler
8177 files.
8178
8179 @item -fvolatile
8180 Consider all memory references through pointers to be volatile.
8181
8182 @item -fvolatile-global
8183 Consider all memory references to extern and global data items to
8184 be volatile.  GCC does not consider static data items to be volatile
8185 because of this switch.
8186
8187 @item -fvolatile-static
8188 Consider all memory references to static data to be volatile.
8189
8190 @item -fpic
8191 @cindex global offset table
8192 @cindex PIC
8193 Generate position-independent code (PIC) suitable for use in a shared
8194 library, if supported for the target machine.  Such code accesses all
8195 constant addresses through a global offset table (GOT).  The dynamic
8196 loader resolves the GOT entries when the program starts (the dynamic
8197 loader is not part of GCC; it is part of the operating system).  If
8198 the GOT size for the linked executable exceeds a machine-specific
8199 maximum size, you get an error message from the linker indicating that
8200 @samp{-fpic} does not work; in that case, recompile with @samp{-fPIC}
8201 instead.  (These maximums are 16k on the m88k, 8k on the Sparc, and 32k
8202 on the m68k and RS/6000.  The 386 has no such limit.)
8203
8204 Position-independent code requires special support, and therefore works
8205 only on certain machines.  For the 386, GCC supports PIC for System V
8206 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
8207 position-independent.
8208
8209 @item -fPIC
8210 If supported for the target machine, emit position-independent code,
8211 suitable for dynamic linking and avoiding any limit on the size of the
8212 global offset table.  This option makes a difference on the m68k, m88k,
8213 and the Sparc.
8214
8215 Position-independent code requires special support, and therefore works
8216 only on certain machines.
8217
8218 @item -ffixed-@var{reg}
8219 Treat the register named @var{reg} as a fixed register; generated code
8220 should never refer to it (except perhaps as a stack pointer, frame
8221 pointer or in some other fixed role).
8222
8223 @var{reg} must be the name of a register.  The register names accepted
8224 are machine-specific and are defined in the @code{REGISTER_NAMES}
8225 macro in the machine description macro file.
8226
8227 This flag does not have a negative form, because it specifies a
8228 three-way choice.
8229
8230 @item -fcall-used-@var{reg}
8231 Treat the register named @var{reg} as an allocable register that is
8232 clobbered by function calls.  It may be allocated for temporaries or
8233 variables that do not live across a call.  Functions compiled this way
8234 will not save and restore the register @var{reg}.
8235
8236 It is an error to used this flag with the frame pointer or stack pointer.
8237 Use of this flag for other registers that have fixed pervasive roles in
8238 the machine's execution model will produce disastrous results.
8239
8240 This flag does not have a negative form, because it specifies a
8241 three-way choice.
8242
8243 @item -fcall-saved-@var{reg}
8244 Treat the register named @var{reg} as an allocable register saved by
8245 functions.  It may be allocated even for temporaries or variables that
8246 live across a call.  Functions compiled this way will save and restore
8247 the register @var{reg} if they use it.
8248
8249 It is an error to used this flag with the frame pointer or stack pointer.
8250 Use of this flag for other registers that have fixed pervasive roles in
8251 the machine's execution model will produce disastrous results.
8252
8253 A different sort of disaster will result from the use of this flag for
8254 a register in which function values may be returned.
8255
8256 This flag does not have a negative form, because it specifies a
8257 three-way choice.
8258
8259 @item -fpack-struct
8260 Pack all structure members together without holes.  Usually you would
8261 not want to use this option, since it makes the code suboptimal, and
8262 the offsets of structure members won't agree with system libraries.
8263
8264 @item -fcheck-memory-usage
8265 Generate extra code to check each memory access.  GCC will generate
8266 code that is suitable for a detector of bad memory accesses such as
8267 @file{Checker}.
8268
8269 Normally, you should compile all, or none, of your code with this option.
8270
8271 If you do mix code compiled with and without this option,
8272 you must ensure that all code that has side effects
8273 and that is called by code compiled with this option
8274 is, itself, compiled with this option.
8275 If you do not, you might get erroneous messages from the detector.
8276
8277 If you use functions from a library that have side-effects (such as
8278 @code{read}), you might not be able to recompile the library and
8279 specify this option.  In that case, you can enable the
8280 @samp{-fprefix-function-name} option, which requests GCC to encapsulate
8281 your code and make other functions look as if they were compiled with
8282 @samp{-fcheck-memory-usage}.  This is done by calling ``stubs'',
8283 which are provided by the detector.  If you cannot find or build
8284 stubs for every function you call, you might have to specify
8285 @samp{-fcheck-memory-usage} without @samp{-fprefix-function-name}.
8286
8287 If you specify this option, you can not use the @code{asm} or
8288 @code{__asm__} keywords in functions with memory checking enabled.  GNU
8289 CC cannot understand what the @code{asm} statement may do, and therefore
8290 cannot generate the appropriate code, so it will reject it.  However, if
8291 you specify the function attribute @code{no_check_memory_usage}
8292 (@pxref{Function Attributes}), GNU CC will disable memory checking within a
8293 function; you may use @code{asm} statements inside such functions.  You
8294 may have an inline expansion of a non-checked function within a checked
8295 function; in that case GNU CC will not generate checks for the inlined
8296 function's memory accesses.
8297
8298 If you move your @code{asm} statements to non-checked inline functions
8299 and they do access memory, you can add calls to the support code in your
8300 inline function, to indicate any reads, writes, or copies being done.
8301 These calls would be similar to those done in the stubs described above.
8302
8303 @item -fprefix-function-name
8304 Request GCC to add a prefix to the symbols generated for function names.
8305 GCC adds a prefix to the names of functions defined as well as
8306 functions called.  Code compiled with this option and code compiled
8307 without the option can't be linked together, unless stubs are used.
8308
8309 If you compile the following code with @samp{-fprefix-function-name}
8310 @example
8311 extern void bar (int);
8312 void
8313 foo (int a)
8314 @{
8315   return bar (a + 5);
8316 @}
8317 @end example
8318
8319 @noindent
8320 GCC will compile the code as if it was written:
8321 @example
8322 extern void prefix_bar (int);
8323 void
8324 prefix_foo (int a)
8325 @{
8326   return prefix_bar (a + 5);
8327 @}
8328 @end example
8329 This option is designed to be used with @samp{-fcheck-memory-usage}.
8330
8331 @item -finstrument-functions
8332 Generate instrumentation calls for entry and exit to functions.  Just
8333 after function entry and just before function exit, the following
8334 profiling functions will be called with the address of the current
8335 function and its call site.  (On some platforms,
8336 @code{__builtin_return_address} does not work beyond the current
8337 function, so the call site information may not be available to the
8338 profiling functions otherwise.)
8339
8340 @example
8341 void __cyg_profile_func_enter (void *this_fn, void *call_site);
8342 void __cyg_profile_func_exit  (void *this_fn, void *call_site);
8343 @end example
8344
8345 The first argument is the address of the start of the current function,
8346 which may be looked up exactly in the symbol table.
8347
8348 This instrumentation is also done for functions expanded inline in other
8349 functions.  The profiling calls will indicate where, conceptually, the
8350 inline function is entered and exited.  This means that addressable
8351 versions of such functions must be available.  If all your uses of a
8352 function are expanded inline, this may mean an additional expansion of
8353 code size.  If you use @samp{extern inline} in your C code, an
8354 addressable version of such functions must be provided.  (This is
8355 normally the case anyways, but if you get lucky and the optimizer always
8356 expands the functions inline, you might have gotten away without
8357 providing static copies.)
8358
8359 A function may be given the attribute @code{no_instrument_function}, in
8360 which case this instrumentation will not be done.  This can be used, for
8361 example, for the profiling functions listed above, high-priority
8362 interrupt routines, and any functions from which the profiling functions
8363 cannot safely be called (perhaps signal handlers, if the profiling
8364 routines generate output or allocate memory).
8365
8366 @item -fstack-check
8367 Generate code to verify that you do not go beyond the boundary of the
8368 stack.  You should specify this flag if you are running in an
8369 environment with multiple threads, but only rarely need to specify it in
8370 a single-threaded environment since stack overflow is automatically
8371 detected on nearly all systems if there is only one stack.
8372
8373 Note that this switch does not actually cause checking to be done; the
8374 operating system must do that.  The switch causes generation of code
8375 to ensure that the operating system sees the stack being extended.
8376
8377 @item -fstack-limit-register=@var{reg}
8378 @itemx -fstack-limit-symbol=@var{sym}
8379 @itemx -fno-stack-limit
8380 Generate code to ensure that the stack does not grow beyond a certain value,
8381 either the value of a register or the address of a symbol.  If the stack
8382 would grow beyond the value, a signal is raised.  For most targets,
8383 the signal is raised before the stack overruns the boundary, so
8384 it is possible to catch the signal without taking special precautions.
8385
8386 For instance, if the stack starts at address @samp{0x80000000} and grows
8387 downwards you can use the flags
8388 @samp{-fstack-limit-symbol=__stack_limit}
8389 @samp{-Wl,--defsym,__stack_limit=0x7ffe0000} which will enforce a stack
8390 limit of 128K.
8391
8392 @cindex aliasing of parameters
8393 @cindex parameters, aliased
8394 @item -fargument-alias
8395 @itemx -fargument-noalias
8396 @itemx -fargument-noalias-global
8397 Specify the possible relationships among parameters and between
8398 parameters and global data.
8399
8400 @samp{-fargument-alias} specifies that arguments (parameters) may
8401 alias each other and may alias global storage.
8402 @samp{-fargument-noalias} specifies that arguments do not alias
8403 each other, but may alias global storage.
8404 @samp{-fargument-noalias-global} specifies that arguments do not
8405 alias each other and do not alias global storage.
8406
8407 Each language will automatically use whatever option is required by
8408 the language standard.  You should not need to use these options yourself.
8409
8410 @item -fleading-underscore
8411 This option and its counterpart, -fno-leading-underscore, forcibly
8412 change the way C symbols are represented in the object file.  One use
8413 is to help link with legacy assembly code.
8414
8415 Be warned that you should know what you are doing when invoking this
8416 option, and that not all targets provide complete support for it.
8417 @end table
8418
8419 @c man end
8420
8421 @node Environment Variables
8422 @section Environment Variables Affecting GCC
8423 @cindex environment variables
8424
8425 @c man begin ENVIRONMENT
8426
8427 This section describes several environment variables that affect how GCC
8428 operates.  Some of them work by specifying directories or prefixes to use
8429 when searching for various kinds of files. Some are used to specify other
8430 aspects of the compilation environment.
8431
8432 @ifclear INTERNALS
8433 Note that you can also specify places to search using options such as
8434 @samp{-B}, @samp{-I} and @samp{-L} (@pxref{Directory Options}).  These
8435 take precedence over places specified using environment variables, which
8436 in turn take precedence over those specified by the configuration of GCC.
8437
8438 @end ifclear
8439 @ifset INTERNALS
8440 Note that you can also specify places to search using options such as
8441 @samp{-B}, @samp{-I} and @samp{-L} (@pxref{Directory Options}).  These
8442 take precedence over places specified using environment variables, which
8443 in turn take precedence over those specified by the configuration of GCC.
8444 @xref{Driver}.
8445 @end ifset
8446
8447 @table @env
8448 @item LANG
8449 @itemx LC_CTYPE
8450 @c @itemx LC_COLLATE
8451 @itemx LC_MESSAGES
8452 @c @itemx LC_MONETARY
8453 @c @itemx LC_NUMERIC
8454 @c @itemx LC_TIME
8455 @itemx LC_ALL
8456 @findex LANG
8457 @findex LC_CTYPE
8458 @c @findex LC_COLLATE
8459 @findex LC_MESSAGES
8460 @c @findex LC_MONETARY
8461 @c @findex LC_NUMERIC
8462 @c @findex LC_TIME
8463 @findex LC_ALL
8464 @cindex locale
8465 These environment variables control the way that GCC uses
8466 localization information that allow GCC to work with different
8467 national conventions.  GCC inspects the locale categories
8468 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
8469 so.  These locale categories can be set to any value supported by your
8470 installation.  A typical value is @samp{en_UK} for English in the United
8471 Kingdom.
8472
8473 The @env{LC_CTYPE} environment variable specifies character
8474 classification.  GCC uses it to determine the character boundaries in
8475 a string; this is needed for some multibyte encodings that contain quote
8476 and escape characters that would otherwise be interpreted as a string
8477 end or escape.
8478
8479 The @env{LC_MESSAGES} environment variable specifies the language to
8480 use in diagnostic messages.
8481
8482 If the @env{LC_ALL} environment variable is set, it overrides the value
8483 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
8484 and @env{LC_MESSAGES} default to the value of the @env{LANG}
8485 environment variable.  If none of these variables are set, GCC
8486 defaults to traditional C English behavior.
8487
8488 @item TMPDIR
8489 @findex TMPDIR
8490 If @env{TMPDIR} is set, it specifies the directory to use for temporary
8491 files.  GCC uses temporary files to hold the output of one stage of
8492 compilation which is to be used as input to the next stage: for example,
8493 the output of the preprocessor, which is the input to the compiler
8494 proper.
8495
8496 @item GCC_EXEC_PREFIX
8497 @findex GCC_EXEC_PREFIX
8498 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
8499 names of the subprograms executed by the compiler.  No slash is added
8500 when this prefix is combined with the name of a subprogram, but you can
8501 specify a prefix that ends with a slash if you wish.
8502
8503 If @env{GCC_EXEC_PREFIX} is not set, GNU CC will attempt to figure out
8504 an appropriate prefix to use based on the pathname it was invoked with.
8505
8506 If GCC cannot find the subprogram using the specified prefix, it
8507 tries looking in the usual places for the subprogram.
8508
8509 The default value of @env{GCC_EXEC_PREFIX} is
8510 @file{@var{prefix}/lib/gcc-lib/} where @var{prefix} is the value
8511 of @code{prefix} when you ran the @file{configure} script.
8512
8513 Other prefixes specified with @samp{-B} take precedence over this prefix.
8514
8515 This prefix is also used for finding files such as @file{crt0.o} that are
8516 used for linking.
8517
8518 In addition, the prefix is used in an unusual way in finding the
8519 directories to search for header files.  For each of the standard
8520 directories whose name normally begins with @samp{/usr/local/lib/gcc-lib}
8521 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
8522 replacing that beginning with the specified prefix to produce an
8523 alternate directory name.  Thus, with @samp{-Bfoo/}, GCC will search
8524 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
8525 These alternate directories are searched first; the standard directories
8526 come next.
8527
8528 @item COMPILER_PATH
8529 @findex COMPILER_PATH
8530 The value of @env{COMPILER_PATH} is a colon-separated list of
8531 directories, much like @env{PATH}.  GCC tries the directories thus
8532 specified when searching for subprograms, if it can't find the
8533 subprograms using @env{GCC_EXEC_PREFIX}.
8534
8535 @item LIBRARY_PATH
8536 @findex LIBRARY_PATH
8537 The value of @env{LIBRARY_PATH} is a colon-separated list of
8538 directories, much like @env{PATH}.  When configured as a native compiler,
8539 GCC tries the directories thus specified when searching for special
8540 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
8541 using GCC also uses these directories when searching for ordinary
8542 libraries for the @samp{-l} option (but directories specified with
8543 @samp{-L} come first).
8544
8545 @item C_INCLUDE_PATH
8546 @itemx CPLUS_INCLUDE_PATH
8547 @itemx OBJC_INCLUDE_PATH
8548 @findex C_INCLUDE_PATH
8549 @findex CPLUS_INCLUDE_PATH
8550 @findex OBJC_INCLUDE_PATH
8551 @c @itemx OBJCPLUS_INCLUDE_PATH
8552 These environment variables pertain to particular languages.  Each
8553 variable's value is a colon-separated list of directories, much like
8554 @env{PATH}.  When GCC searches for header files, it tries the
8555 directories listed in the variable for the language you are using, after
8556 the directories specified with @samp{-I} but before the standard header
8557 file directories.
8558
8559 @item DEPENDENCIES_OUTPUT
8560 @findex DEPENDENCIES_OUTPUT
8561 @cindex dependencies for make as output
8562 If this variable is set, its value specifies how to output dependencies
8563 for Make based on the header files processed by the compiler.  This
8564 output looks much like the output from the @samp{-M} option
8565 (@pxref{Preprocessor Options}), but it goes to a separate file, and is
8566 in addition to the usual results of compilation.
8567
8568 The value of @env{DEPENDENCIES_OUTPUT} can be just a file name, in
8569 which case the Make rules are written to that file, guessing the target
8570 name from the source file name.  Or the value can have the form
8571 @samp{@var{file} @var{target}}, in which case the rules are written to
8572 file @var{file} using @var{target} as the target name.
8573
8574 @item LANG
8575 @findex LANG
8576 @cindex locale definition
8577 This variable is used to pass locale information to the compiler. One way in
8578 which this information is used is to determine the character set to be used
8579 when character literals, string literals and comments are parsed in C and C++.
8580 When the compiler is configured to allow multibyte characters,
8581 the following values for @env{LANG} are recognized:
8582
8583 @table @samp
8584 @item C-JIS
8585 Recognize JIS characters.
8586 @item C-SJIS
8587 Recognize SJIS characters.
8588 @item C-EUCJP
8589 Recognize EUCJP characters.
8590 @end table
8591
8592 If @env{LANG} is not defined, or if it has some other value, then the
8593 compiler will use mblen and mbtowc as defined by the default locale to
8594 recognize and translate multibyte characters.
8595 @end table
8596
8597 @c man end
8598
8599 @node Running Protoize
8600 @section Running Protoize
8601
8602 The program @code{protoize} is an optional part of GNU C.  You can use
8603 it to add prototypes to a program, thus converting the program to ISO
8604 C in one respect.  The companion program @code{unprotoize} does the
8605 reverse: it removes argument types from any prototypes that are found.
8606
8607 When you run these programs, you must specify a set of source files as
8608 command line arguments.  The conversion programs start out by compiling
8609 these files to see what functions they define.  The information gathered
8610 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
8611
8612 After scanning comes actual conversion.  The specified files are all
8613 eligible to be converted; any files they include (whether sources or
8614 just headers) are eligible as well.
8615
8616 But not all the eligible files are converted.  By default,
8617 @code{protoize} and @code{unprotoize} convert only source and header
8618 files in the current directory.  You can specify additional directories
8619 whose files should be converted with the @samp{-d @var{directory}}
8620 option.  You can also specify particular files to exclude with the
8621 @samp{-x @var{file}} option.  A file is converted if it is eligible, its
8622 directory name matches one of the specified directory names, and its
8623 name within the directory has not been excluded.
8624
8625 Basic conversion with @code{protoize} consists of rewriting most
8626 function definitions and function declarations to specify the types of
8627 the arguments.  The only ones not rewritten are those for varargs
8628 functions.
8629
8630 @code{protoize} optionally inserts prototype declarations at the
8631 beginning of the source file, to make them available for any calls that
8632 precede the function's definition.  Or it can insert prototype
8633 declarations with block scope in the blocks where undeclared functions
8634 are called.
8635
8636 Basic conversion with @code{unprotoize} consists of rewriting most
8637 function declarations to remove any argument types, and rewriting
8638 function definitions to the old-style pre-ISO form.
8639
8640 Both conversion programs print a warning for any function declaration or
8641 definition that they can't convert.  You can suppress these warnings
8642 with @samp{-q}.
8643
8644 The output from @code{protoize} or @code{unprotoize} replaces the
8645 original source file.  The original file is renamed to a name ending
8646 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
8647 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
8648 for DOS) file already exists, then the source file is simply discarded.
8649
8650 @code{protoize} and @code{unprotoize} both depend on GCC itself to
8651 scan the program and collect information about the functions it uses.
8652 So neither of these programs will work until GCC is installed.
8653
8654 Here is a table of the options you can use with @code{protoize} and
8655 @code{unprotoize}.  Each option works with both programs unless
8656 otherwise stated.
8657
8658 @table @code
8659 @item -B @var{directory}
8660 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
8661 usual directory (normally @file{/usr/local/lib}).  This file contains
8662 prototype information about standard system functions.  This option
8663 applies only to @code{protoize}.
8664
8665 @item -c @var{compilation-options}
8666 Use  @var{compilation-options} as the options when running @code{gcc} to
8667 produce the @samp{.X} files.  The special option @samp{-aux-info} is
8668 always passed in addition, to tell @code{gcc} to write a @samp{.X} file.
8669
8670 Note that the compilation options must be given as a single argument to
8671 @code{protoize} or @code{unprotoize}.  If you want to specify several
8672 @code{gcc} options, you must quote the entire set of compilation options
8673 to make them a single word in the shell.
8674
8675 There are certain @code{gcc} arguments that you cannot use, because they
8676 would produce the wrong kind of output.  These include @samp{-g},
8677 @samp{-O}, @samp{-c}, @samp{-S}, and @samp{-o} If you include these in
8678 the @var{compilation-options}, they are ignored.
8679
8680 @item -C
8681 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
8682 systems) instead of @samp{.c}.  This is convenient if you are converting
8683 a C program to C++.  This option applies only to @code{protoize}.
8684
8685 @item -g
8686 Add explicit global declarations.  This means inserting explicit
8687 declarations at the beginning of each source file for each function
8688 that is called in the file and was not declared.  These declarations
8689 precede the first function definition that contains a call to an
8690 undeclared function.  This option applies only to @code{protoize}.
8691
8692 @item -i @var{string}
8693 Indent old-style parameter declarations with the string @var{string}.
8694 This option applies only to @code{protoize}.
8695
8696 @code{unprotoize} converts prototyped function definitions to old-style
8697 function definitions, where the arguments are declared between the
8698 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
8699 uses five spaces as the indentation.  If you want to indent with just
8700 one space instead, use @samp{-i " "}.
8701
8702 @item -k
8703 Keep the @samp{.X} files.  Normally, they are deleted after conversion
8704 is finished.
8705
8706 @item -l
8707 Add explicit local declarations.  @code{protoize} with @samp{-l} inserts
8708 a prototype declaration for each function in each block which calls the
8709 function without any declaration.  This option applies only to
8710 @code{protoize}.
8711
8712 @item -n
8713 Make no real changes.  This mode just prints information about the conversions
8714 that would have been done without @samp{-n}.
8715
8716 @item -N
8717 Make no @samp{.save} files.  The original files are simply deleted.
8718 Use this option with caution.
8719
8720 @item -p @var{program}
8721 Use the program @var{program} as the compiler.  Normally, the name
8722 @file{gcc} is used.
8723
8724 @item -q
8725 Work quietly.  Most warnings are suppressed.
8726
8727 @item -v
8728 Print the version number, just like @samp{-v} for @code{gcc}.
8729 @end table
8730
8731 If you need special compiler options to compile one of your program's
8732 source files, then you should generate that file's @samp{.X} file
8733 specially, by running @code{gcc} on that source file with the
8734 appropriate options and the option @samp{-aux-info}.  Then run
8735 @code{protoize} on the entire set of files.  @code{protoize} will use
8736 the existing @samp{.X} file because it is newer than the source file.
8737 For example:
8738
8739 @example
8740 gcc -Dfoo=bar file1.c -aux-info
8741 protoize *.c
8742 @end example
8743
8744 @noindent
8745 You need to include the special files along with the rest in the
8746 @code{protoize} command, even though their @samp{.X} files already
8747 exist, because otherwise they won't get converted.
8748
8749 @xref{Protoize Caveats}, for more information on how to use
8750 @code{protoize} successfully.