OSDN Git Service

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