OSDN Git Service

* pa.h (processor_type): Add PROCESSOR_8000 symbol.
[pf3gnuchains/gcc-fork.git] / gcc / invoke.texi
1 @c Copyright (C) 1988, 89, 92-98, 1999 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 @node Invoking GCC
6 @chapter GNU CC Command Options
7 @cindex GNU CC command options
8 @cindex command options
9 @cindex options, GNU CC command
10
11 When you invoke GNU CC, it normally does preprocessing, compilation,
12 assembly and linking.  The ``overall options'' allow you to stop this
13 process at an intermediate stage.  For example, the @samp{-c} option
14 says not to run the linker.  Then the output consists of object files
15 output by the assembler.
16
17 Other options are passed on to one stage of processing.  Some options
18 control the preprocessor and others the compiler itself.  Yet other
19 options control the assembler and linker; most of these are not
20 documented here, since you rarely need to use any of them.
21
22 @cindex C compilation options
23 Most of the command line options that you can use with GNU CC are useful
24 for C programs; when an option is only useful with another language
25 (usually C++), the explanation says so explicitly.  If the description
26 for a particular option does not mention a source language, you can use
27 that option with all supported languages.
28
29 @cindex C++ compilation options
30 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
31 options for compiling C++ programs.
32
33 @cindex grouping options
34 @cindex options, grouping
35 The @code{gcc} program accepts options and file names as operands.  Many
36 options have multiletter names; therefore multiple single-letter options
37 may @emph{not} be grouped: @samp{-dr} is very different from @w{@samp{-d
38 -r}}.
39
40 @cindex order of options
41 @cindex options, order
42 You can mix options and other arguments.  For the most part, the order
43 you use doesn't matter.  Order does matter when you use several options
44 of the same kind; for example, if you specify @samp{-L} more than once,
45 the directories are searched in the order specified.
46
47 Many options have long names starting with @samp{-f} or with
48 @samp{-W}---for example, @samp{-fforce-mem},
49 @samp{-fstrength-reduce}, @samp{-Wformat} and so on.  Most of
50 these have both positive and negative forms; the negative form of
51 @samp{-ffoo} would be @samp{-fno-foo}.  This manual documents
52 only one of these two forms, whichever one is not the default.
53
54 @menu
55 * Option Summary::      Brief list of all options, without explanations.
56 * Overall Options::     Controlling the kind of output:
57                         an executable, object files, assembler files,
58                         or preprocessed source.
59 * Invoking G++::        Compiling C++ programs.
60 * C Dialect Options::   Controlling the variant of C language compiled.
61 * C++ Dialect Options:: Variations on C++.
62 * Warning Options::     How picky should the compiler be?
63 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
64 * Optimize Options::    How much optimization?
65 * Preprocessor Options:: Controlling header files and macro definitions.
66                          Also, getting dependency information for Make.
67 * Assembler Options::   Passing options to the assembler.
68 * Link Options::        Specifying libraries and so on.
69 * Directory Options::   Where to find header files and libraries.
70                         Where to find the compiler executable files.
71 * Target Options::      Running a cross-compiler, or an old version of GNU CC.
72 * Submodel Options::    Specifying minor hardware or convention variations,
73                         such as 68010 vs 68020.
74 * Code Gen Options::    Specifying conventions for function calls, data layout
75                         and register usage.
76 * Environment Variables:: Env vars that affect GNU CC.
77 * Running Protoize::    Automatically adding or removing function prototypes.
78 @end menu
79
80 @node Option Summary
81 @section Option Summary
82
83 Here is a summary of all the options, grouped by type.  Explanations are
84 in the following sections.
85
86 @table @emph
87 @item Overall Options
88 @xref{Overall Options,,Options Controlling the Kind of Output}.
89 @smallexample
90 -c  -S  -E  -o @var{file}  -pipe  -v  --help  -x @var{language}
91 @end smallexample
92
93 @item C Language Options
94 @xref{C Dialect Options,,Options Controlling C Dialect}.
95 @smallexample
96 -ansi -flang-isoc9x -fallow-single-precision  -fcond-mismatch  -fno-asm
97 -fno-builtin  -ffreestanding  -fhosted  -fsigned-bitfields  -fsigned-char
98 -funsigned-bitfields  -funsigned-char  -fwritable-strings
99 -traditional  -traditional-cpp  -trigraphs
100 @end smallexample
101
102 @item C++ Language Options
103 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
104 @smallexample
105 -fno-access-control  -fcheck-new  -fconserve-space  -fdollars-in-identifiers
106 -fno-elide-constructors  -fexternal-templates  -ffor-scope  
107 -fno-for-scope  -fno-gnu-keywords  -fguiding-decls  -fhandle-signatures
108 -fhonor-std -fhuge-objects  -fno-implicit-templates  -finit-priority
109 -fno-implement-inlines -fname-mangling-version-@var{n}  -fno-default-inline  
110 -foperator-names  -fno-optional-diags  -frepo  -fstrict-prototype
111 -fsquangle  -ftemplate-depth-@var{n}  -fthis-is-variable  -fvtable-thunks
112 -nostdinc++
113 @end smallexample
114
115 @item Warning Options
116 @xref{Warning Options,,Options to Request or Suppress Warnings}.
117 @smallexample
118 -fsyntax-only  -pedantic  -pedantic-errors
119 -w  -W  -Wall  -Waggregate-return  -Wbad-function-cast
120 -Wcast-align  -Wcast-qual  -Wchar-subscripts  -Wcomment
121 -Wconversion  -Werror  -Wformat
122 -Wid-clash-@var{len}  -Wimplicit -Wimplicit-int 
123 -Wimplicit-function-declaration  -Wimport
124 -Werror-implicit-function-declaration  -Winline
125 -Wlarger-than-@var{len}  -Wlong-long
126 -Wmain  -Wmissing-declarations  -Wmissing-noreturn
127 -Wmissing-prototypes  -Wmultichar  -Wnested-externs  -Wno-import  
128 -Wno-non-template-friend -Wold-style-cast  -Woverloaded-virtual  
129 -Wparentheses -Wpointer-arith  -Wredundant-decls  -Wreorder  
130 -Wreturn-type -Wshadow  -Wsign-compare  -Wstrict-prototypes  
131 -Wswitch -Wsynth  -Wtraditional  
132 -Wtrigraphs -Wundef  -Wuninitialized  -Wunused  -Wwrite-strings
133 -Wunknown-pragmas
134 @end smallexample
135
136 @item Debugging Options
137 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
138 @smallexample
139 -a  -ax  -d@var{letters}  -fdump-unnumbered -fpretend-float
140 -fprofile-arcs  -ftest-coverage
141 -g  -g@var{level}  -gcoff  -gdwarf  -gdwarf-1  -gdwarf-1+  -gdwarf-2
142 -ggdb  -gstabs  -gstabs+  -gxcoff  -gxcoff+
143 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name
144 -print-prog-name=@var{program}  -print-search-dirs  -save-temps
145 @end smallexample
146
147 @item Optimization Options
148 @xref{Optimize Options,,Options that Control Optimization}.
149 @smallexample
150 -fbranch-probabilities  -foptimize-register-moves
151 -fcaller-saves  -fcse-follow-jumps  -fcse-skip-blocks
152 -fdelayed-branch   -fexpensive-optimizations
153 -ffast-math  -ffloat-store  -fforce-addr  -fforce-mem
154 -fdata-sections -ffunction-sections  -fgcse 
155 -finline-functions -fkeep-inline-functions
156 -fno-default-inline -fno-defer-pop  -fno-function-cse
157 -fno-inline  -fno-peephole  -fomit-frame-pointer -fregmove
158 -frerun-cse-after-loop  -frerun-loop-opt -fschedule-insns
159 -fschedule-insns2  -fstrength-reduce  -fthread-jumps
160 -funroll-all-loops  -funroll-loops
161 -fmove-all-movables  -freduce-all-givs -fstrict-aliasing
162 -O  -O0  -O1  -O2  -O3 -Os
163 @end smallexample
164
165 @item Preprocessor Options
166 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
167 @smallexample
168 -A@var{question}(@var{answer})  -C  -dD  -dM  -dN
169 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H
170 -idirafter @var{dir}
171 -include @var{file}  -imacros @var{file}
172 -iprefix @var{file}  -iwithprefix @var{dir}
173 -iwithprefixbefore @var{dir}  -isystem @var{dir} -isystem-c++ @var{dir}
174 -M  -MD  -MM  -MMD  -MG  -nostdinc  -P  -trigraphs
175 -undef  -U@var{macro}  -Wp,@var{option}
176 @end smallexample
177
178 @item Assembler Option
179 @xref{Assembler Options,,Passing Options to the Assembler}.
180 @smallexample
181 -Wa,@var{option}
182 @end smallexample
183
184 @item Linker Options
185 @xref{Link Options,,Options for Linking}.
186 @smallexample
187 @var{object-file-name}  -l@var{library}
188 -nostartfiles  -nodefaultlibs  -nostdlib
189 -s  -static  -shared  -symbolic
190 -Wl,@var{option}  -Xlinker @var{option}
191 -u @var{symbol}
192 @end smallexample
193
194 @item Directory Options
195 @xref{Directory Options,,Options for Directory Search}.
196 @smallexample
197 -B@var{prefix}  -I@var{dir}  -I-  -L@var{dir}  -specs=@var{file}
198 @end smallexample
199
200 @item Target Options
201 @c I wrote this xref this way to avoid overfull hbox. -- rms
202 @xref{Target Options}.
203 @smallexample
204 -b @var{machine}  -V @var{version}
205 @end smallexample
206
207 @item Machine Dependent Options
208 @xref{Submodel Options,,Hardware Models and Configurations}.
209 @smallexample
210 @emph{M680x0 Options}
211 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040
212 -m68060  -mcpu32 -m5200  -m68881  -mbitfield  -mc68000  -mc68020  
213 -mfpa -mnobitfield  -mrtd  -mshort  -msoft-float  
214 -malign-int
215
216 @emph{VAX Options}
217 -mg  -mgnu  -munix
218
219 @emph{SPARC Options}
220 -mcpu=@var{cpu type}
221 -mtune=@var{cpu type}
222 -mcmodel=@var{code model}
223 -malign-jumps=@var{num}  -malign-loops=@var{num}
224 -malign-functions=@var{num}
225 -m32  -m64
226 -mapp-regs  -mbroken-saverestore  -mcypress  -mepilogue
227 -mflat  -mfpu  -mhard-float  -mhard-quad-float
228 -mimpure-text  -mlive-g0  -mno-app-regs  -mno-epilogue
229 -mno-flat  -mno-fpu  -mno-impure-text
230 -mno-stack-bias  -mno-unaligned-doubles
231 -msoft-float  -msoft-quad-float  -msparclite  -mstack-bias
232 -msupersparc  -munaligned-doubles  -mv8
233
234 @emph{Convex Options}
235 -mc1  -mc2  -mc32  -mc34  -mc38
236 -margcount  -mnoargcount
237 -mlong32  -mlong64
238 -mvolatile-cache  -mvolatile-nocache
239
240 @emph{AMD29K Options}
241 -m29000  -m29050  -mbw  -mnbw  -mdw  -mndw
242 -mlarge  -mnormal  -msmall
243 -mkernel-registers  -mno-reuse-arg-regs
244 -mno-stack-check  -mno-storem-bug
245 -mreuse-arg-regs  -msoft-float  -mstack-check
246 -mstorem-bug  -muser-registers
247
248 @emph{ARM Options}
249 -mapcs-frame -mno-apcs-frame
250 -mapcs-26 -mapcs-32
251 -mapcs-stack-check -mno-apcs-stack-check
252 -mapcs-float -mno-apcs-float
253 -mapcs-reentrant -mno-apcs-reentrant
254 -msched-prolog -mno-sched-prolog
255 -mlittle-endian -mbig-endian -mwords-little-endian
256 -mshort-load-bytes -mno-short-load-bytes -mshort-load-words -mno-short-load-words
257 -msoft-float -mhard-float -mfpe
258 -mthumb-interwork -mno-thumb-interwork
259 -mcpu= -march= -mfpe= 
260 -mstructure-size-boundary=
261 -mbsd -mxopen -mno-symrename
262 -mabort-on-noreturn
263 -mno-sched-prolog
264
265 @emph{Thumb Options}
266 -mtpcs-frame -mno-tpcs-frame
267 -mtpcs-leaf-frame -mno-tpcs-leaf-frame
268 -mlittle-endian  -mbig-endian
269 -mthumb-interwork -mno-thumb-interwork
270 -mstructure-size-boundary=
271
272 @emph{MN10200 Options}
273 -mrelax
274
275 @emph{MN10300 Options}
276 -mmult-bug
277 -mno-mult-bug
278 -mrelax
279
280 @emph{M32R/D Options}
281 -mcode-model=@var{model type}  -msdata=@var{sdata type}
282 -G @var{num}
283
284 @emph{M88K Options}
285 -m88000  -m88100  -m88110  -mbig-pic
286 -mcheck-zero-division  -mhandle-large-shift
287 -midentify-revision  -mno-check-zero-division
288 -mno-ocs-debug-info  -mno-ocs-frame-position
289 -mno-optimize-arg-area  -mno-serialize-volatile
290 -mno-underscores  -mocs-debug-info
291 -mocs-frame-position  -moptimize-arg-area
292 -mserialize-volatile  -mshort-data-@var{num}  -msvr3
293 -msvr4  -mtrap-large-shift  -muse-div-instruction
294 -mversion-03.00  -mwarn-passed-structs
295
296 @emph{RS/6000 and PowerPC Options}
297 -mcpu=@var{cpu type}
298 -mtune=@var{cpu type}
299 -mpower  -mno-power  -mpower2  -mno-power2
300 -mpowerpc  -mno-powerpc
301 -mpowerpc-gpopt  -mno-powerpc-gpopt
302 -mpowerpc-gfxopt  -mno-powerpc-gfxopt
303 -mnew-mnemonics  -mno-new-mnemonics
304 -mfull-toc   -mminimal-toc  -mno-fop-in-toc  -mno-sum-in-toc
305 -maix64  -maix32  -mxl-call  -mno-xl-call  -mthreads  -mpe
306 -msoft-float  -mhard-float  -mmultiple  -mno-multiple
307 -mstring  -mno-string  -mupdate  -mno-update
308 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align
309 -mstrict-align  -mno-strict-align  -mrelocatable
310 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib
311 -mtoc  -mno-toc -mlittle  -mlittle-endian  -mbig  -mbig-endian
312 -mcall-aix  -mcall-sysv  -mprototype  -mno-prototype
313 -msim  -mmvme  -mads  -myellowknife  -memb -msdata
314 -msdata=@var{opt}  -G @var{num}
315
316 @emph{RT Options}
317 -mcall-lib-mul  -mfp-arg-in-fpregs  -mfp-arg-in-gregs
318 -mfull-fp-blocks  -mhc-struct-return  -min-line-mul
319 -mminimum-fp-blocks  -mnohc-struct-return
320
321 @emph{MIPS Options}
322 -mabicalls  -mcpu=@var{cpu type}  -membedded-data
323 -membedded-pic  -mfp32  -mfp64  -mgas  -mgp32  -mgp64
324 -mgpopt  -mhalf-pic  -mhard-float  -mint64  -mips1
325 -mips2  -mips3 -mips4 -mlong64  -mlong32 -mlong-calls  -mmemcpy
326 -mmips-as  -mmips-tfile  -mno-abicalls
327 -mno-embedded-data  -mno-embedded-pic
328 -mno-gpopt  -mno-long-calls
329 -mno-memcpy  -mno-mips-tfile  -mno-rnames  -mno-stats
330 -mrnames  -msoft-float
331 -m4650  -msingle-float  -mmad
332 -mstats  -EL  -EB  -G @var{num}  -nocpp
333 -mabi=32 -mabi=n32 -mabi=64 -mabi=eabi
334
335 @emph{i386 Options}
336 -mcpu=@var{cpu type}
337 -march=@var{cpu type}
338 -mieee-fp  -mno-fancy-math-387
339 -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib
340 -mno-wide-multiply  -mrtd  -malign-double
341 -mreg-alloc=@var{list}  -mregparm=@var{num}
342 -malign-jumps=@var{num}  -malign-loops=@var{num}
343 -malign-functions=@var{num}
344
345 @emph{HPPA Options}
346 -mbig-switch  -mdisable-fpregs  -mdisable-indexing  
347 -mfast-indirect-calls -mgas  -mjump-in-delay  
348 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs
349 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas
350 -mno-jump-in-delay  -mno-long-load-store  
351 -mno-portable-runtime  -mno-soft-float  -mno-space  
352 -mno-space-regs  -msoft-float  -mpa-risc-1-0  
353 -mpa-risc-1-1  -mportable-runtime
354 -mschedule=@var{list}  -mspace  -mspace-regs
355
356 @emph{Intel 960 Options}
357 -m@var{cpu type}  -masm-compat  -mclean-linkage
358 -mcode-align  -mcomplex-addr  -mleaf-procedures
359 -mic-compat  -mic2.0-compat  -mic3.0-compat
360 -mintel-asm  -mno-clean-linkage  -mno-code-align
361 -mno-complex-addr  -mno-leaf-procedures
362 -mno-old-align  -mno-strict-align  -mno-tail-call
363 -mnumerics  -mold-align  -msoft-float  -mstrict-align
364 -mtail-call
365
366 @emph{DEC Alpha Options}
367 -mfp-regs  -mno-fp-regs -mno-soft-float  -msoft-float
368 -malpha-as -mgas
369 -mieee  -mieee-with-inexact  -mieee-conformant
370 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode}
371 -mtrap-precision=@var{mode}  -mbuild-constants
372 -mcpu=@var{cpu type}
373 -mbwx -mno-bwx -mcix -mno-cix -mmax -mno-max
374 -mmemory-latency=@var{time}
375
376 @emph{Clipper Options}
377 -mc300  -mc400
378
379 @emph{H8/300 Options}
380 -mrelax  -mh -ms -mint32  -malign-300
381
382 @emph{SH Options}
383 -m1  -m2  -m3  -m3e  -mb  -ml  -mdalign -mrelax
384
385 @emph{System V Options}
386 -Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}
387
388 @emph{ARC Options}
389 -EB  -EL
390 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text section}
391 -mdata=@var{data section}  -mrodata=@var{readonly data section}
392
393 @emph{V850 Options}
394 -mlong-calls -mno-long-calls -mep -mno-ep
395 -mprolog-function -mno-prolog-function -mspace
396 -mtda=@var{n} -msda=@var{n} -mzda=@var{n}
397 -mv850 -mbig-switch
398
399 @emph{NS32K Options}
400 -m32032 -m32332 -m32532 -m32081 -m32381 -mmult-add -mnomult-add
401 -msoft-float -mrtd -mnortd -mregparam -mnoregparam -msb -mnosb
402 -mbitfield -mnobitfield -mhimem -mnohimem
403 @end smallexample
404
405 @item Code Generation Options
406 @xref{Code Gen Options,,Options for Code Generation Conventions}.
407 @smallexample
408 -fcall-saved-@var{reg}  -fcall-used-@var{reg}
409 -fexceptions -ffixed-@var{reg}  -finhibit-size-directive
410 -fcheck-memory-usage  -fprefix-function-name
411 -fno-common  -fno-ident  -fno-gnu-linker
412 -fpcc-struct-return  -fpic  -fPIC
413 -freg-struct-return  -fshared-data  -fshort-enums
414 -fshort-double  -fvolatile  -fvolatile-global -fvolatile-static
415 -fverbose-asm -fpack-struct  -fstack-check
416 -fargument-alias  -fargument-noalias
417 -fargument-noalias-global
418 -fleading-underscore
419 @end smallexample
420 @end table
421
422 @menu
423 * Overall Options::     Controlling the kind of output:
424                         an executable, object files, assembler files,
425                         or preprocessed source.
426 * C Dialect Options::   Controlling the variant of C language compiled.
427 * C++ Dialect Options:: Variations on C++.
428 * Warning Options::     How picky should the compiler be?
429 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
430 * Optimize Options::    How much optimization?
431 * Preprocessor Options:: Controlling header files and macro definitions.
432                          Also, getting dependency information for Make.
433 * Assembler Options::   Passing options to the assembler.
434 * Link Options::        Specifying libraries and so on.
435 * Directory Options::   Where to find header files and libraries.
436                         Where to find the compiler executable files.
437 * Target Options::      Running a cross-compiler, or an old version of GNU CC.
438 @end menu
439
440 @node Overall Options
441 @section Options Controlling the Kind of Output
442
443 Compilation can involve up to four stages: preprocessing, compilation
444 proper, assembly and linking, always in that order.  The first three
445 stages apply to an individual source file, and end by producing an
446 object file; linking combines all the object files (those newly
447 compiled, and those specified as input) into an executable file.
448
449 @cindex file name suffix
450 For any given input file, the file name suffix determines what kind of
451 compilation is done:
452
453 @table @code
454 @item @var{file}.c
455 C source code which must be preprocessed.
456
457 @item @var{file}.i
458 C source code which should not be preprocessed.
459
460 @item @var{file}.ii
461 C++ source code which should not be preprocessed.
462
463 @item @var{file}.m
464 Objective-C source code.  Note that you must link with the library
465 @file{libobjc.a} to make an Objective-C program work.
466
467 @item @var{file}.h
468 C header file (not to be compiled or linked).
469
470 @item @var{file}.cc
471 @itemx @var{file}.cxx
472 @itemx @var{file}.cpp
473 @itemx @var{file}.C
474 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
475 the last two letters must both be literally @samp{x}.  Likewise,
476 @samp{.C} refers to a literal capital C.
477
478 @item @var{file}.s
479 Assembler code.
480
481 @item @var{file}.S
482 Assembler code which must be preprocessed.
483
484 @item @var{other}
485 An object file to be fed straight into linking.
486 Any file name with no recognized suffix is treated this way.
487 @end table
488
489 You can specify the input language explicitly with the @samp{-x} option:
490
491 @table @code
492 @item -x @var{language}
493 Specify explicitly the @var{language} for the following input files
494 (rather than letting the compiler choose a default based on the file
495 name suffix).  This option applies to all following input files until
496 the next @samp{-x} option.  Possible values for @var{language} are:
497 @example
498 c  objective-c  c++
499 c-header  cpp-output  c++-cpp-output
500 assembler  assembler-with-cpp
501 @end example
502
503 @item -x none
504 Turn off any specification of a language, so that subsequent files are
505 handled according to their file name suffixes (as they are if @samp{-x}
506 has not been used at all).
507 @end table
508
509 If you only want some of the stages of compilation, you can use
510 @samp{-x} (or filename suffixes) to tell @code{gcc} where to start, and
511 one of the options @samp{-c}, @samp{-S}, or @samp{-E} to say where
512 @code{gcc} is to stop.  Note that some combinations (for example,
513 @samp{-x cpp-output -E} instruct @code{gcc} to do nothing at all.
514
515 @table @code
516 @item -c
517 Compile or assemble the source files, but do not link.  The linking
518 stage simply is not done.  The ultimate output is in the form of an
519 object file for each source file.
520
521 By default, the object file name for a source file is made by replacing
522 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
523
524 Unrecognized input files, not requiring compilation or assembly, are
525 ignored.
526
527 @item -S
528 Stop after the stage of compilation proper; do not assemble.  The output
529 is in the form of an assembler code file for each non-assembler input
530 file specified.
531
532 By default, the assembler file name for a source file is made by
533 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
534
535 Input files that don't require compilation are ignored.
536
537 @item -E
538 Stop after the preprocessing stage; do not run the compiler proper.  The
539 output is in the form of preprocessed source code, which is sent to the
540 standard output.
541
542 Input files which don't require preprocessing are ignored.
543
544 @cindex output file option
545 @item -o @var{file}
546 Place output in file @var{file}.  This applies regardless to whatever
547 sort of output is being produced, whether it be an executable file,
548 an object file, an assembler file or preprocessed C code.
549
550 Since only one output file can be specified, it does not make sense to
551 use @samp{-o} when compiling more than one input file, unless you are
552 producing an executable file as output.
553
554 If @samp{-o} is not specified, the default is to put an executable file
555 in @file{a.out}, the object file for @file{@var{source}.@var{suffix}} in
556 @file{@var{source}.o}, its assembler file in @file{@var{source}.s}, and
557 all preprocessed C source on standard output.@refill
558
559 @item -v
560 Print (on standard error output) the commands executed to run the stages
561 of compilation.  Also print the version number of the compiler driver
562 program and of the preprocessor and the compiler proper.
563
564 @item -pipe
565 Use pipes rather than temporary files for communication between the
566 various stages of compilation.  This fails to work on some systems where
567 the assembler is unable to read from a pipe; but the GNU assembler has
568 no trouble.
569
570 @item --help
571 Print (on the standard output) a description of the command line options
572 understood by @code{gcc}.  If the @code{-v} option is also specified
573 then @code{--help} will also be passed on to the various processes
574 invoked by @code{gcc}, so that they can display the command line options
575 they accept.  If the @code{-W} option is also specified then command
576 line options which have no documentation associated with them will also
577 be displayed.
578 @end table
579
580 @node Invoking G++
581 @section Compiling C++ Programs
582
583 @cindex suffixes for C++ source
584 @cindex C++ source file suffixes
585 C++ source files conventionally use one of the suffixes @samp{.C},
586 @samp{.cc}, @samp{cpp}, or @samp{.cxx}; preprocessed C++ files use the
587 suffix @samp{.ii}.  GNU CC recognizes files with these names and
588 compiles them as C++ programs even if you call the compiler the same way
589 as for compiling C programs (usually with the name @code{gcc}).
590
591 @findex g++
592 @findex c++
593 However, C++ programs often require class libraries as well as a
594 compiler that understands the C++ language---and under some
595 circumstances, you might want to compile programs from standard input,
596 or otherwise without a suffix that flags them as C++ programs.
597 @code{g++} is a program that calls GNU CC with the default language
598 set to C++, and automatically specifies linking against the C++
599 library.
600 @cindex @code{g++ 1.@var{xx}}
601 @cindex @code{g++}, separate compiler
602 @cindex @code{g++} older version
603 @footnote{Prior to release 2 of the compiler,
604 there was a separate @code{g++} compiler.  That version was based on GNU
605 CC, but not integrated with it.  Versions of @code{g++} with a
606 @samp{1.@var{xx}} version number---for example, @code{g++} version 1.37
607 or 1.42---are much less reliable than the versions integrated with GCC
608 2.  Moreover, combining G++ @samp{1.@var{xx}} with a version 2 GCC will
609 simply not work.} On many systems, the script @code{g++} is also
610 installed with the name @code{c++}.
611
612 @cindex invoking @code{g++}
613 When you compile C++ programs, you may specify many of the same
614 command-line options that you use for compiling programs in any
615 language; or command-line options meaningful for C and related
616 languages; or options that are meaningful only for C++ programs.
617 @xref{C Dialect Options,,Options Controlling C Dialect}, for
618 explanations of options for languages related to C.
619 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
620 explanations of options that are meaningful only for C++ programs.
621
622 @node C Dialect Options
623 @section Options Controlling C Dialect
624 @cindex dialect options
625 @cindex language dialect options
626 @cindex options, dialect
627
628 The following options control the dialect of C (or languages derived
629 from C, such as C++ and Objective C) that the compiler accepts:
630
631 @table @code
632 @cindex ANSI support
633 @item -ansi
634 Support all ANSI standard C programs.
635
636 This turns off certain features of GNU C that are incompatible with ANSI
637 C, such as the @code{asm}, @code{inline} and @code{typeof} keywords, and
638 predefined macros such as @code{unix} and @code{vax} that identify the
639 type of system you are using.  It also enables the undesirable and
640 rarely used ANSI trigraph feature, and it disables recognition of C++
641 style @samp{//} comments.
642
643 The alternate keywords @code{__asm__}, @code{__extension__},
644 @code{__inline__} and @code{__typeof__} continue to work despite
645 @samp{-ansi}.  You would not want to use them in an ANSI C program, of
646 course, but it is useful to put them in header files that might be included
647 in compilations done with @samp{-ansi}.  Alternate predefined macros
648 such as @code{__unix__} and @code{__vax__} are also available, with or
649 without @samp{-ansi}.
650
651 The @samp{-ansi} option does not cause non-ANSI programs to be
652 rejected gratuitously.  For that, @samp{-pedantic} is required in
653 addition to @samp{-ansi}.  @xref{Warning Options}.
654
655 The macro @code{__STRICT_ANSI__} is predefined when the @samp{-ansi}
656 option is used.  Some header files may notice this macro and refrain
657 from declaring certain functions or defining certain macros that the
658 ANSI standard doesn't call for; this is to avoid interfering with any
659 programs that might use these names for other things.
660
661 The functions @code{alloca}, @code{abort}, @code{exit}, and
662 @code{_exit} are not builtin functions when @samp{-ansi} is used.
663
664 @item -flang-isoc9x
665 Enable support for features found in the C9X standard.  In particular,
666 enable support for the C9X @code{restrict} keyword.  
667
668 Even when this option is not specified, you can still use some C9X
669 features in so far as they do not conflict with previous C standards.
670 For example, you may use @code{__restrict__} even when -flang-isoc9x
671 is not specified. 
672
673 @item -fno-asm
674 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
675 keyword, so that code can use these words as identifiers.  You can use
676 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
677 instead.  @samp{-ansi} implies @samp{-fno-asm}.
678
679 In C++, this switch only affects the @code{typeof} keyword, since
680 @code{asm} and @code{inline} are standard keywords.  You may want to
681 use the @samp{-fno-gnu-keywords} flag instead, as it also disables the
682 other, C++-specific, extension keywords such as @code{headof}.
683
684 @item -fno-builtin
685 @cindex builtin functions
686 @findex abort
687 @findex abs
688 @findex alloca
689 @findex cos
690 @findex exit
691 @findex fabs
692 @findex ffs
693 @findex labs
694 @findex memcmp
695 @findex memcpy
696 @findex sin
697 @findex sqrt
698 @findex strcmp
699 @findex strcpy
700 @findex strlen
701 Don't recognize builtin functions that do not begin with @samp{__builtin_}
702 as prefix.  Currently, the functions affected include @code{abort},
703 @code{abs}, @code{alloca}, @code{cos}, @code{exit}, @code{fabs},
704 @code{ffs}, @code{labs}, @code{memcmp}, @code{memcpy}, @code{sin},
705 @code{sqrt}, @code{strcmp}, @code{strcpy}, and @code{strlen}.
706
707 GCC normally generates special code to handle certain builtin functions
708 more efficiently; for instance, calls to @code{alloca} may become single
709 instructions that adjust the stack directly, and calls to @code{memcpy}
710 may become inline copy loops.  The resulting code is often both smaller
711 and faster, but since the function calls no longer appear as such, you
712 cannot set a breakpoint on those calls, nor can you change the behavior
713 of the functions by linking with a different library.
714
715 The @samp{-ansi} option prevents @code{alloca} and @code{ffs} from being
716 builtin functions, since these functions do not have an ANSI standard
717 meaning.
718
719 @item -fhosted
720 @cindex hosted environment
721
722 Assert that compilation takes place in a hosted environment.  This implies
723 @samp{-fbuiltin}.  A hosted environment is one in which the
724 entire standard library is available, and in which @code{main} has a return
725 type of @code{int}.  Examples are nearly everything except a kernel.
726 This is equivalent to @samp{-fno-freestanding}.
727
728 @item -ffreestanding
729 @cindex hosted environment
730
731 Assert that compilation takes place in a freestanding environment.  This
732 implies @samp{-fno-builtin}.  A freestanding environment
733 is one in which the standard library may not exist, and program startup may
734 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
735 This is equivalent to @samp{-fno-hosted}.
736
737 @item -trigraphs
738 Support ANSI C trigraphs.  You don't want to know about this
739 brain-damage.  The @samp{-ansi} option implies @samp{-trigraphs}.
740
741 @cindex traditional C language
742 @cindex C language, traditional
743 @item -traditional
744 Attempt to support some aspects of traditional C compilers.
745 Specifically:
746
747 @itemize @bullet
748 @item
749 All @code{extern} declarations take effect globally even if they
750 are written inside of a function definition.  This includes implicit
751 declarations of functions.
752
753 @item
754 The newer keywords @code{typeof}, @code{inline}, @code{signed}, @code{const}
755 and @code{volatile} are not recognized.  (You can still use the
756 alternative keywords such as @code{__typeof__}, @code{__inline__}, and
757 so on.)
758
759 @item
760 Comparisons between pointers and integers are always allowed.
761
762 @item
763 Integer types @code{unsigned short} and @code{unsigned char} promote
764 to @code{unsigned int}.
765
766 @item
767 Out-of-range floating point literals are not an error.
768
769 @item
770 Certain constructs which ANSI regards as a single invalid preprocessing
771 number, such as @samp{0xe-0xd}, are treated as expressions instead.
772
773 @item
774 String ``constants'' are not necessarily constant; they are stored in
775 writable space, and identical looking constants are allocated
776 separately.  (This is the same as the effect of
777 @samp{-fwritable-strings}.)
778
779 @cindex @code{longjmp} and automatic variables
780 @item
781 All automatic variables not declared @code{register} are preserved by
782 @code{longjmp}.  Ordinarily, GNU C follows ANSI C: automatic variables
783 not declared @code{volatile} may be clobbered.
784
785 @item
786 @kindex \x
787 @kindex \a
788 @cindex escape sequences, traditional
789 The character escape sequences @samp{\x} and @samp{\a} evaluate as the
790 literal characters @samp{x} and @samp{a} respectively.  Without
791 @w{@samp{-traditional}}, @samp{\x} is a prefix for the hexadecimal
792 representation of a character, and @samp{\a} produces a bell.
793 @end itemize
794
795 You may wish to use @samp{-fno-builtin} as well as @samp{-traditional}
796 if your program uses names that are normally GNU C builtin functions for
797 other purposes of its own.
798
799 You cannot use @samp{-traditional} if you include any header files that
800 rely on ANSI C features.  Some vendors are starting to ship systems with
801 ANSI C header files and you cannot use @samp{-traditional} on such
802 systems to compile files that include any system headers.
803
804 The @samp{-traditional} option also enables @samp{-traditional-cpp},
805 which is described next.
806
807 @item -traditional-cpp
808 Attempt to support some aspects of traditional C preprocessors.
809 Specifically:
810
811 @itemize @bullet
812 @item
813 Comments convert to nothing at all, rather than to a space.  This allows
814 traditional token concatenation.
815
816 @item
817 In a preprocessing directive, the @samp{#} symbol must appear as the first
818 character of a line.
819
820 @item
821 Macro arguments are recognized within string constants in a macro
822 definition (and their values are stringified, though without additional
823 quote marks, when they appear in such a context).  The preprocessor
824 always considers a string constant to end at a newline.
825
826 @item
827 @cindex detecting @w{@samp{-traditional}}
828 The predefined macro @code{__STDC__} is not defined when you use
829 @samp{-traditional}, but @code{__GNUC__} is (since the GNU extensions
830 which @code{__GNUC__} indicates are not affected by
831 @samp{-traditional}).  If you need to write header files that work
832 differently depending on whether @samp{-traditional} is in use, by
833 testing both of these predefined macros you can distinguish four
834 situations: GNU C, traditional GNU C, other ANSI C compilers, and other
835 old C compilers.  The predefined macro @code{__STDC_VERSION__} is also
836 not defined when you use @samp{-traditional}.  @xref{Standard
837 Predefined,,Standard Predefined Macros,cpp.info,The C Preprocessor},
838 for more discussion of these and other predefined macros.
839
840 @item
841 @cindex string constants vs newline
842 @cindex newline vs string constants
843 The preprocessor considers a string constant to end at a newline (unless
844 the newline is escaped with @samp{\}).  (Without @w{@samp{-traditional}},
845 string constants can contain the newline character as typed.)
846 @end itemize
847
848 @item -fcond-mismatch
849 Allow conditional expressions with mismatched types in the second and
850 third arguments.  The value of such an expression is void.
851
852 @item -funsigned-char
853 Let the type @code{char} be unsigned, like @code{unsigned char}.
854
855 Each kind of machine has a default for what @code{char} should
856 be.  It is either like @code{unsigned char} by default or like
857 @code{signed char} by default.
858
859 Ideally, a portable program should always use @code{signed char} or
860 @code{unsigned char} when it depends on the signedness of an object.
861 But many programs have been written to use plain @code{char} and
862 expect it to be signed, or expect it to be unsigned, depending on the
863 machines they were written for.  This option, and its inverse, let you
864 make such a program work with the opposite default.
865
866 The type @code{char} is always a distinct type from each of
867 @code{signed char} or @code{unsigned char}, even though its behavior
868 is always just like one of those two.
869
870 @item -fsigned-char
871 Let the type @code{char} be signed, like @code{signed char}.
872
873 Note that this is equivalent to @samp{-fno-unsigned-char}, which is
874 the negative form of @samp{-funsigned-char}.  Likewise, the option
875 @samp{-fno-signed-char} is equivalent to @samp{-funsigned-char}.
876
877 You may wish to use @samp{-fno-builtin} as well as @samp{-traditional}
878 if your program uses names that are normally GNU C builtin functions for
879 other purposes of its own.
880
881 You cannot use @samp{-traditional} if you include any header files that
882 rely on ANSI C features.  Some vendors are starting to ship systems with
883 ANSI C header files and you cannot use @samp{-traditional} on such
884 systems to compile files that include any system headers.
885
886 @item -fsigned-bitfields
887 @itemx -funsigned-bitfields
888 @itemx -fno-signed-bitfields
889 @itemx -fno-unsigned-bitfields
890 These options control whether a bitfield is signed or unsigned, when the
891 declaration does not use either @code{signed} or @code{unsigned}.  By
892 default, such a bitfield is signed, because this is consistent: the
893 basic integer types such as @code{int} are signed types.
894
895 However, when @samp{-traditional} is used, bitfields are all unsigned
896 no matter what.
897
898 @item -fwritable-strings
899 Store string constants in the writable data segment and don't uniquize
900 them.  This is for compatibility with old programs which assume they can
901 write into string constants.  The option @samp{-traditional} also has
902 this effect.
903
904 Writing into string constants is a very bad idea; ``constants'' should
905 be constant.
906
907 @item -fallow-single-precision
908 Do not promote single precision math operations to double precision,
909 even when compiling with @samp{-traditional}.
910
911 Traditional K&R C promotes all floating point operations to double
912 precision, regardless of the sizes of the operands.   On the
913 architecture for which you are compiling, single precision may be faster
914 than double precision.   If you must use @samp{-traditional}, but want
915 to use single precision operations when the operands are single
916 precision, use this option.   This option has no effect when compiling
917 with ANSI or GNU C conventions (the default).
918
919 @end table
920
921 @node C++ Dialect Options
922 @section Options Controlling C++ Dialect
923
924 @cindex compiler options, C++
925 @cindex C++ options, command line
926 @cindex options, C++
927 This section describes the command-line options that are only meaningful
928 for C++ programs; but you can also use most of the GNU compiler options
929 regardless of what language your program is in.  For example, you
930 might compile a file @code{firstClass.C} like this:
931
932 @example
933 g++ -g -frepo -O -c firstClass.C
934 @end example
935
936 @noindent
937 In this example, only @samp{-frepo} is an option meant
938 only for C++ programs; you can use the other options with any
939 language supported by GNU CC.
940
941 Here is a list of options that are @emph{only} for compiling C++ programs:
942
943 @table @code
944 @item -fno-access-control
945 Turn off all access checking.  This switch is mainly useful for working
946 around bugs in the access control code.
947
948 @item -fcheck-new
949 Check that the pointer returned by @code{operator new} is non-null
950 before attempting to modify the storage allocated.  The current Working
951 Paper requires that @code{operator new} never return a null pointer, so
952 this check is normally unnecessary.
953
954 An alternative to using this option is to specify that your
955 @code{operator new} does not throw any exceptions; if you declare it
956 @samp{throw()}, g++ will check the return value.  See also @samp{new
957 (nothrow)}.
958
959 @item -fconserve-space
960 Put uninitialized or runtime-initialized global variables into the
961 common segment, as C does.  This saves space in the executable at the
962 cost of not diagnosing duplicate definitions.  If you compile with this
963 flag and your program mysteriously crashes after @code{main()} has
964 completed, you may have an object that is being destroyed twice because
965 two definitions were merged.
966
967 This option is no longer useful on most targets, now that support has
968 been added for putting variables into BSS without making them common.
969
970 @item -fdollars-in-identifiers
971 Accept @samp{$} in identifiers.  You can also explicitly prohibit use of
972 @samp{$} with the option @samp{-fno-dollars-in-identifiers}.  (GNU C allows
973 @samp{$} by default on most target systems, but there are a few exceptions.)
974 Traditional C allowed the character @samp{$} to form part of
975 identifiers.  However, ANSI C and C++ forbid @samp{$} in identifiers.
976
977 @item -fno-elide-constructors
978 The C++ standard allows an implementation to omit creating a temporary
979 which is only used to initialize another object of the same type.
980 Specifying this option disables that optimization, and forces g++ to
981 call the copy constructor in all cases.
982
983 @item -fexternal-templates
984 Cause template instantiations to obey @samp{#pragma interface} and
985 @samp{implementation}; template instances are emitted or not according
986 to the location of the template definition.  @xref{Template
987 Instantiation}, for more information.
988
989 This option is deprecated.
990
991 @item -falt-external-templates
992 Similar to -fexternal-templates, but template instances are emitted or
993 not according to the place where they are first instantiated.
994 @xref{Template Instantiation}, for more information.
995
996 This option is deprecated.
997
998 @item -ffor-scope
999 @itemx -fno-for-scope
1000 If -ffor-scope is specified, the scope of variables declared in
1001 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1002 as specified by the draft C++ standard.
1003 If -fno-for-scope is specified, the scope of variables declared in
1004 a @i{for-init-statement} extends to the end of the enclosing scope,
1005 as was the case in old versions of gcc, and other (traditional)
1006 implementations of C++.
1007
1008 The default if neither flag is given to follow the standard,
1009 but to allow and give a warning for old-style code that would
1010 otherwise be invalid, or have different behavior.
1011
1012 @item -fno-gnu-keywords
1013 Do not recognize @code{classof}, @code{headof}, @code{signature},
1014 @code{sigof} or @code{typeof} as a keyword, so that code can use these
1015 words as identifiers.  You can use the keywords @code{__classof__},
1016 @code{__headof__}, @code{__signature__}, @code{__sigof__}, and
1017 @code{__typeof__} instead.  @samp{-ansi} implies
1018 @samp{-fno-gnu-keywords}.
1019
1020 @item -fguiding-decls
1021 Treat a function declaration with the same type as a potential function
1022 template instantiation as though it declares that instantiation, not a
1023 normal function.  If a definition is given for the function later in the
1024 translation unit (or another translation unit if the target supports
1025 weak symbols), that definition will be used; otherwise the template will
1026 be instantiated.  This behavior reflects the C++ language prior to
1027 September 1996, when guiding declarations were removed.
1028
1029 This option implies @samp{-fname-mangling-version-0}, and will not work
1030 with other name mangling versions.  Like all options that change the
1031 ABI, all C++ code, @emph{including libgcc.a} must be built with the same
1032 setting of this option.
1033
1034 @item -fhandle-signatures
1035 Recognize the @code{signature} and @code{sigof} keywords for specifying
1036 abstract types.  The default (@samp{-fno-handle-signatures}) is not to
1037 recognize them.  @xref{C++ Signatures, Type Abstraction using
1038 Signatures}.
1039
1040 @item -fhonor-std
1041 Treat the @code{namespace std} as a namespace, instead of ignoring
1042 it. For compatibility with earlier versions of g++, the compiler will,
1043 by default, ignore @code{namespace-declarations},
1044 @code{using-declarations}, @code{using-directives}, and
1045 @code{namespace-names}, if they involve @code{std}.
1046
1047 @item -fhuge-objects
1048 Support virtual function calls for objects that exceed the size
1049 representable by a @samp{short int}.  Users should not use this flag by
1050 default; if you need to use it, the compiler will tell you so.
1051
1052 This flag is not useful when compiling with -fvtable-thunks.
1053
1054 Like all options that change the ABI, all C++ code, @emph{including
1055 libgcc} must be built with the same setting of this option.
1056
1057 @item -fno-implicit-templates
1058 Never emit code for templates which are instantiated implicitly (i.e. by
1059 use); only emit code for explicit instantiations.  @xref{Template
1060 Instantiation}, for more information.
1061
1062 @item -finit-priority
1063 Support @samp{__attribute__ ((init_priority (n)))} for controlling the
1064 order of initialization of file-scope objects.  On ELF targets, this
1065 requires GNU ld 2.10 or later.
1066
1067 @item -fno-implement-inlines
1068 To save space, do not emit out-of-line copies of inline functions
1069 controlled by @samp{#pragma implementation}.  This will cause linker
1070 errors if these functions are not inlined everywhere they are called.
1071
1072 @item -fname-mangling-version-@var{n}
1073 Control the way in which names are mangled.  Version 0 is compatible
1074 with versions of g++ before 2.8.  Version 1 is the default.  Version 1
1075 will allow correct mangling of function templates.  For example, 
1076 version 0 mangling does not mangle foo<int, double> and foo<int, char>
1077 given this declaration:
1078
1079 @example
1080 template <class T, class U> void foo(T t);
1081 @end example
1082
1083 @item -foperator-names
1084 Recognize the operator name keywords @code{and}, @code{bitand},
1085 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1086 synonyms for the symbols they refer to.  @samp{-ansi} implies
1087 @samp{-foperator-names}.
1088
1089 @item -fno-optional-diags
1090 Disable diagnostics that the standard says a compiler does not need to
1091 issue.  Currently, this means the diagnostic for a name having multiple 
1092 meanings within a class.
1093
1094 @item -fpermissive
1095 Downgrade messages about nonconformant code from errors to warnings.  By
1096 default, g++ effectively sets @samp{-pedantic-errors} without
1097 @samp{-pedantic}; this option reverses that.  This behavior and this
1098 option are superceded by @samp{-pedantic}, which works as it does for GNU C.
1099
1100 @item -frepo
1101 Enable automatic template instantiation.  This option also implies
1102 @samp{-fno-implicit-templates}.  @xref{Template Instantiation}, for more
1103 information.
1104
1105 @item -fno-rtti
1106 Disable generation of the information used by C++ runtime type
1107 identification features (@samp{dynamic_cast} and @samp{typeid}).  If you
1108 don't use those parts of the language (or exception handling, which uses
1109 @samp{dynamic_cast} internally), you can save some space by using this
1110 flag.
1111
1112 @item -fstrict-prototype
1113 Within an @samp{extern "C"} linkage specification, treat a function
1114 declaration with no arguments, such as @samp{int foo ();}, as declaring
1115 the function to take no arguments.  Normally, such a declaration means
1116 that the function @code{foo} can take any combination of arguments, as
1117 in C.  @samp{-pedantic} implies @samp{-fstrict-prototype} unless
1118 overridden with @samp{-fno-strict-prototype}.
1119
1120 Specifying this option will also suppress implicit declarations of
1121 functions.
1122
1123 This flag no longer affects declarations with C++ linkage.
1124
1125 @item -fsquangle
1126 @itemx -fno-squangle
1127 @samp{-fsquangle} will enable a compressed form of name mangling for
1128 identifiers. In particular, it helps to shorten very long names by recognizing
1129 types and class names which occur more than once, replacing them with special
1130 short ID codes.  This option also requires any C++ libraries being used to
1131 be compiled with this option as well.  The compiler has this disabled (the
1132 equivalent of @samp{-fno-squangle}) by default.
1133
1134 Like all options that change the ABI, all C++ code, @emph{including
1135 libgcc.a} must be built with the same setting of this option.
1136
1137 @item -ftemplate-depth-@var{n}
1138 Set the maximum instantiation depth for template classes to @var{n}.
1139 A limit on the template instantiation depth is needed to detect
1140 endless recursions during template class instantiation. ANSI/ISO C++
1141 conforming programs must not rely on a maximum depth greater than 17.
1142
1143 @item -fthis-is-variable
1144 Permit assignment to @code{this}.  The incorporation of user-defined
1145 free store management into C++ has made assignment to @samp{this} an
1146 anachronism.  Therefore, by default it is invalid to assign to
1147 @code{this} within a class member function; that is, GNU C++ treats
1148 @samp{this} in a member function of class @code{X} as a non-lvalue of
1149 type @samp{X *}.  However, for backwards compatibility, you can make it
1150 valid with @samp{-fthis-is-variable}.
1151
1152 @item -fvtable-thunks
1153 Use @samp{thunks} to implement the virtual function dispatch table
1154 (@samp{vtable}).  The traditional (cfront-style) approach to
1155 implementing vtables was to store a pointer to the function and two
1156 offsets for adjusting the @samp{this} pointer at the call site.  Newer
1157 implementations store a single pointer to a @samp{thunk} function which
1158 does any necessary adjustment and then calls the target function.
1159
1160 This option also enables a heuristic for controlling emission of
1161 vtables; if a class has any non-inline virtual functions, the vtable
1162 will be emitted in the translation unit containing the first one of
1163 those.
1164
1165 Like all options that change the ABI, all C++ code, @emph{including
1166 libgcc.a} must be built with the same setting of this option.
1167
1168 @item -nostdinc++
1169 Do not search for header files in the standard directories specific to
1170 C++, but do still search the other standard directories.  (This option
1171 is used when building the C++ library.)
1172 @end table
1173
1174 In addition, these optimization, warning, and code generation options
1175 have meanings only for C++ programs:
1176
1177 @table @code
1178 @item -fno-default-inline
1179 Do not assume @samp{inline} for functions defined inside a class scope.
1180 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1181 functions will have linkage like inline functions; they just won't be
1182 inlined by default.
1183
1184 @item -Wno-non-template-friend
1185 @xref{Warning Options,,Options to Request or Suppress Warnings}.
1186 @item -Wold-style-cast
1187 @itemx -Woverloaded-virtual
1188 Warnings that apply only to C++ programs.  @xref{Warning
1189 Options,,Options to Request or Suppress Warnings}.
1190
1191 @item -Weffc++
1192 Warn about violation of some style rules from Effective C++ by Scott Myers.
1193 @end table
1194
1195 @node Warning Options
1196 @section Options to Request or Suppress Warnings
1197 @cindex options to control warnings
1198 @cindex warning messages
1199 @cindex messages, warning
1200 @cindex suppressing warnings
1201
1202 Warnings are diagnostic messages that report constructions which
1203 are not inherently erroneous but which are risky or suggest there
1204 may have been an error.
1205
1206 You can request many specific warnings with options beginning @samp{-W},
1207 for example @samp{-Wimplicit} to request warnings on implicit
1208 declarations.  Each of these specific warning options also has a
1209 negative form beginning @samp{-Wno-} to turn off warnings;
1210 for example, @samp{-Wno-implicit}.  This manual lists only one of the
1211 two forms, whichever is not the default.
1212
1213 These options control the amount and kinds of warnings produced by GNU
1214 CC:
1215
1216 @table @code
1217 @cindex syntax checking
1218 @item -fsyntax-only
1219 Check the code for syntax errors, but don't do anything beyond that.
1220
1221 @item -pedantic
1222 Issue all the warnings demanded by strict ANSI C and ISO C++;
1223 reject all programs that use forbidden extensions.
1224
1225 Valid ANSI C and ISO C++ programs should compile properly with or without
1226 this option (though a rare few will require @samp{-ansi}).  However,
1227 without this option, certain GNU extensions and traditional C and C++
1228 features are supported as well.  With this option, they are rejected.
1229
1230 @samp{-pedantic} does not cause warning messages for use of the
1231 alternate keywords whose names begin and end with @samp{__}.  Pedantic
1232 warnings are also disabled in the expression that follows
1233 @code{__extension__}.  However, only system header files should use
1234 these escape routes; application programs should avoid them.
1235 @xref{Alternate Keywords}.
1236
1237 This option is not intended to be @i{useful}; it exists only to satisfy
1238 pedants who would otherwise claim that GNU CC fails to support the ANSI
1239 standard.
1240
1241 Some users try to use @samp{-pedantic} to check programs for strict ANSI
1242 C conformance.  They soon find that it does not do quite what they want:
1243 it finds some non-ANSI practices, but not all---only those for which
1244 ANSI C @emph{requires} a diagnostic.
1245
1246 A feature to report any failure to conform to ANSI C might be useful in
1247 some instances, but would require considerable additional work and would
1248 be quite different from @samp{-pedantic}.  We don't have plans to
1249 support such a feature in the near future.
1250
1251 @item -pedantic-errors
1252 Like @samp{-pedantic}, except that errors are produced rather than
1253 warnings.
1254
1255 @item -w
1256 Inhibit all warning messages.
1257
1258 @item -Wno-import
1259 Inhibit warning messages about the use of @samp{#import}.
1260
1261 @item -Wchar-subscripts
1262 Warn if an array subscript has type @code{char}.  This is a common cause
1263 of error, as programmers often forget that this type is signed on some
1264 machines.
1265
1266 @item -Wcomment
1267 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
1268 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
1269
1270 @item -Wformat
1271 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
1272 the arguments supplied have types appropriate to the format string
1273 specified.
1274
1275 @item -Wimplicit-int
1276 Warn when a declaration does not specify a type.
1277
1278 @item -Wimplicit-function-declaration
1279 @itemx -Werror-implicit-function-declaration
1280 Give a warning (or error) whenever a function is used before being
1281 declared.
1282
1283 @item -Wimplicit
1284 Same as @samp{-Wimplicit-int} and @samp{-Wimplicit-function-}@*
1285 @samp{declaration}.
1286
1287 @item -Wmain
1288 Warn if the type of @samp{main} is suspicious.  @samp{main} should be a
1289 function with external linkage, returning int, taking either zero
1290 arguments, two, or three arguments of appropriate types.
1291
1292 @item -Wmultichar
1293 Warn if a multicharacter constant (@samp{'FOOF'}) is used.  Usually they
1294 indicate a typo in the user's code, as they have implementation-defined
1295 values, and should not be used in portable code.
1296   
1297 @item -Wparentheses
1298 Warn if parentheses are omitted in certain contexts, such
1299 as when there is an assignment in a context where a truth value
1300 is expected, or when operators are nested whose precedence people
1301 often get confused about.
1302
1303 Also warn about constructions where there may be confusion to which
1304 @code{if} statement an @code{else} branch belongs.  Here is an example of
1305 such a case:
1306
1307 @smallexample
1308 @{
1309   if (a)
1310     if (b)
1311       foo ();
1312   else
1313     bar ();
1314 @}
1315 @end smallexample
1316
1317 In C, every @code{else} branch belongs to the innermost possible @code{if}
1318 statement, which in this example is @code{if (b)}.  This is often not
1319 what the programmer expected, as illustrated in the above example by
1320 indentation the programmer chose.  When there is the potential for this
1321 confusion, GNU C will issue a warning when this flag is specified.
1322 To eliminate the warning, add explicit braces around the innermost
1323 @code{if} statement so there is no way the @code{else} could belong to
1324 the enclosing @code{if}.  The resulting code would look like this:
1325
1326 @smallexample
1327 @{
1328   if (a)
1329     @{
1330       if (b)
1331         foo ();
1332       else
1333         bar ();
1334     @}
1335 @}
1336 @end smallexample
1337
1338 @item -Wreturn-type
1339 Warn whenever a function is defined with a return-type that defaults
1340 to @code{int}.  Also warn about any @code{return} statement with no
1341 return-value in a function whose return-type is not @code{void}.
1342
1343 @item -Wswitch
1344 Warn whenever a @code{switch} statement has an index of enumeral type
1345 and lacks a @code{case} for one or more of the named codes of that
1346 enumeration.  (The presence of a @code{default} label prevents this
1347 warning.)  @code{case} labels outside the enumeration range also
1348 provoke warnings when this option is used.
1349
1350 @item -Wtrigraphs
1351 Warn if any trigraphs are encountered (assuming they are enabled).
1352
1353 @item -Wunused
1354 Warn whenever a variable is unused aside from its declaration,
1355 whenever a function is declared static but never defined, whenever a
1356 label is declared but not used, and whenever a statement computes a
1357 result that is explicitly not used.
1358
1359 In order to get a warning about an unused function parameter, you must
1360 specify both @samp{-W} and @samp{-Wunused}.
1361
1362 To suppress this warning for an expression, simply cast it to void.  For
1363 unused variables, parameters and labels, use the @samp{unused} attribute
1364 (@pxref{Variable Attributes}).
1365
1366 @item -Wuninitialized
1367 An automatic variable is used without first being initialized.
1368
1369 These warnings are possible only in optimizing compilation,
1370 because they require data flow information that is computed only
1371 when optimizing.  If you don't specify @samp{-O}, you simply won't
1372 get these warnings.
1373
1374 These warnings occur only for variables that are candidates for
1375 register allocation.  Therefore, they do not occur for a variable that
1376 is declared @code{volatile}, or whose address is taken, or whose size
1377 is other than 1, 2, 4 or 8 bytes.  Also, they do not occur for
1378 structures, unions or arrays, even when they are in registers.
1379
1380 Note that there may be no warning about a variable that is used only
1381 to compute a value that itself is never used, because such
1382 computations may be deleted by data flow analysis before the warnings
1383 are printed.
1384
1385 These warnings are made optional because GNU CC is not smart
1386 enough to see all the reasons why the code might be correct
1387 despite appearing to have an error.  Here is one example of how
1388 this can happen:
1389
1390 @smallexample
1391 @{
1392   int x;
1393   switch (y)
1394     @{
1395     case 1: x = 1;
1396       break;
1397     case 2: x = 4;
1398       break;
1399     case 3: x = 5;
1400     @}
1401   foo (x);
1402 @}
1403 @end smallexample
1404
1405 @noindent
1406 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
1407 always initialized, but GNU CC doesn't know this.  Here is
1408 another common case:
1409
1410 @smallexample
1411 @{
1412   int save_y;
1413   if (change_y) save_y = y, y = new_y;
1414   @dots{}
1415   if (change_y) y = save_y;
1416 @}
1417 @end smallexample
1418
1419 @noindent
1420 This has no bug because @code{save_y} is used only if it is set.
1421
1422 Some spurious warnings can be avoided if you declare all the functions
1423 you use that never return as @code{noreturn}.  @xref{Function
1424 Attributes}.
1425
1426 @item -Wreorder (C++ only)
1427 @cindex reordering, warning
1428 @cindex warning for reordering of member initializers
1429 Warn when the order of member initializers given in the code does not
1430 match the order in which they must be executed.  For instance:
1431
1432 @smallexample
1433 struct A @{
1434   int i;
1435   int j;
1436   A(): j (0), i (1) @{ @}
1437 @};
1438 @end smallexample
1439
1440 Here the compiler will warn that the member initializers for @samp{i}
1441 and @samp{j} will be rearranged to match the declaration order of the
1442 members.
1443
1444 @item -Wtemplate-debugging
1445 @cindex template debugging
1446 When using templates in a C++ program, warn if debugging is not yet
1447 fully available (C++ only).
1448
1449 @item -Wunknown-pragmas
1450 @cindex warning for unknown pragmas
1451 @cindex unknown pragmas, warning
1452 @cindex pragmas, warning of unknown
1453 Warn when a #pragma directive is encountered which is not understood by
1454 GCC.  If this command line option is used, warnings will even be issued
1455 for unknown pragmas in system header files.  This is not the case if
1456 the warnings were only enabled by the @samp{-Wall} command line option.
1457
1458 @item -Wall
1459 All of the above @samp{-W} options combined.  This enables all the
1460 warnings about constructions that some users consider questionable, and
1461 that are easy to avoid (or modify to prevent the warning), even in
1462 conjunction with macros.
1463 @end table
1464
1465 The following @samp{-W@dots{}} options are not implied by @samp{-Wall}.
1466 Some of them warn about constructions that users generally do not
1467 consider questionable, but which occasionally you might wish to check
1468 for; others warn about constructions that are necessary or hard to avoid
1469 in some cases, and there is no simple way to modify the code to suppress
1470 the warning.
1471
1472 @table @code
1473 @item -W
1474 Print extra warning messages for these events:
1475
1476 @itemize @bullet
1477 @cindex @code{longjmp} warnings
1478 @item
1479 A nonvolatile automatic variable might be changed by a call to
1480 @code{longjmp}.  These warnings as well are possible only in
1481 optimizing compilation.
1482
1483 The compiler sees only the calls to @code{setjmp}.  It cannot know
1484 where @code{longjmp} will be called; in fact, a signal handler could
1485 call it at any point in the code.  As a result, you may get a warning
1486 even when there is in fact no problem because @code{longjmp} cannot
1487 in fact be called at the place which would cause a problem.
1488
1489 @item
1490 A function can return either with or without a value.  (Falling
1491 off the end of the function body is considered returning without
1492 a value.)  For example, this function would evoke such a
1493 warning:
1494
1495 @smallexample
1496 @group
1497 foo (a)
1498 @{
1499   if (a > 0)
1500     return a;
1501 @}
1502 @end group
1503 @end smallexample
1504
1505 @item
1506 An expression-statement or the left-hand side of a comma expression
1507 contains no side effects.
1508 To suppress the warning, cast the unused expression to void.
1509 For example, an expression such as @samp{x[i,j]} will cause a warning,
1510 but @samp{x[(void)i,j]} will not.
1511
1512 @item
1513 An unsigned value is compared against zero with @samp{<} or @samp{<=}.
1514
1515 @item
1516 A comparison like @samp{x<=y<=z} appears; this is equivalent to
1517 @samp{(x<=y ? 1 : 0) <= z}, which is a different interpretation from
1518 that of ordinary mathematical notation.
1519
1520 @item
1521 Storage-class specifiers like @code{static} are not the first things in
1522 a declaration.  According to the C Standard, this usage is obsolescent.
1523
1524 @item
1525 If @samp{-Wall} or @samp{-Wunused} is also specified, warn about unused
1526 arguments.
1527
1528 @item
1529 A comparison between signed and unsigned values could produce an
1530 incorrect result when the signed value is converted to unsigned.
1531 (But don't warn if @samp{-Wno-sign-compare} is also specified.)
1532
1533 @item
1534 An aggregate has a partly bracketed initializer.
1535 For example, the following code would evoke such a warning,
1536 because braces are missing around the initializer for @code{x.h}:
1537
1538 @smallexample
1539 struct s @{ int f, g; @};
1540 struct t @{ struct s h; int i; @};
1541 struct t x = @{ 1, 2, 3 @};
1542 @end smallexample
1543
1544 @item
1545 An aggregate has an initializer which does not initialize all members.
1546 For example, the following code would cause such a warning, because
1547 @code{x.h} would be implicitly initialized to zero:
1548
1549 @smallexample
1550 struct s @{ int f, g, h; @};
1551 struct s x = @{ 3, 4 @};
1552 @end smallexample
1553 @end itemize
1554
1555 @item -Wtraditional
1556 Warn about certain constructs that behave differently in traditional and
1557 ANSI C.
1558
1559 @itemize @bullet
1560 @item
1561 Macro arguments occurring within string constants in the macro body.
1562 These would substitute the argument in traditional C, but are part of
1563 the constant in ANSI C.
1564
1565 @item
1566 A function declared external in one block and then used after the end of
1567 the block.
1568
1569 @item
1570 A @code{switch} statement has an operand of type @code{long}.
1571
1572 @item
1573 A non-@code{static} function declaration follows a @code{static} one.
1574 This construct is not accepted by some traditional C compilers.
1575 @end itemize
1576
1577 @item -Wundef
1578 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
1579
1580 @item -Wshadow
1581 Warn whenever a local variable shadows another local variable.
1582
1583 @item -Wid-clash-@var{len}
1584 Warn whenever two distinct identifiers match in the first @var{len}
1585 characters.  This may help you prepare a program that will compile
1586 with certain obsolete, brain-damaged compilers.
1587
1588 @item -Wlarger-than-@var{len}
1589 Warn whenever an object of larger than @var{len} bytes is defined.
1590
1591 @item -Wpointer-arith
1592 Warn about anything that depends on the ``size of'' a function type or
1593 of @code{void}.  GNU C assigns these types a size of 1, for
1594 convenience in calculations with @code{void *} pointers and pointers
1595 to functions.
1596
1597 @item -Wbad-function-cast
1598 Warn whenever a function call is cast to a non-matching type.
1599 For example, warn if @code{int malloc()} is cast to @code{anything *}.
1600
1601 @item -Wcast-qual
1602 Warn whenever a pointer is cast so as to remove a type qualifier from
1603 the target type.  For example, warn if a @code{const char *} is cast
1604 to an ordinary @code{char *}.
1605
1606 @item -Wcast-align
1607 Warn whenever a pointer is cast such that the required alignment of the
1608 target is increased.  For example, warn if a @code{char *} is cast to
1609 an @code{int *} on machines where integers can only be accessed at
1610 two- or four-byte boundaries.
1611
1612 @item -Wwrite-strings
1613 Give string constants the type @code{const char[@var{length}]} so that
1614 copying the address of one into a non-@code{const} @code{char *}
1615 pointer will get a warning.  These warnings will help you find at
1616 compile time code that can try to write into a string constant, but
1617 only if you have been very careful about using @code{const} in
1618 declarations and prototypes.  Otherwise, it will just be a nuisance;
1619 this is why we did not make @samp{-Wall} request these warnings.
1620
1621 @item -Wconversion
1622 Warn if a prototype causes a type conversion that is different from what
1623 would happen to the same argument in the absence of a prototype.  This
1624 includes conversions of fixed point to floating and vice versa, and
1625 conversions changing the width or signedness of a fixed point argument
1626 except when the same as the default promotion.
1627
1628 Also, warn if a negative integer constant expression is implicitly
1629 converted to an unsigned type.  For example, warn about the assignment
1630 @code{x = -1} if @code{x} is unsigned.  But do not warn about explicit
1631 casts like @code{(unsigned) -1}.
1632
1633 @item -Wsign-compare
1634 @cindex warning for comparison of signed and unsigned values
1635 @cindex comparison of signed and unsigned values, warning
1636 @cindex signed and unsigned values, comparison warning
1637 Warn when a comparison between signed and unsigned values could produce
1638 an incorrect result when the signed value is converted to unsigned.
1639 This warning is also enabled by @samp{-W}; to get the other warnings
1640 of @samp{-W} without this warning, use @samp{-W -Wno-sign-compare}.
1641
1642 @item -Waggregate-return
1643 Warn if any functions that return structures or unions are defined or
1644 called.  (In languages where you can return an array, this also elicits
1645 a warning.)
1646
1647 @item -Wstrict-prototypes
1648 Warn if a function is declared or defined without specifying the
1649 argument types.  (An old-style function definition is permitted without
1650 a warning if preceded by a declaration which specifies the argument
1651 types.)
1652
1653 @item -Wmissing-prototypes
1654 Warn if a global function is defined without a previous prototype
1655 declaration.  This warning is issued even if the definition itself
1656 provides a prototype.  The aim is to detect global functions that fail
1657 to be declared in header files.
1658
1659 @item -Wmissing-declarations
1660 Warn if a global function is defined without a previous declaration.
1661 Do so even if the definition itself provides a prototype.
1662 Use this option to detect global functions that are not declared in
1663 header files.
1664
1665 @item -Wmissing-noreturn
1666 Warn about functions which might be candidates for attribute @code{noreturn}.
1667 Note these are only possible candidates, not absolute ones.  Care should
1668 be taken to manually verify functions actually do not ever return before
1669 adding the @code{noreturn} attribute, otherwise subtle code generation
1670 bugs could be introduced.
1671
1672 @item -Wredundant-decls
1673 Warn if anything is declared more than once in the same scope, even in
1674 cases where multiple declaration is valid and changes nothing.
1675
1676 @item -Wnested-externs
1677 Warn if an @code{extern} declaration is encountered within an function.
1678
1679 @item -Wno-non-template-friend
1680 Disable warnings when non-templatized friend functions are declared
1681 within a template. With the advent of explicit template specification
1682 support in g++, if the name of the friend is an unqualified-id (ie,
1683 @samp{friend foo(int)}), the C++ language specification demands that the
1684 friend declare or define an ordinary, nontemplate function. (Section
1685 14.5.3). Before g++ implemented explicit specification, unqualified-ids
1686 could be interpreted as a particular specialization of a templatized
1687 function. Because this non-conforming behavior is no longer the default
1688 behavior for g++, @samp{-Wnon-template-friend} allows the compiler to
1689 check existing code for potential trouble spots, and is on by default.
1690 This new compiler behavior can also be turned off with the flag
1691 @samp{-fguiding-decls}, which activates the older, non-specification
1692 compiler code, or with @samp{-Wno-non-template-friend} which keeps the
1693 conformant compiler code but disables the helpful warning.
1694
1695 @item -Winline
1696 Warn if a function can not be inlined, and either it was declared as inline,
1697 or else the @samp{-finline-functions} option was given.
1698
1699 @item -Wold-style-cast
1700 Warn if an old-style (C-style) cast is used within a program.
1701
1702 @item -Woverloaded-virtual
1703 @cindex overloaded virtual fn, warning
1704 @cindex warning for overloaded virtual fn
1705 Warn when a derived class function declaration may be an error in
1706 defining a virtual function (C++ only).  In a derived class, the
1707 definitions of virtual functions must match the type signature of a
1708 virtual function declared in the base class.  With this option, the
1709 compiler warns when you define a function with the same name as a
1710 virtual function, but with a type signature that does not match any
1711 declarations from the base class.
1712
1713 @item -Wsynth (C++ only)
1714 @cindex warning for synthesized methods
1715 @cindex synthesized methods, warning
1716 Warn when g++'s synthesis behavior does not match that of cfront.  For
1717 instance:
1718
1719 @smallexample
1720 struct A @{
1721   operator int ();
1722   A& operator = (int);
1723 @};
1724
1725 main ()
1726 @{
1727   A a,b;
1728   a = b;
1729 @}
1730 @end smallexample
1731
1732 In this example, g++ will synthesize a default @samp{A& operator =
1733 (const A&);}, while cfront will use the user-defined @samp{operator =}.
1734
1735 @item -Wlong-long
1736 Warn if @samp{long long} type is used.  This is default.  To inhibit
1737 the warning messages, use @samp{-Wno-long-long}.  Flags
1738 @samp{-Wlong-long} and @samp{-Wno-long-long} are taken into account
1739 only when @samp{-pedantic} flag is used.
1740
1741 @item -Werror
1742 Make all warnings into errors.
1743 @end table
1744
1745 @node Debugging Options
1746 @section Options for Debugging Your Program or GNU CC
1747 @cindex options, debugging
1748 @cindex debugging information options
1749
1750 GNU CC has various special options that are used for debugging
1751 either your program or GCC:
1752
1753 @table @code
1754 @item -g
1755 Produce debugging information in the operating system's native format
1756 (stabs, COFF, XCOFF, or DWARF).  GDB can work with this debugging
1757 information.
1758
1759 On most systems that use stabs format, @samp{-g} enables use of extra
1760 debugging information that only GDB can use; this extra information
1761 makes debugging work better in GDB but will probably make other debuggers
1762 crash or
1763 refuse to read the program.  If you want to control for certain whether
1764 to generate the extra information, use @samp{-gstabs+}, @samp{-gstabs},
1765 @samp{-gxcoff+}, @samp{-gxcoff}, @samp{-gdwarf-1+}, or @samp{-gdwarf-1}
1766 (see below).
1767
1768 Unlike most other C compilers, GNU CC allows you to use @samp{-g} with
1769 @samp{-O}.  The shortcuts taken by optimized code may occasionally
1770 produce surprising results: some variables you declared may not exist
1771 at all; flow of control may briefly move where you did not expect it;
1772 some statements may not be executed because they compute constant
1773 results or their values were already at hand; some statements may
1774 execute in different places because they were moved out of loops.
1775
1776 Nevertheless it proves possible to debug optimized output.  This makes
1777 it reasonable to use the optimizer for programs that might have bugs.
1778
1779 The following options are useful when GNU CC is generated with the
1780 capability for more than one debugging format.
1781
1782 @item -ggdb
1783 Produce debugging information for use by GDB.  This means to use the
1784 most expressive format available (DWARF 2, stabs, or the native format
1785 if neither of those are supported), including GDB extensions if at all
1786 possible.
1787
1788 @item -gstabs
1789 Produce debugging information in stabs format (if that is supported),
1790 without GDB extensions.  This is the format used by DBX on most BSD
1791 systems.  On MIPS, Alpha and System V Release 4 systems this option
1792 produces stabs debugging output which is not understood by DBX or SDB.
1793 On System V Release 4 systems this option requires the GNU assembler.
1794
1795 @item -gstabs+
1796 Produce debugging information in stabs format (if that is supported),
1797 using GNU extensions understood only by the GNU debugger (GDB).  The
1798 use of these extensions is likely to make other debuggers crash or
1799 refuse to read the program.
1800
1801 @item -gcoff
1802 Produce debugging information in COFF format (if that is supported).
1803 This is the format used by SDB on most System V systems prior to
1804 System V Release 4.
1805
1806 @item -gxcoff
1807 Produce debugging information in XCOFF format (if that is supported).
1808 This is the format used by the DBX debugger on IBM RS/6000 systems.
1809
1810 @item -gxcoff+
1811 Produce debugging information in XCOFF format (if that is supported),
1812 using GNU extensions understood only by the GNU debugger (GDB).  The
1813 use of these extensions is likely to make other debuggers crash or
1814 refuse to read the program, and may cause assemblers other than the GNU
1815 assembler (GAS) to fail with an error.
1816
1817 @item -gdwarf
1818 Produce debugging information in DWARF version 1 format (if that is
1819 supported).  This is the format used by SDB on most System V Release 4
1820 systems.
1821
1822 @item -gdwarf+
1823 Produce debugging information in DWARF version 1 format (if that is
1824 supported), using GNU extensions understood only by the GNU debugger
1825 (GDB).  The use of these extensions is likely to make other debuggers
1826 crash or refuse to read the program.
1827
1828 @item -gdwarf-2
1829 Produce debugging information in DWARF version 2 format (if that is
1830 supported).  This is the format used by DBX on IRIX 6.
1831
1832 @item -g@var{level}
1833 @itemx -ggdb@var{level}
1834 @itemx -gstabs@var{level}
1835 @itemx -gcoff@var{level}
1836 @itemx -gxcoff@var{level}
1837 @itemx -gdwarf@var{level}
1838 @itemx -gdwarf-2@var{level}
1839 Request debugging information and also use @var{level} to specify how
1840 much information.  The default level is 2.
1841
1842 Level 1 produces minimal information, enough for making backtraces in
1843 parts of the program that you don't plan to debug.  This includes
1844 descriptions of functions and external variables, but no information
1845 about local variables and no line numbers.
1846
1847 Level 3 includes extra information, such as all the macro definitions
1848 present in the program.  Some debuggers support macro expansion when
1849 you use @samp{-g3}.
1850
1851 @cindex @code{prof}
1852 @item -p
1853 Generate extra code to write profile information suitable for the
1854 analysis program @code{prof}.  You must use this option when compiling
1855 the source files you want data about, and you must also use it when
1856 linking.
1857
1858 @cindex @code{gprof}
1859 @item -pg
1860 Generate extra code to write profile information suitable for the
1861 analysis program @code{gprof}.  You must use this option when compiling
1862 the source files you want data about, and you must also use it when
1863 linking.
1864
1865 @cindex @code{tcov}
1866 @item -a
1867 Generate extra code to write profile information for basic blocks, which will
1868 record the number of times each basic block is executed, the basic block start
1869 address, and the function name containing the basic block.  If @samp{-g} is
1870 used, the line number and filename of the start of the basic block will also be
1871 recorded.  If not overridden by the machine description, the default action is
1872 to append to the text file @file{bb.out}.
1873
1874 This data could be analyzed by a program like @code{tcov}.  Note,
1875 however, that the format of the data is not what @code{tcov} expects.
1876 Eventually GNU @code{gprof} should be extended to process this data.
1877
1878 @item -Q
1879 Makes the compiler print out each function name as it is compiled, and
1880 print some statistics about each pass when it finishes.
1881
1882 @item -ax
1883 Generate extra code to profile basic blocks.  Your executable will
1884 produce output that is a superset of that produced when @samp{-a} is
1885 used.  Additional output is the source and target address of the basic
1886 blocks where a jump takes place, the number of times a jump is executed,
1887 and (optionally) the complete sequence of basic blocks being executed.
1888 The output is appended to file @file{bb.out}.
1889
1890 You can examine different profiling aspects without recompilation.  Your
1891 executable will read a list of function names from file @file{bb.in}.
1892 Profiling starts when a function on the list is entered and stops when
1893 that invocation is exited.  To exclude a function from profiling, prefix
1894 its name with `-'.  If a function name is not unique, you can
1895 disambiguate it by writing it in the form
1896 @samp{/path/filename.d:functionname}.  Your executable will write the
1897 available paths and filenames in file @file{bb.out}.
1898
1899 Several function names have a special meaning:
1900 @table @code
1901 @item __bb_jumps__
1902 Write source, target and frequency of jumps to file @file{bb.out}.
1903 @item __bb_hidecall__
1904 Exclude function calls from frequency count.
1905 @item __bb_showret__
1906 Include function returns in frequency count.
1907 @item __bb_trace__
1908 Write the sequence of basic blocks executed to file @file{bbtrace.gz}.
1909 The file will be compressed using the program @samp{gzip}, which must
1910 exist in your @code{PATH}.  On systems without the @samp{popen}
1911 function, the file will be named @file{bbtrace} and will not be
1912 compressed.  @strong{Profiling for even a few seconds on these systems
1913 will produce a very large file.}  Note: @code{__bb_hidecall__} and
1914 @code{__bb_showret__} will not affect the sequence written to
1915 @file{bbtrace.gz}.
1916 @end table
1917
1918 Here's a short example using different profiling parameters
1919 in file @file{bb.in}.  Assume function @code{foo} consists of basic blocks
1920 1 and 2 and is called twice from block 3 of function @code{main}.  After
1921 the calls, block 3 transfers control to block 4 of @code{main}.
1922
1923 With @code{__bb_trace__} and @code{main} contained in file @file{bb.in},
1924 the following sequence of blocks is written to file @file{bbtrace.gz}:
1925 0 3 1 2 1 2 4.  The return from block 2 to block 3 is not shown, because
1926 the return is to a point inside the block and not to the top.  The
1927 block address 0 always indicates, that control is transferred
1928 to the trace from somewhere outside the observed functions.  With
1929 @samp{-foo} added to @file{bb.in}, the blocks of function
1930 @code{foo} are removed from the trace, so only 0 3 4 remains.
1931
1932 With @code{__bb_jumps__} and @code{main} contained in file @file{bb.in},
1933 jump frequencies will be written to file @file{bb.out}.  The
1934 frequencies are obtained by constructing a trace of blocks
1935 and incrementing a counter for every neighbouring pair of blocks
1936 in the trace.  The trace 0 3 1 2 1 2 4 displays the following
1937 frequencies:
1938
1939 @example
1940 Jump from block 0x0 to block 0x3 executed 1 time(s)
1941 Jump from block 0x3 to block 0x1 executed 1 time(s)
1942 Jump from block 0x1 to block 0x2 executed 2 time(s)
1943 Jump from block 0x2 to block 0x1 executed 1 time(s)
1944 Jump from block 0x2 to block 0x4 executed 1 time(s)
1945 @end example
1946
1947 With @code{__bb_hidecall__}, control transfer due to call instructions
1948 is removed from the trace, that is the trace is cut into three parts: 0
1949 3 4, 0 1 2 and 0 1 2.  With @code{__bb_showret__}, control transfer due
1950 to return instructions is added to the trace.  The trace becomes: 0 3 1
1951 2 3 1 2 3 4.  Note, that this trace is not the same, as the sequence
1952 written to @file{bbtrace.gz}.  It is solely used for counting jump
1953 frequencies.
1954
1955 @item -fprofile-arcs
1956 Instrument @dfn{arcs} during compilation.  For each function of your
1957 program, GNU CC creates a program flow graph, then finds a spanning tree
1958 for the graph.  Only arcs that are not on the spanning tree have to be
1959 instrumented: the compiler adds code to count the number of times that these
1960 arcs are executed.  When an arc is the only exit or only entrance to a
1961 block, the instrumentation code can be added to the block; otherwise, a
1962 new basic block must be created to hold the instrumentation code.
1963
1964 Since not every arc in the program must be instrumented, programs
1965 compiled with this option run faster than programs compiled with
1966 @samp{-a}, which adds instrumentation code to every basic block in the
1967 program.  The tradeoff: since @code{gcov} does not have
1968 execution counts for all branches, it must start with the execution
1969 counts for the instrumented branches, and then iterate over the program
1970 flow graph until the entire graph has been solved.  Hence, @code{gcov}
1971 runs a little more slowly than a program which uses information from
1972 @samp{-a}.
1973
1974 @samp{-fprofile-arcs} also makes it possible to estimate branch
1975 probabilities, and to calculate basic block execution counts.  In
1976 general, basic block execution counts do not give enough information to
1977 estimate all branch probabilities.  When the compiled program exits, it
1978 saves the arc execution counts to a file called
1979 @file{@var{sourcename}.da}.  Use the compiler option
1980 @samp{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
1981 Control Optimization}) when recompiling, to optimize using estimated
1982 branch probabilities.
1983
1984 @need 2000
1985 @item -ftest-coverage
1986 Create data files for the @code{gcov} code-coverage utility
1987 (@pxref{Gcov,, @code{gcov}: a GNU CC Test Coverage Program}).
1988 The data file names begin with the name of your source file:
1989
1990 @table @code
1991 @item @var{sourcename}.bb
1992 A mapping from basic blocks to line numbers, which @code{gcov} uses to
1993 associate basic block execution counts with line numbers.
1994
1995 @item @var{sourcename}.bbg
1996 A list of all arcs in the program flow graph.  This allows @code{gcov}
1997 to reconstruct the program flow graph, so that it can compute all basic
1998 block and arc execution counts from the information in the
1999 @code{@var{sourcename}.da} file (this last file is the output from
2000 @samp{-fprofile-arcs}).
2001 @end table
2002
2003 @item -Q
2004 Makes the compiler print out each function name as it is compiled, and
2005 print some statistics about each pass when it finishes.
2006
2007 @item -d@var{letters}
2008 Says to make debugging dumps during compilation at times specified by
2009 @var{letters}.  This is used for debugging the compiler.  The file names
2010 for most of the dumps are made by appending a word to the source file
2011 name (e.g.  @file{foo.c.rtl} or @file{foo.c.jump}).  Here are the
2012 possible letters for use in @var{letters}, and their meanings:
2013
2014 @table @samp
2015 @item b
2016 Dump after computing branch probabilities, to @file{@var{file}.bp}.
2017 @item c
2018 Dump after instruction combination, to the file @file{@var{file}.combine}.
2019 @item d
2020 Dump after delayed branch scheduling, to @file{@var{file}.dbr}.
2021 @item D
2022 Dump all macro definitions, at the end of preprocessing, in addition to
2023 normal output.
2024 @item y
2025 Dump debugging information during parsing, to standard error.
2026 @item r
2027 Dump after RTL generation, to @file{@var{file}.rtl}.
2028 @item x
2029 Just generate RTL for a function instead of compiling it.  Usually used
2030 with @samp{r}.
2031 @item j
2032 Dump after first jump optimization, to @file{@var{file}.jump}.
2033 @item s
2034 Dump after CSE (including the jump optimization that sometimes
2035 follows CSE), to @file{@var{file}.cse}.
2036 @item F
2037 Dump after purging ADDRESSOF, to @file{@var{file}.addressof}.
2038 @item f
2039 Dump after flow analysis, to @file{@var{file}.flow}.
2040 @item g
2041 Dump after global register allocation, to @file{@var{file}.greg}.
2042 @item G      
2043 Dump after GCSE, to @file{@var{file}.gcse}.
2044 @item j
2045 Dump after first jump optimization, to @file{@var{file}.jump}.
2046 @item J
2047 Dump after last jump optimization, to @file{@var{file}.jump2}.
2048 @item k
2049 Dump after conversion from registers to stack, to @file{@var{file}.stack}.
2050 @item l
2051 Dump after local register allocation, to @file{@var{file}.lreg}.
2052 @item L
2053 Dump after loop optimization, to @file{@var{file}.loop}.
2054 @item M
2055 Dump after performing the machine dependent reorganisation pass, to
2056 @file{@var{file}.mach}. 
2057 @item N
2058 Dump after the register move pass, to @file{@var{file}.regmove}.
2059 @item r
2060 Dump after RTL generation, to @file{@var{file}.rtl}.
2061 @item R
2062 Dump after the second instruction scheduling pass, to @file{@var{file}.sched2}.
2063 @item s
2064 Dump after CSE (including the jump optimization that sometimes follows
2065 CSE), to @file{@var{file}.cse}. 
2066 @item S
2067 Dump after the first instruction scheduling pass, to @file{@var{file}.sched}.
2068 @item t
2069 Dump after the second CSE pass (including the jump optimization that
2070 sometimes follows CSE), to @file{@var{file}.cse2}. 
2071 @item x
2072 Just generate RTL for a function instead of compiling it.  Usually used
2073 with @samp{r}.
2074 @item a
2075 Produce all the dumps listed above.
2076 @item m
2077 Print statistics on memory usage, at the end of the run, to
2078 standard error.
2079 @item p
2080 Annotate the assembler output with a comment indicating which
2081 pattern and alternative was used.
2082 @item y
2083 Dump debugging information during parsing, to standard error.
2084 @item A
2085 Annotate the assembler output with miscellaneous debugging information.
2086 @end table
2087
2088 @item -fdump-unnumbered
2089 When doing debugging dumps (see -d option above), suppress instruction
2090 numbers and line number note output.  This makes it more feasible to
2091 use diff on debugging dumps for compiler invokations with different
2092 options, in particular with and without -g.
2093
2094 @item -fpretend-float
2095 When running a cross-compiler, pretend that the target machine uses the
2096 same floating point format as the host machine.  This causes incorrect
2097 output of the actual floating constants, but the actual instruction
2098 sequence will probably be the same as GNU CC would make when running on
2099 the target machine.
2100
2101 @item -save-temps
2102 Store the usual ``temporary'' intermediate files permanently; place them
2103 in the current directory and name them based on the source file.  Thus,
2104 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
2105 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.
2106
2107 @item -print-file-name=@var{library}
2108 Print the full absolute name of the library file @var{library} that
2109 would be used when linking---and don't do anything else.  With this
2110 option, GNU CC does not compile or link anything; it just prints the
2111 file name.
2112
2113 @item -print-prog-name=@var{program}
2114 Like @samp{-print-file-name}, but searches for a program such as @samp{cpp}.
2115
2116 @item -print-libgcc-file-name
2117 Same as @samp{-print-file-name=libgcc.a}.
2118
2119 This is useful when you use @samp{-nostdlib} or @samp{-nodefaultlibs}
2120 but you do want to link with @file{libgcc.a}.  You can do
2121
2122 @example
2123 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
2124 @end example
2125
2126 @item -print-search-dirs
2127 Print the name of the configured installation directory and a list of
2128 program and library directories gcc will search---and don't do anything else.
2129
2130 This is useful when gcc prints the error message
2131 @samp{installation problem, cannot exec cpp: No such file or directory}.
2132 To resolve this you either need to put @file{cpp} and the other compiler
2133 components where gcc expects to find them, or you can set the environment
2134 variable @code{GCC_EXEC_PREFIX} to the directory where you installed them.
2135 Don't forget the trailing '/'.
2136 @xref{Environment Variables}.
2137 @end table
2138
2139 @node Optimize Options
2140 @section Options That Control Optimization
2141 @cindex optimize options
2142 @cindex options, optimization
2143
2144 These options control various sorts of optimizations:
2145
2146 @table @code
2147 @item -O
2148 @itemx -O1
2149 Optimize.  Optimizing compilation takes somewhat more time, and a lot
2150 more memory for a large function.
2151
2152 Without @samp{-O}, the compiler's goal is to reduce the cost of
2153 compilation and to make debugging produce the expected results.
2154 Statements are independent: if you stop the program with a breakpoint
2155 between statements, you can then assign a new value to any variable or
2156 change the program counter to any other statement in the function and
2157 get exactly the results you would expect from the source code.
2158
2159 Without @samp{-O}, the compiler only allocates variables declared
2160 @code{register} in registers.  The resulting compiled code is a little
2161 worse than produced by PCC without @samp{-O}.
2162
2163 With @samp{-O}, the compiler tries to reduce code size and execution
2164 time.
2165
2166 When you specify @samp{-O}, the compiler turns on @samp{-fthread-jumps}
2167 and @samp{-fdefer-pop} on all machines.  The compiler turns on
2168 @samp{-fdelayed-branch} on machines that have delay slots, and
2169 @samp{-fomit-frame-pointer} on machines that can support debugging even
2170 without a frame pointer.  On some machines the compiler also turns
2171 on other flags.@refill
2172
2173 @item -O2
2174 Optimize even more.  GNU CC performs nearly all supported optimizations
2175 that do not involve a space-speed tradeoff.  The compiler does not
2176 perform loop unrolling or function inlining when you specify @samp{-O2}.
2177 As compared to @samp{-O}, this option increases both compilation time
2178 and the performance of the generated code.
2179
2180 @samp{-O2} turns on all optional optimizations except for loop unrolling
2181 and function inlining.  It also turns on the @samp{-fforce-mem} option
2182 on all machines and frame pointer elimination on machines where doing so
2183 does not interfere with debugging.
2184
2185 @item -O3
2186 Optimize yet more.  @samp{-O3} turns on all optimizations specified by
2187 @samp{-O2} and also turns on the @samp{inline-functions} option.
2188
2189 @item -O0
2190 Do not optimize.
2191
2192 @item -Os
2193 Optimize for size.  @samp{-Os} enables all @samp{-O2} optimizations that
2194 do not typically increase code size.  It also performs further
2195 optimizations designed to reduce code size.
2196
2197 If you use multiple @samp{-O} options, with or without level numbers,
2198 the last such option is the one that is effective.
2199 @end table
2200
2201 Options of the form @samp{-f@var{flag}} specify machine-independent
2202 flags.  Most flags have both positive and negative forms; the negative
2203 form of @samp{-ffoo} would be @samp{-fno-foo}.  In the table below,
2204 only one of the forms is listed---the one which is not the default.
2205 You can figure out the other form by either removing @samp{no-} or
2206 adding it.
2207
2208 @table @code
2209 @item -ffloat-store
2210 Do not store floating point variables in registers, and inhibit other
2211 options that might change whether a floating point value is taken from a
2212 register or memory.
2213
2214 @cindex floating point precision
2215 This option prevents undesirable excess precision on machines such as
2216 the 68000 where the floating registers (of the 68881) keep more
2217 precision than a @code{double} is supposed to have.  Similarly for the
2218 x86 architecture.  For most programs, the excess precision does only
2219 good, but a few programs rely on the precise definition of IEEE floating
2220 point.  Use @samp{-ffloat-store} for such programs, after modifying
2221 them to store all pertinent intermediate computations into variables.
2222
2223 @item -fno-default-inline
2224 Do not make member functions inline by default merely because they are
2225 defined inside the class scope (C++ only).  Otherwise, when you specify
2226 @w{@samp{-O}}, member functions defined inside class scope are compiled
2227 inline by default; i.e., you don't need to add @samp{inline} in front of
2228 the member function name.
2229
2230 @item -fno-defer-pop
2231 Always pop the arguments to each function call as soon as that function
2232 returns.  For machines which must pop arguments after a function call,
2233 the compiler normally lets arguments accumulate on the stack for several
2234 function calls and pops them all at once.
2235
2236 @item -fforce-mem
2237 Force memory operands to be copied into registers before doing
2238 arithmetic on them.  This produces better code by making all memory
2239 references potential common subexpressions.  When they are not common
2240 subexpressions, instruction combination should eliminate the separate
2241 register-load.  The @samp{-O2} option turns on this option.
2242
2243 @item -fforce-addr
2244 Force memory address constants to be copied into registers before
2245 doing arithmetic on them.  This may produce better code just as
2246 @samp{-fforce-mem} may.
2247
2248 @item -fomit-frame-pointer
2249 Don't keep the frame pointer in a register for functions that
2250 don't need one.  This avoids the instructions to save, set up and
2251 restore frame pointers; it also makes an extra register available
2252 in many functions.  @strong{It also makes debugging impossible on
2253 some machines.}
2254
2255 @ifset INTERNALS
2256 On some machines, such as the Vax, this flag has no effect, because
2257 the standard calling sequence automatically handles the frame pointer
2258 and nothing is saved by pretending it doesn't exist.  The
2259 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
2260 whether a target machine supports this flag.  @xref{Registers}.@refill
2261 @end ifset
2262 @ifclear INTERNALS
2263 On some machines, such as the Vax, this flag has no effect, because
2264 the standard calling sequence automatically handles the frame pointer
2265 and nothing is saved by pretending it doesn't exist.  The
2266 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
2267 whether a target machine supports this flag.  @xref{Registers,,Register
2268 Usage, gcc.info, Using and Porting GCC}.@refill
2269 @end ifclear
2270
2271 @item -fno-inline
2272 Don't pay attention to the @code{inline} keyword.  Normally this option
2273 is used to keep the compiler from expanding any functions inline.
2274 Note that if you are not optimizing, no functions can be expanded inline.
2275
2276 @item -finline-functions
2277 Integrate all simple functions into their callers.  The compiler
2278 heuristically decides which functions are simple enough to be worth
2279 integrating in this way.
2280
2281 If all calls to a given function are integrated, and the function is
2282 declared @code{static}, then the function is normally not output as
2283 assembler code in its own right.
2284
2285 @item -fkeep-inline-functions
2286 Even if all calls to a given function are integrated, and the function
2287 is declared @code{static}, nevertheless output a separate run-time
2288 callable version of the function.  This switch does not affect
2289 @code{extern inline} functions.
2290
2291 @item -fkeep-static-consts
2292 Emit variables declared @code{static const} when optimization isn't turned
2293 on, even if the variables aren't referenced.
2294
2295 GNU CC enables this option by default.  If you want to force the compiler to
2296 check if the variable was referenced, regardless of whether or not
2297 optimization is turned on, use the @samp{-fno-keep-static-consts} option.
2298
2299 @item -fno-function-cse
2300 Do not put function addresses in registers; make each instruction that
2301 calls a constant function contain the function's address explicitly.
2302
2303 This option results in less efficient code, but some strange hacks
2304 that alter the assembler output may be confused by the optimizations
2305 performed when this option is not used.
2306
2307 @item -ffast-math
2308 This option allows GCC to violate some ANSI or IEEE rules and/or
2309 specifications in the interest of optimizing code for speed.  For
2310 example, it allows the compiler to assume arguments to the @code{sqrt}
2311 function are non-negative numbers and that no floating-point values
2312 are NaNs.
2313
2314 This option should never be turned on by any @samp{-O} option since
2315 it can result in incorrect output for programs which depend on
2316 an exact implementation of IEEE or ANSI rules/specifications for
2317 math functions.
2318 @end table
2319
2320 @c following causes underfulls.. they don't look great, but we deal.
2321 @c --mew 26jan93
2322 The following options control specific optimizations.  The @samp{-O2}
2323 option turns on all of these optimizations except @samp{-funroll-loops}
2324 and @samp{-funroll-all-loops}.  On most machines, the @samp{-O} option
2325 turns on the @samp{-fthread-jumps} and @samp{-fdelayed-branch} options,
2326 but specific machines may handle it differently.
2327
2328 You can use the following flags in the rare cases when ``fine-tuning''
2329 of optimizations to be performed is desired.
2330
2331 @table @code
2332 @item -fstrength-reduce
2333 Perform the optimizations of loop strength reduction and
2334 elimination of iteration variables.
2335
2336 @item -fthread-jumps
2337 Perform optimizations where we check to see if a jump branches to a
2338 location where another comparison subsumed by the first is found.  If
2339 so, the first branch is redirected to either the destination of the
2340 second branch or a point immediately following it, depending on whether
2341 the condition is known to be true or false.
2342
2343 @item -fcse-follow-jumps
2344 In common subexpression elimination, scan through jump instructions
2345 when the target of the jump is not reached by any other path.  For
2346 example, when CSE encounters an @code{if} statement with an
2347 @code{else} clause, CSE will follow the jump when the condition
2348 tested is false.
2349
2350 @item -fcse-skip-blocks
2351 This is similar to @samp{-fcse-follow-jumps}, but causes CSE to
2352 follow jumps which conditionally skip over blocks.  When CSE
2353 encounters a simple @code{if} statement with no else clause,
2354 @samp{-fcse-skip-blocks} causes CSE to follow the jump around the
2355 body of the @code{if}.
2356
2357 @item -frerun-cse-after-loop
2358 Re-run common subexpression elimination after loop optimizations has been
2359 performed.
2360
2361 @item -frerun-loop-opt
2362 Run the loop optimizer twice.
2363
2364 @item -fgcse
2365 Perform a global common subexpression elimination pass.
2366 This pass also performs global constant and copy propagation.
2367
2368 @item -fexpensive-optimizations
2369 Perform a number of minor optimizations that are relatively expensive.
2370
2371 @item -foptimize-register-moves
2372 @item -fregmove
2373 Attempt to reassign register numbers in move instructions and as
2374 operands of other simple instructions in order to maximize the amount of
2375 register tying.  This is especially helpful on machines with two-operand
2376 instructions.  GNU CC enables this optimization by default with @samp{-O2}
2377 or higher.
2378
2379 Note @code{-fregmove} and @code{-foptimize-register-moves} are the same
2380 optimization.
2381
2382 @item -fdelayed-branch
2383 If supported for the target machine, attempt to reorder instructions
2384 to exploit instruction slots available after delayed branch
2385 instructions.
2386
2387 @item -fschedule-insns
2388 If supported for the target machine, attempt to reorder instructions to
2389 eliminate execution stalls due to required data being unavailable.  This
2390 helps machines that have slow floating point or memory load instructions
2391 by allowing other instructions to be issued until the result of the load
2392 or floating point instruction is required.
2393
2394 @item -fschedule-insns2
2395 Similar to @samp{-fschedule-insns}, but requests an additional pass of
2396 instruction scheduling after register allocation has been done.  This is
2397 especially useful on machines with a relatively small number of
2398 registers and where memory load instructions take more than one cycle.
2399
2400 @item -ffunction-sections
2401 @item -fdata-sections
2402 Place each function or data item into its own section in the output
2403 file if the target supports arbitrary sections.  The name of the
2404 function or the name of the data item determines the section's name
2405 in the output file.
2406
2407 Use these options on systems where the linker can perform optimizations
2408 to improve locality of reference in the instruction space.  HPPA
2409 processors running HP-UX and Sparc processors running Solaris 2 have
2410 linkers with such optimizations.  Other systems using the ELF object format
2411 as well as AIX may have these optimizations in the future.
2412
2413 Only use these options when there are significant benefits from doing
2414 so.  When you specify these options, the assembler and linker will
2415 create larger object and executable files and will also be slower.
2416 You will not be able to use @code{gprof} on all systems if you
2417 specify this option and you may have problems with debugging if
2418 you specify both this option and @samp{-g}.
2419
2420 @item -fcaller-saves
2421 Enable values to be allocated in registers that will be clobbered by
2422 function calls, by emitting extra instructions to save and restore the
2423 registers around such calls.  Such allocation is done only when it
2424 seems to result in better code than would otherwise be produced.
2425
2426 This option is always enabled by default on certain machines, usually
2427 those which have no call-preserved registers to use instead.
2428
2429 For all machines, optimization level 2 and higher enables this flag by
2430 default.
2431
2432 @item -funroll-loops
2433 Perform the optimization of loop unrolling.  This is only done for loops
2434 whose number of iterations can be determined at compile time or run time.
2435 @samp{-funroll-loop} implies both @samp{-fstrength-reduce} and
2436 @samp{-frerun-cse-after-loop}.
2437
2438 @item -funroll-all-loops
2439 Perform the optimization of loop unrolling.  This is done for all loops
2440 and usually makes programs run more slowly.  @samp{-funroll-all-loops}
2441 implies @samp{-fstrength-reduce} as well as @samp{-frerun-cse-after-loop}.
2442
2443 @item -fmove-all-movables
2444 Forces all invariant computations in loops to be moved
2445 outside the loop.
2446
2447 @item -freduce-all-givs
2448 Forces all general-induction variables in loops to be
2449 strength-reduced.
2450
2451 @emph{Note:} When compiling programs written in Fortran,
2452 @samp{-fmove-all-moveables} and @samp{-freduce-all-givs} are enabled
2453 by default when you use the optimizer.
2454
2455 These options may generate better or worse code; results are highly
2456 dependent on the structure of loops within the source code.
2457
2458 These two options are intended to be removed someday, once
2459 they have helped determine the efficacy of various
2460 approaches to improving loop optimizations.
2461
2462 Please let us (@code{egcs@@egcs.cygnus.com} and @code{fortran@@gnu.org})
2463 know how use of these options affects
2464 the performance of your production code.
2465 We're very interested in code that runs @emph{slower}
2466 when these options are @emph{enabled}.
2467
2468 @item -fno-peephole
2469 Disable any machine-specific peephole optimizations.
2470
2471 @item -fbranch-probabilities
2472 After running a program compiled with @samp{-fprofile-arcs}
2473 (@pxref{Debugging Options,, Options for Debugging Your Program or
2474 @code{gcc}}), you can compile it a second time using
2475 @samp{-fbranch-probabilities}, to improve optimizations based on
2476 guessing the path a branch might take.
2477
2478 @ifset INTERNALS
2479 With @samp{-fbranch-probabilities}, GCC puts a @samp{REG_EXEC_COUNT}
2480 note on the first instruction of each basic block, and a
2481 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
2482 These can be used to improve optimization.  Currently, they are only
2483 used in one place: in @file{reorg.c}, instead of guessing which path a
2484 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
2485 exactly determine which path is taken more often.
2486 @end ifset
2487
2488 @item -fstrict-aliasing
2489 Allows the compiler to assume the strictest aliasing rules applicable to
2490 the language being compiled.  For C (and C++), this activates
2491 optimizations based on the type of expressions.  In particular, an
2492 object of one type is assumed never to reside at the same address as an
2493 object of a different type, unless the types are almost the same.  For
2494 example, an @code{unsigned int} can alias an @code{int}, but not a
2495 @code{void*} or a @code{double}.  A character type may alias any other
2496 type.  
2497
2498 Pay special attention to code like this:
2499 @example
2500 union a_union @{ 
2501   int i;
2502   double d;
2503 @};
2504
2505 int f() @{
2506   a_union t;
2507   t.d = 3.0;
2508   return t.i;
2509 @}
2510 @end example
2511 The practice of reading from a different union member than the one most
2512 recently written to (called ``type-punning'') is common.  Even with
2513 @samp{-fstrict-aliasing}, type-punning is allowed, provided the memory
2514 is accessed through the union type.  So, the code above will work as
2515 expected.  However, this code might not:
2516 @example
2517 int f() @{ 
2518   a_union t;
2519   int* ip;
2520   t.d = 3.0;
2521   ip = &t.i;
2522   return *ip;
2523 @}
2524 @end example
2525
2526 @ifset INTERNALS
2527 Every language that wishes to perform language-specific alias analysis
2528 should define a function that computes, given an @code{tree}
2529 node, an alias set for the node.  Nodes in different alias sets are not
2530 allowed to alias.  For an example, see the C front-end function
2531 @code{c_get_alias_set}.
2532 @end ifset
2533
2534 @end table
2535
2536 @node Preprocessor Options
2537 @section Options Controlling the Preprocessor
2538 @cindex preprocessor options
2539 @cindex options, preprocessor
2540
2541 These options control the C preprocessor, which is run on each C source
2542 file before actual compilation.
2543
2544 If you use the @samp{-E} option, nothing is done except preprocessing.
2545 Some of these options make sense only together with @samp{-E} because
2546 they cause the preprocessor output to be unsuitable for actual
2547 compilation.
2548
2549 @table @code
2550 @item -include @var{file}
2551 Process @var{file} as input before processing the regular input file.
2552 In effect, the contents of @var{file} are compiled first.  Any @samp{-D}
2553 and @samp{-U} options on the command line are always processed before
2554 @samp{-include @var{file}}, regardless of the order in which they are
2555 written.  All the @samp{-include} and @samp{-imacros} options are
2556 processed in the order in which they are written.
2557
2558 @item -imacros @var{file}
2559 Process @var{file} as input, discarding the resulting output, before
2560 processing the regular input file.  Because the output generated from
2561 @var{file} is discarded, the only effect of @samp{-imacros @var{file}}
2562 is to make the macros defined in @var{file} available for use in the
2563 main input.
2564
2565 Any @samp{-D} and @samp{-U} options on the command line are always
2566 processed before @samp{-imacros @var{file}}, regardless of the order in
2567 which they are written.  All the @samp{-include} and @samp{-imacros}
2568 options are processed in the order in which they are written.
2569
2570 @item -idirafter @var{dir}
2571 @cindex second include path
2572 Add the directory @var{dir} to the second include path.  The directories
2573 on the second include path are searched when a header file is not found
2574 in any of the directories in the main include path (the one that
2575 @samp{-I} adds to).
2576
2577 @item -iprefix @var{prefix}
2578 Specify @var{prefix} as the prefix for subsequent @samp{-iwithprefix}
2579 options.
2580
2581 @item -iwithprefix @var{dir}
2582 Add a directory to the second include path.  The directory's name is
2583 made by concatenating @var{prefix} and @var{dir}, where @var{prefix} was
2584 specified previously with @samp{-iprefix}.  If you have not specified a
2585 prefix yet, the directory containing the installed passes of the
2586 compiler is used as the default.
2587
2588 @item -iwithprefixbefore @var{dir}
2589 Add a directory to the main include path.  The directory's name is made
2590 by concatenating @var{prefix} and @var{dir}, as in the case of
2591 @samp{-iwithprefix}.
2592
2593 @item -isystem @var{dir}
2594 Add a directory to the beginning of the second include path, marking it
2595 as a system directory, so that it gets the same special treatment as
2596 is applied to the standard system directories.
2597
2598 @item -nostdinc
2599 Do not search the standard system directories for header files.  Only
2600 the directories you have specified with @samp{-I} options (and the
2601 current directory, if appropriate) are searched.  @xref{Directory
2602 Options}, for information on @samp{-I}.
2603
2604 By using both @samp{-nostdinc} and @samp{-I-}, you can limit the include-file
2605 search path to only those directories you specify explicitly.
2606
2607 @item -undef
2608 Do not predefine any nonstandard macros.  (Including architecture flags).
2609
2610 @item -E
2611 Run only the C preprocessor.  Preprocess all the C source files
2612 specified and output the results to standard output or to the
2613 specified output file.
2614
2615 @item -C
2616 Tell the preprocessor not to discard comments.  Used with the
2617 @samp{-E} option.
2618
2619 @item -P
2620 Tell the preprocessor not to generate @samp{#line} directives.
2621 Used with the @samp{-E} option.
2622
2623 @cindex make
2624 @cindex dependencies, make
2625 @item -M
2626 Tell the preprocessor to output a rule suitable for @code{make}
2627 describing the dependencies of each object file.  For each source file,
2628 the preprocessor outputs one @code{make}-rule whose target is the object
2629 file name for that source file and whose dependencies are all the
2630 @code{#include} header files it uses.  This rule may be a single line or
2631 may be continued with @samp{\}-newline if it is long.  The list of rules
2632 is printed on standard output instead of the preprocessed C program.
2633
2634 @samp{-M} implies @samp{-E}.
2635
2636 Another way to specify output of a @code{make} rule is by setting
2637 the environment variable @code{DEPENDENCIES_OUTPUT} (@pxref{Environment
2638 Variables}).
2639
2640 @item -MM
2641 Like @samp{-M} but the output mentions only the user header files
2642 included with @samp{#include "@var{file}"}.  System header files
2643 included with @samp{#include <@var{file}>} are omitted.
2644
2645 @item -MD
2646 Like @samp{-M} but the dependency information is written to a file made by
2647 replacing ".c" with ".d" at the end of the input file names.
2648 This is in addition to compiling the file as specified---@samp{-MD} does
2649 not inhibit ordinary compilation the way @samp{-M} does.
2650
2651 In Mach, you can use the utility @code{md} to merge multiple dependency
2652 files into a single dependency file suitable for using with the @samp{make}
2653 command.
2654
2655 @item -MMD
2656 Like @samp{-MD} except mention only user header files, not system
2657 header files.
2658
2659 @item -MG
2660 Treat missing header files as generated files and assume they live in the
2661 same directory as the source file.  If you specify @samp{-MG}, you
2662 must also specify either @samp{-M} or @samp{-MM}.  @samp{-MG} is not
2663 supported with @samp{-MD} or @samp{-MMD}.
2664
2665 @item -H
2666 Print the name of each header file used, in addition to other normal
2667 activities.
2668
2669 @item -A@var{question}(@var{answer})
2670 Assert the answer @var{answer} for @var{question}, in case it is tested
2671 with a preprocessing conditional such as @samp{#if
2672 #@var{question}(@var{answer})}.  @samp{-A-} disables the standard
2673 assertions that normally describe the target machine.
2674
2675 @item -D@var{macro}
2676 Define macro @var{macro} with the string @samp{1} as its definition.
2677
2678 @item -D@var{macro}=@var{defn}
2679 Define macro @var{macro} as @var{defn}.  All instances of @samp{-D} on
2680 the command line are processed before any @samp{-U} options.
2681
2682 @item -U@var{macro}
2683 Undefine macro @var{macro}.  @samp{-U} options are evaluated after all
2684 @samp{-D} options, but before any @samp{-include} and @samp{-imacros}
2685 options.
2686
2687 @item -dM
2688 Tell the preprocessor to output only a list of the macro definitions
2689 that are in effect at the end of preprocessing.  Used with the @samp{-E}
2690 option.
2691
2692 @item -dD
2693 Tell the preprocessing to pass all macro definitions into the output, in
2694 their proper sequence in the rest of the output.
2695
2696 @item -dN
2697 Like @samp{-dD} except that the macro arguments and contents are omitted.
2698 Only @samp{#define @var{name}} is included in the output.
2699
2700 @item -trigraphs
2701 Support ANSI C trigraphs.  The @samp{-ansi} option also has this effect.
2702
2703 @item -Wp,@var{option}
2704 Pass @var{option} as an option to the preprocessor.  If @var{option}
2705 contains commas, it is split into multiple options at the commas.
2706 @end table
2707
2708 @node Assembler Options
2709 @section Passing Options to the Assembler
2710
2711 @c prevent bad page break with this line
2712 You can pass options to the assembler.
2713
2714 @table @code
2715 @item -Wa,@var{option}
2716 Pass @var{option} as an option to the assembler.  If @var{option}
2717 contains commas, it is split into multiple options at the commas.
2718 @end table
2719
2720 @node Link Options
2721 @section Options for Linking
2722 @cindex link options
2723 @cindex options, linking
2724
2725 These options come into play when the compiler links object files into
2726 an executable output file.  They are meaningless if the compiler is
2727 not doing a link step.
2728
2729 @table @code
2730 @cindex file names
2731 @item @var{object-file-name}
2732 A file name that does not end in a special recognized suffix is
2733 considered to name an object file or library.  (Object files are
2734 distinguished from libraries by the linker according to the file
2735 contents.)  If linking is done, these object files are used as input
2736 to the linker.
2737
2738 @item -c
2739 @itemx -S
2740 @itemx -E
2741 If any of these options is used, then the linker is not run, and
2742 object file names should not be used as arguments.  @xref{Overall
2743 Options}.
2744
2745 @cindex Libraries
2746 @item -l@var{library}
2747 Search the library named @var{library} when linking.
2748
2749 It makes a difference where in the command you write this option; the
2750 linker searches processes libraries and object files in the order they
2751 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
2752 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
2753 to functions in @samp{z}, those functions may not be loaded.
2754
2755 The linker searches a standard list of directories for the library,
2756 which is actually a file named @file{lib@var{library}.a}.  The linker
2757 then uses this file as if it had been specified precisely by name.
2758
2759 The directories searched include several standard system directories
2760 plus any that you specify with @samp{-L}.
2761
2762 Normally the files found this way are library files---archive files
2763 whose members are object files.  The linker handles an archive file by
2764 scanning through it for members which define symbols that have so far
2765 been referenced but not defined.  But if the file that is found is an
2766 ordinary object file, it is linked in the usual fashion.  The only
2767 difference between using an @samp{-l} option and specifying a file name
2768 is that @samp{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
2769 and searches several directories.
2770
2771 @item -lobjc
2772 You need this special case of the @samp{-l} option in order to
2773 link an Objective C program.
2774
2775 @item -nostartfiles
2776 Do not use the standard system startup files when linking.
2777 The standard system libraries are used normally, unless @code{-nostdlib}
2778 or @code{-nodefaultlibs} is used.
2779
2780 @item -nodefaultlibs
2781 Do not use the standard system libraries when linking.
2782 Only the libraries you specify will be passed to the linker.
2783 The standard startup files are used normally, unless @code{-nostartfiles}
2784 is used.  The compiler may generate calls to memcmp, memset, and memcpy
2785 for System V (and ANSI C) environments or to bcopy and bzero for
2786 BSD environments.  These entries are usually resolved by entries in
2787 libc.  These entry points should be supplied through some other
2788 mechanism when this option is specified.
2789
2790 @item -nostdlib
2791 Do not use the standard system startup files or libraries when linking.
2792 No startup files and only the libraries you specify will be passed to
2793 the linker. The compiler may generate calls to memcmp, memset, and memcpy
2794 for System V (and ANSI C) environments or to bcopy and bzero for
2795 BSD environments.  These entries are usually resolved by entries in
2796 libc.  These entry points should be supplied through some other
2797 mechanism when this option is specified.
2798
2799 @cindex @code{-lgcc}, use with @code{-nostdlib}
2800 @cindex @code{-nostdlib} and unresolved references
2801 @cindex unresolved references and @code{-nostdlib}
2802 @cindex @code{-lgcc}, use with @code{-nodefaultlibs}
2803 @cindex @code{-nodefaultlibs} and unresolved references
2804 @cindex unresolved references and @code{-nodefaultlibs}
2805 One of the standard libraries bypassed by @samp{-nostdlib} and
2806 @samp{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
2807 that GNU CC uses to overcome shortcomings of particular machines, or special
2808 needs for some languages.
2809 @ifset INTERNALS
2810 (@xref{Interface,,Interfacing to GNU CC Output}, for more discussion of
2811 @file{libgcc.a}.)
2812 @end ifset
2813 @ifclear INTERNALS
2814 (@xref{Interface,,Interfacing to GNU CC Output,gcc.info,Porting GNU CC},
2815 for more discussion of @file{libgcc.a}.)
2816 @end ifclear
2817 In most cases, you need @file{libgcc.a} even when you want to avoid
2818 other standard libraries.  In other words, when you specify @samp{-nostdlib}
2819 or @samp{-nodefaultlibs} you should usually specify @samp{-lgcc} as well.
2820 This ensures that you have no unresolved references to internal GNU CC
2821 library subroutines.  (For example, @samp{__main}, used to ensure C++
2822 constructors will be called; @pxref{Collect2,,@code{collect2}}.)
2823
2824 @item -s
2825 Remove all symbol table and relocation information from the executable.
2826
2827 @item -static
2828 On systems that support dynamic linking, this prevents linking with the shared
2829 libraries.  On other systems, this option has no effect.
2830
2831 @item -shared
2832 Produce a shared object which can then be linked with other objects to
2833 form an executable.  Not all systems support this option.  You must
2834 also specify @samp{-fpic} or @samp{-fPIC} on some systems when
2835 you specify this option.
2836
2837 @item -symbolic
2838 Bind references to global symbols when building a shared object.  Warn
2839 about any unresolved references (unless overridden by the link editor
2840 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
2841 this option.
2842
2843 @item -Xlinker @var{option}
2844 Pass @var{option} as an option to the linker.  You can use this to
2845 supply system-specific linker options which GNU CC does not know how to
2846 recognize.
2847
2848 If you want to pass an option that takes an argument, you must use
2849 @samp{-Xlinker} twice, once for the option and once for the argument.
2850 For example, to pass @samp{-assert definitions}, you must write
2851 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
2852 @samp{-Xlinker "-assert definitions"}, because this passes the entire
2853 string as a single argument, which is not what the linker expects.
2854
2855 @item -Wl,@var{option}
2856 Pass @var{option} as an option to the linker.  If @var{option} contains
2857 commas, it is split into multiple options at the commas.
2858
2859 @item -u @var{symbol}
2860 Pretend the symbol @var{symbol} is undefined, to force linking of
2861 library modules to define it.  You can use @samp{-u} multiple times with
2862 different symbols to force loading of additional library modules.
2863 @end table
2864
2865 @node Directory Options
2866 @section Options for Directory Search
2867 @cindex directory options
2868 @cindex options, directory search
2869 @cindex search path
2870
2871 These options specify directories to search for header files, for
2872 libraries and for parts of the compiler:
2873
2874 @table @code
2875 @item -I@var{dir}
2876 Add the directory @var{dir} to the head of the list of directories to be
2877 searched for header files.  This can be used to override a system header
2878 file, substituting your own version, since these directories are
2879 searched before the system header file directories.  If you use more
2880 than one @samp{-I} option, the directories are scanned in left-to-right
2881 order; the standard system directories come after.
2882
2883 @item -I-
2884 Any directories you specify with @samp{-I} options before the @samp{-I-}
2885 option are searched only for the case of @samp{#include "@var{file}"};
2886 they are not searched for @samp{#include <@var{file}>}.
2887
2888 If additional directories are specified with @samp{-I} options after
2889 the @samp{-I-}, these directories are searched for all @samp{#include}
2890 directives.  (Ordinarily @emph{all} @samp{-I} directories are used
2891 this way.)
2892
2893 In addition, the @samp{-I-} option inhibits the use of the current
2894 directory (where the current input file came from) as the first search
2895 directory for @samp{#include "@var{file}"}.  There is no way to
2896 override this effect of @samp{-I-}.  With @samp{-I.} you can specify
2897 searching the directory which was current when the compiler was
2898 invoked.  That is not exactly the same as what the preprocessor does
2899 by default, but it is often satisfactory.
2900
2901 @samp{-I-} does not inhibit the use of the standard system directories
2902 for header files.  Thus, @samp{-I-} and @samp{-nostdinc} are
2903 independent.
2904
2905 @item -L@var{dir}
2906 Add directory @var{dir} to the list of directories to be searched
2907 for @samp{-l}.
2908
2909 @item -B@var{prefix}
2910 This option specifies where to find the executables, libraries,
2911 include files, and data files of the compiler itself.
2912
2913 The compiler driver program runs one or more of the subprograms
2914 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
2915 @var{prefix} as a prefix for each program it tries to run, both with and
2916 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
2917
2918 For each subprogram to be run, the compiler driver first tries the
2919 @samp{-B} prefix, if any.  If that name is not found, or if @samp{-B}
2920 was not specified, the driver tries two standard prefixes, which are
2921 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc-lib/}.  If neither of
2922 those results in a file name that is found, the unmodified program
2923 name is searched for using the directories specified in your
2924 @samp{PATH} environment variable.
2925
2926 @samp{-B} prefixes that effectively specify directory names also apply
2927 to libraries in the linker, because the compiler translates these
2928 options into @samp{-L} options for the linker.  They also apply to
2929 includes files in the preprocessor, because the compiler translates these
2930 options into @samp{-isystem} options for the preprocessor.  In this case,
2931 the compiler appends @samp{include} to the prefix.
2932
2933 The run-time support file @file{libgcc.a} can also be searched for using
2934 the @samp{-B} prefix, if needed.  If it is not found there, the two
2935 standard prefixes above are tried, and that is all.  The file is left
2936 out of the link if it is not found by those means.
2937
2938 Another way to specify a prefix much like the @samp{-B} prefix is to use
2939 the environment variable @code{GCC_EXEC_PREFIX}.  @xref{Environment
2940 Variables}.
2941
2942 @item -specs=@var{file}
2943 Process @var{file} after the compiler reads in the standard @file{specs}
2944 file, in order to override the defaults that the @file{gcc} driver
2945 program uses when determining what switches to pass to @file{cc1},
2946 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
2947 @samp{-specs=}@var{file} can be specified on the command line, and they
2948 are processed in order, from left to right.
2949 @end table
2950
2951 @node Target Options
2952 @section Specifying Target Machine and Compiler Version
2953 @cindex target options
2954 @cindex cross compiling
2955 @cindex specifying machine version
2956 @cindex specifying compiler version and target machine
2957 @cindex compiler version, specifying
2958 @cindex target machine, specifying
2959
2960 By default, GNU CC compiles code for the same type of machine that you
2961 are using.  However, it can also be installed as a cross-compiler, to
2962 compile for some other type of machine.  In fact, several different
2963 configurations of GNU CC, for different target machines, can be
2964 installed side by side.  Then you specify which one to use with the
2965 @samp{-b} option.
2966
2967 In addition, older and newer versions of GNU CC can be installed side
2968 by side.  One of them (probably the newest) will be the default, but
2969 you may sometimes wish to use another.
2970
2971 @table @code
2972 @item -b @var{machine}
2973 The argument @var{machine} specifies the target machine for compilation.
2974 This is useful when you have installed GNU CC as a cross-compiler.
2975
2976 The value to use for @var{machine} is the same as was specified as the
2977 machine type when configuring GNU CC as a cross-compiler.  For
2978 example, if a cross-compiler was configured with @samp{configure
2979 i386v}, meaning to compile for an 80386 running System V, then you
2980 would specify @samp{-b i386v} to run that cross compiler.
2981
2982 When you do not specify @samp{-b}, it normally means to compile for
2983 the same type of machine that you are using.
2984
2985 @item -V @var{version}
2986 The argument @var{version} specifies which version of GNU CC to run.
2987 This is useful when multiple versions are installed.  For example,
2988 @var{version} might be @samp{2.0}, meaning to run GNU CC version 2.0.
2989
2990 The default version, when you do not specify @samp{-V}, is the last
2991 version of GNU CC that you installed.
2992 @end table
2993
2994 The @samp{-b} and @samp{-V} options actually work by controlling part of
2995 the file name used for the executable files and libraries used for
2996 compilation.  A given version of GNU CC, for a given target machine, is
2997 normally kept in the directory @file{/usr/local/lib/gcc-lib/@var{machine}/@var{version}}.@refill
2998
2999 Thus, sites can customize the effect of @samp{-b} or @samp{-V} either by
3000 changing the names of these directories or adding alternate names (or
3001 symbolic links).  If in directory @file{/usr/local/lib/gcc-lib/} the
3002 file @file{80386} is a link to the file @file{i386v}, then @samp{-b
3003 80386} becomes an alias for @samp{-b i386v}.
3004
3005 In one respect, the @samp{-b} or @samp{-V} do not completely change
3006 to a different compiler: the top-level driver program @code{gcc}
3007 that you originally invoked continues to run and invoke the other
3008 executables (preprocessor, compiler per se, assembler and linker)
3009 that do the real work.  However, since no real work is done in the
3010 driver program, it usually does not matter that the driver program
3011 in use is not the one for the specified target and version.
3012
3013 The only way that the driver program depends on the target machine is
3014 in the parsing and handling of special machine-specific options.
3015 However, this is controlled by a file which is found, along with the
3016 other executables, in the directory for the specified version and
3017 target machine.  As a result, a single installed driver program adapts
3018 to any specified target machine and compiler version.
3019
3020 The driver program executable does control one significant thing,
3021 however: the default version and target machine.  Therefore, you can
3022 install different instances of the driver program, compiled for
3023 different targets or versions, under different names.
3024
3025 For example, if the driver for version 2.0 is installed as @code{ogcc}
3026 and that for version 2.1 is installed as @code{gcc}, then the command
3027 @code{gcc} will use version 2.1 by default, while @code{ogcc} will use
3028 2.0 by default.  However, you can choose either version with either
3029 command with the @samp{-V} option.
3030
3031 @node Submodel Options
3032 @section Hardware Models and Configurations
3033 @cindex submodel options
3034 @cindex specifying hardware config
3035 @cindex hardware models and configurations, specifying
3036 @cindex machine dependent options
3037
3038 Earlier we discussed the standard option @samp{-b} which chooses among
3039 different installed compilers for completely different target
3040 machines, such as Vax vs. 68000 vs. 80386.
3041
3042 In addition, each of these target machine types can have its own
3043 special options, starting with @samp{-m}, to choose among various
3044 hardware models or configurations---for example, 68010 vs 68020,
3045 floating coprocessor or none.  A single installed version of the
3046 compiler can compile for any model or configuration, according to the
3047 options specified.
3048
3049 Some configurations of the compiler also support additional special
3050 options, usually for compatibility with other compilers on the same
3051 platform.
3052
3053 @ifset INTERNALS
3054 These options are defined by the macro @code{TARGET_SWITCHES} in the
3055 machine description.  The default for the options is also defined by
3056 that macro, which enables you to change the defaults.
3057 @end ifset
3058
3059 @menu
3060 * M680x0 Options::
3061 * VAX Options::
3062 * SPARC Options::
3063 * Convex Options::
3064 * AMD29K Options::
3065 * ARM Options::
3066 * Thumb Options::
3067 * MN10200 Options::
3068 * MN10300 Options::
3069 * M32R/D Options::
3070 * M88K Options::
3071 * RS/6000 and PowerPC Options::
3072 * RT Options::
3073 * MIPS Options::
3074 * i386 Options::
3075 * HPPA Options::
3076 * Intel 960 Options::
3077 * DEC Alpha Options::
3078 * Clipper Options::
3079 * H8/300 Options::
3080 * SH Options::
3081 * System V Options::
3082 * V850 Options::
3083 * ARC Options::
3084 * NS32K Options::
3085 @end menu
3086
3087 @node M680x0 Options
3088 @subsection M680x0 Options
3089 @cindex M680x0 options
3090
3091 These are the @samp{-m} options defined for the 68000 series.  The default
3092 values for these options depends on which style of 68000 was selected when
3093 the compiler was configured; the defaults for the most common choices are
3094 given below.
3095
3096 @table @code
3097 @item -m68000
3098 @itemx -mc68000
3099 Generate output for a 68000.  This is the default
3100 when the compiler is configured for 68000-based systems.
3101
3102 Use this option for microcontrollers with a 68000 or EC000 core,
3103 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
3104
3105 @item -m68020
3106 @itemx -mc68020
3107 Generate output for a 68020.  This is the default
3108 when the compiler is configured for 68020-based systems.
3109
3110 @item -m68881
3111 Generate output containing 68881 instructions for floating point.
3112 This is the default for most 68020 systems unless @samp{-nfp} was
3113 specified when the compiler was configured.
3114
3115 @item -m68030
3116 Generate output for a 68030.  This is the default when the compiler is
3117 configured for 68030-based systems.
3118
3119 @item -m68040
3120 Generate output for a 68040.  This is the default when the compiler is
3121 configured for 68040-based systems.
3122
3123 This option inhibits the use of 68881/68882 instructions that have to be
3124 emulated by software on the 68040.  Use this option if your 68040 does not
3125 have code to emulate those instructions.
3126
3127 @item -m68060
3128 Generate output for a 68060.  This is the default when the compiler is
3129 configured for 68060-based systems.
3130
3131 This option inhibits the use of 68020 and 68881/68882 instructions that
3132 have to be emulated by software on the 68060.  Use this option if your 68060
3133 does not have code to emulate those instructions.
3134
3135 @item -mcpu32
3136 Generate output for a CPU32. This is the default
3137 when the compiler is configured for CPU32-based systems.
3138
3139 Use this option for microcontrollers with a
3140 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
3141 68336, 68340, 68341, 68349 and 68360.
3142
3143 @item -m5200
3144 Generate output for a 520X "coldfire" family cpu.  This is the default
3145 when the compiler is configured for 520X-based systems.
3146
3147 Use this option for microcontroller with a 5200 core, including 
3148 the MCF5202, MCF5203, MCF5204 and MCF5202.
3149
3150
3151 @item -m68020-40
3152 Generate output for a 68040, without using any of the new instructions.
3153 This results in code which can run relatively efficiently on either a
3154 68020/68881 or a 68030 or a 68040.  The generated code does use the
3155 68881 instructions that are emulated on the 68040.
3156
3157 @item -m68020-60
3158 Generate output for a 68060, without using any of the new instructions.
3159 This results in code which can run relatively efficiently on either a
3160 68020/68881 or a 68030 or a 68040.  The generated code does use the
3161 68881 instructions that are emulated on the 68060.
3162
3163 @item -mfpa
3164 Generate output containing Sun FPA instructions for floating point.
3165
3166 @item -msoft-float
3167 Generate output containing library calls for floating point.
3168 @strong{Warning:} the requisite libraries are not available for all m68k
3169 targets.  Normally the facilities of the machine's usual C compiler are
3170 used, but this can't be done directly in cross-compilation.  You must
3171 make your own arrangements to provide suitable library functions for
3172 cross-compilation.  The embedded targets @samp{m68k-*-aout} and
3173 @samp{m68k-*-coff} do provide software floating point support.
3174
3175 @item -mshort
3176 Consider type @code{int} to be 16 bits wide, like @code{short int}.
3177
3178 @item -mnobitfield
3179 Do not use the bit-field instructions.  The @samp{-m68000}, @samp{-mcpu32}
3180 and @samp{-m5200} options imply @w{@samp{-mnobitfield}}.
3181
3182 @item -mbitfield
3183 Do use the bit-field instructions.  The @samp{-m68020} option implies
3184 @samp{-mbitfield}.  This is the default if you use a configuration
3185 designed for a 68020.
3186
3187 @item -mrtd
3188 Use a different function-calling convention, in which functions
3189 that take a fixed number of arguments return with the @code{rtd}
3190 instruction, which pops their arguments while returning.  This
3191 saves one instruction in the caller since there is no need to pop
3192 the arguments there.
3193
3194 This calling convention is incompatible with the one normally
3195 used on Unix, so you cannot use it if you need to call libraries
3196 compiled with the Unix compiler.
3197
3198 Also, you must provide function prototypes for all functions that
3199 take variable numbers of arguments (including @code{printf});
3200 otherwise incorrect code will be generated for calls to those
3201 functions.
3202
3203 In addition, seriously incorrect code will result if you call a
3204 function with too many arguments.  (Normally, extra arguments are
3205 harmlessly ignored.)
3206
3207 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
3208 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
3209
3210 @item -malign-int
3211 @itemx -mno-align-int
3212 Control whether GNU CC aligns @code{int}, @code{long}, @code{long long}, 
3213 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
3214 boundary (@samp{-malign-int}) or a 16-bit boundary (@samp{-mno-align-int}).
3215 Aligning variables on 32-bit boundaries produces code that runs somewhat
3216 faster on processors with 32-bit busses at the expense of more memory.
3217
3218 @strong{Warning:} if you use the @samp{-malign-int} switch, GNU CC will
3219 align structures containing the above types  differently than
3220 most published application binary interface specifications for the m68k.
3221
3222 @end table
3223
3224 @node VAX Options
3225 @subsection VAX Options
3226 @cindex VAX options
3227
3228 These @samp{-m} options are defined for the Vax:
3229
3230 @table @code
3231 @item -munix
3232 Do not output certain jump instructions (@code{aobleq} and so on)
3233 that the Unix assembler for the Vax cannot handle across long
3234 ranges.
3235
3236 @item -mgnu
3237 Do output those jump instructions, on the assumption that you
3238 will assemble with the GNU assembler.
3239
3240 @item -mg
3241 Output code for g-format floating point numbers instead of d-format.
3242 @end table
3243
3244 @node SPARC Options
3245 @subsection SPARC Options
3246 @cindex SPARC options
3247
3248 These @samp{-m} switches are supported on the SPARC:
3249
3250 @table @code
3251 @item -mno-app-regs
3252 @itemx -mapp-regs
3253 Specify @samp{-mapp-regs} to generate output using the global registers
3254 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
3255 is the default.
3256
3257 To be fully SVR4 ABI compliant at the cost of some performance loss,
3258 specify @samp{-mno-app-regs}.  You should compile libraries and system
3259 software with this option.
3260
3261 @item -mfpu
3262 @itemx -mhard-float
3263 Generate output containing floating point instructions.  This is the
3264 default.
3265
3266 @item -mno-fpu
3267 @itemx -msoft-float
3268 Generate output containing library calls for floating point.
3269 @strong{Warning:} the requisite libraries are not available for all SPARC
3270 targets.  Normally the facilities of the machine's usual C compiler are
3271 used, but this cannot be done directly in cross-compilation.  You must make
3272 your own arrangements to provide suitable library functions for
3273 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
3274 @samp{sparclite-*-*} do provide software floating point support.
3275
3276 @samp{-msoft-float} changes the calling convention in the output file;
3277 therefore, it is only useful if you compile @emph{all} of a program with
3278 this option.  In particular, you need to compile @file{libgcc.a}, the
3279 library that comes with GNU CC, with @samp{-msoft-float} in order for
3280 this to work.
3281
3282 @item -mhard-quad-float
3283 Generate output containing quad-word (long double) floating point
3284 instructions.
3285
3286 @item -msoft-quad-float
3287 Generate output containing library calls for quad-word (long double)
3288 floating point instructions.  The functions called are those specified
3289 in the SPARC ABI.  This is the default.
3290
3291 As of this writing, there are no sparc implementations that have hardware
3292 support for the quad-word floating point instructions.  They all invoke
3293 a trap handler for one of these instructions, and then the trap handler
3294 emulates the effect of the instruction.  Because of the trap handler overhead,
3295 this is much slower than calling the ABI library routines.  Thus the
3296 @samp{-msoft-quad-float} option is the default.
3297
3298 @item -mno-epilogue
3299 @itemx -mepilogue
3300 With @samp{-mepilogue} (the default), the compiler always emits code for
3301 function exit at the end of each function.  Any function exit in
3302 the middle of the function (such as a return statement in C) will
3303 generate a jump to the exit code at the end of the function.
3304
3305 With @samp{-mno-epilogue}, the compiler tries to emit exit code inline
3306 at every function exit.
3307
3308 @item -mno-flat
3309 @itemx -mflat
3310 With @samp{-mflat}, the compiler does not generate save/restore instructions
3311 and will use a "flat" or single register window calling convention.
3312 This model uses %i7 as the frame pointer and is compatible with the normal
3313 register window model.  Code from either may be intermixed.
3314 The local registers and the input registers (0-5) are still treated as
3315 "call saved" registers and will be saved on the stack as necessary.
3316
3317 With @samp{-mno-flat} (the default), the compiler emits save/restore
3318 instructions (except for leaf functions) and is the normal mode of operation.
3319
3320 @item -mno-unaligned-doubles
3321 @itemx -munaligned-doubles
3322 Assume that doubles have 8 byte alignment.  This is the default.
3323
3324 With @samp{-munaligned-doubles}, GNU CC assumes that doubles have 8 byte
3325 alignment only if they are contained in another type, or if they have an
3326 absolute address.  Otherwise, it assumes they have 4 byte alignment.
3327 Specifying this option avoids some rare compatibility problems with code
3328 generated by other compilers.  It is not the default because it results
3329 in a performance loss, especially for floating point code.
3330
3331 @item -mv8
3332 @itemx -msparclite
3333 These two options select variations on the SPARC architecture.
3334
3335 By default (unless specifically configured for the Fujitsu SPARClite),
3336 GCC generates code for the v7 variant of the SPARC architecture.
3337
3338 @samp{-mv8} will give you SPARC v8 code.  The only difference from v7
3339 code is that the compiler emits the integer multiply and integer
3340 divide instructions which exist in SPARC v8 but not in SPARC v7.
3341
3342 @samp{-msparclite} will give you SPARClite code.  This adds the integer
3343 multiply, integer divide step and scan (@code{ffs}) instructions which
3344 exist in SPARClite but not in SPARC v7.
3345
3346 These options are deprecated and will be deleted in GNU CC 2.9.
3347 They have been replaced with @samp{-mcpu=xxx}.
3348
3349 @item -mcypress
3350 @itemx -msupersparc
3351 These two options select the processor for which the code is optimised.
3352
3353 With @samp{-mcypress} (the default), the compiler optimizes code for the
3354 Cypress CY7C602 chip, as used in the SparcStation/SparcServer 3xx series.
3355 This is also appropriate for the older SparcStation 1, 2, IPX etc.
3356
3357 With @samp{-msupersparc} the compiler optimizes code for the SuperSparc cpu, as
3358 used in the SparcStation 10, 1000 and 2000 series. This flag also enables use
3359 of the full SPARC v8 instruction set.
3360
3361 These options are deprecated and will be deleted in GNU CC 2.9.
3362 They have been replaced with @samp{-mcpu=xxx}.
3363
3364 @item -mcpu=@var{cpu_type}
3365 Set the instruction set, register set, and instruction scheduling parameters
3366 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
3367 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
3368 @samp{hypersparc}, @samp{sparclite86x}, @samp{f930}, @samp{f934},
3369 @samp{sparclet}, @samp{tsc701}, @samp{v9}, and @samp{ultrasparc}.
3370
3371 Default instruction scheduling parameters are used for values that select
3372 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
3373 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
3374
3375 Here is a list of each supported architecture and their supported
3376 implementations.
3377
3378 @smallexample
3379     v7:             cypress
3380     v8:             supersparc, hypersparc
3381     sparclite:      f930, f934, sparclite86x
3382     sparclet:       tsc701
3383     v9:             ultrasparc
3384 @end smallexample
3385
3386 @item -mtune=@var{cpu_type}
3387 Set the instruction scheduling parameters for machine type
3388 @var{cpu_type}, but do not set the instruction set or register set that the
3389 option @samp{-mcpu=}@var{cpu_type} would.
3390
3391 The same values for @samp{-mcpu=}@var{cpu_type} are used for
3392 @samp{-mtune=}@*@var{cpu_type}, though the only useful values are those that
3393 select a particular cpu implementation: @samp{cypress}, @samp{supersparc},
3394 @samp{hypersparc}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
3395 @samp{tsc701}, @samp{ultrasparc}.
3396
3397 @item -malign-loops=@var{num}
3398 Align loops to a 2 raised to a @var{num} byte boundary.  If
3399 @samp{-malign-loops} is not specified, the default is 2.
3400
3401 @item -malign-jumps=@var{num}
3402 Align instructions that are only jumped to to a 2 raised to a @var{num}
3403 byte boundary.  If @samp{-malign-jumps} is not specified, the default is 2.
3404
3405 @item -malign-functions=@var{num}
3406 Align the start of functions to a 2 raised to @var{num} byte boundary.
3407 If @samp{-malign-functions} is not specified, the default is 2 if compiling
3408 for 32 bit sparc, and 5 if compiling for 64 bit sparc.
3409
3410 @end table
3411
3412 These @samp{-m} switches are supported in addition to the above
3413 on the SPARCLET processor.
3414
3415 @table @code
3416 @item -mlittle-endian
3417 Generate code for a processor running in little-endian mode.
3418
3419 @item -mlive-g0
3420 Treat register @code{%g0} as a normal register.
3421 GCC will continue to clobber it as necessary but will not assume
3422 it always reads as 0.
3423
3424 @item -mbroken-saverestore
3425 Generate code that does not use non-trivial forms of the @code{save} and
3426 @code{restore} instructions.  Early versions of the SPARCLET processor do
3427 not correctly handle @code{save} and @code{restore} instructions used with
3428 arguments.  They correctly handle them used without arguments.  A @code{save}
3429 instruction used without arguments increments the current window pointer
3430 but does not allocate a new stack frame.  It is assumed that the window
3431 overflow trap handler will properly handle this case as will interrupt
3432 handlers.
3433 @end table
3434
3435 These @samp{-m} switches are supported in addition to the above
3436 on SPARC V9 processors in 64 bit environments.
3437
3438 @table @code
3439 @item -mlittle-endian
3440 Generate code for a processor running in little-endian mode.
3441
3442 @item -m32
3443 @itemx -m64
3444 Generate code for a 32 bit or 64 bit environment.
3445 The 32 bit environment sets int, long and pointer to 32 bits.
3446 The 64 bit environment sets int to 32 bits and long and pointer
3447 to 64 bits.
3448
3449 @item -mcmodel=medlow
3450 Generate code for the Medium/Low code model: the program must be linked
3451 in the low 32 bits of the address space.  Pointers are 64 bits.
3452 Programs can be statically or dynamically linked.
3453
3454 @item -mcmodel=medmid
3455 Generate code for the Medium/Middle code model: the program must be linked
3456 in the low 44 bits of the address space, the text segment must be less than
3457 2G bytes, and data segment must be within 2G of the text segment.
3458 Pointers are 64 bits.
3459
3460 @item -mcmodel=medany
3461 Generate code for the Medium/Anywhere code model: the program may be linked
3462 anywhere in the address space, the text segment must be less than
3463 2G bytes, and data segment must be within 2G of the text segment.
3464 Pointers are 64 bits.
3465
3466 @item -mcmodel=embmedany
3467 Generate code for the Medium/Anywhere code model for embedded systems:
3468 assume a 32 bit text and a 32 bit data segment, both starting anywhere
3469 (determined at link time).  Register %g4 points to the base of the
3470 data segment.  Pointers still 64 bits.
3471 Programs are statically linked, PIC is not supported.
3472
3473 @item -mstack-bias
3474 @itemx -mno-stack-bias
3475 With @samp{-mstack-bias}, GNU CC assumes that the stack pointer, and
3476 frame pointer if present, are offset by -2047 which must be added back
3477 when making stack frame references.
3478 Otherwise, assume no such offset is present.
3479 @end table
3480
3481 @node Convex Options
3482 @subsection Convex Options
3483 @cindex Convex options
3484
3485 These @samp{-m} options are defined for Convex:
3486
3487 @table @code
3488 @item -mc1
3489 Generate output for C1.  The code will run on any Convex machine.
3490 The preprocessor symbol @code{__convex__c1__} is defined.
3491
3492 @item -mc2
3493 Generate output for C2.  Uses instructions not available on C1.
3494 Scheduling and other optimizations are chosen for max performance on C2.
3495 The preprocessor symbol @code{__convex_c2__} is defined.
3496
3497 @item -mc32
3498 Generate output for C32xx.  Uses instructions not available on C1.
3499 Scheduling and other optimizations are chosen for max performance on C32.
3500 The preprocessor symbol @code{__convex_c32__} is defined.
3501
3502 @item -mc34
3503 Generate output for C34xx.  Uses instructions not available on C1.
3504 Scheduling and other optimizations are chosen for max performance on C34.
3505 The preprocessor symbol @code{__convex_c34__} is defined.
3506
3507 @item -mc38
3508 Generate output for C38xx.  Uses instructions not available on C1.
3509 Scheduling and other optimizations are chosen for max performance on C38.
3510 The preprocessor symbol @code{__convex_c38__} is defined.
3511
3512 @item -margcount
3513 Generate code which puts an argument count in the word preceding each
3514 argument list.  This is compatible with regular CC, and a few programs
3515 may need the argument count word.  GDB and other source-level debuggers
3516 do not need it; this info is in the symbol table.
3517
3518 @item -mnoargcount
3519 Omit the argument count word.  This is the default.
3520
3521 @item -mvolatile-cache
3522 Allow volatile references to be cached.  This is the default.
3523
3524 @item -mvolatile-nocache
3525 Volatile references bypass the data cache, going all the way to memory.
3526 This is only needed for multi-processor code that does not use standard
3527 synchronization instructions.  Making non-volatile references to volatile
3528 locations will not necessarily work.
3529
3530 @item -mlong32
3531 Type long is 32 bits, the same as type int.  This is the default.
3532
3533 @item -mlong64
3534 Type long is 64 bits, the same as type long long.  This option is useless,
3535 because no library support exists for it.
3536 @end table
3537
3538 @node AMD29K Options
3539 @subsection AMD29K Options
3540 @cindex AMD29K options
3541
3542 These @samp{-m} options are defined for the AMD Am29000:
3543
3544 @table @code
3545 @item -mdw
3546 @kindex -mdw
3547 @cindex DW bit (29k)
3548 Generate code that assumes the @code{DW} bit is set, i.e., that byte and
3549 halfword operations are directly supported by the hardware.  This is the
3550 default.
3551
3552 @item -mndw
3553 @kindex -mndw
3554 Generate code that assumes the @code{DW} bit is not set.
3555
3556 @item -mbw
3557 @kindex -mbw
3558 @cindex byte writes (29k)
3559 Generate code that assumes the system supports byte and halfword write
3560 operations.  This is the default.
3561
3562 @item -mnbw
3563 @kindex -mnbw
3564 Generate code that assumes the systems does not support byte and
3565 halfword write operations.  @samp{-mnbw} implies @samp{-mndw}.
3566
3567 @item -msmall
3568 @kindex -msmall
3569 @cindex memory model (29k)
3570 Use a small memory model that assumes that all function addresses are
3571 either within a single 256 KB segment or at an absolute address of less
3572 than 256k.  This allows the @code{call} instruction to be used instead
3573 of a @code{const}, @code{consth}, @code{calli} sequence.
3574
3575 @item -mnormal
3576 @kindex -mnormal
3577 Use the normal memory model: Generate @code{call} instructions only when
3578 calling functions in the same file and @code{calli} instructions
3579 otherwise.  This works if each file occupies less than 256 KB but allows
3580 the entire executable to be larger than 256 KB.  This is the default.
3581
3582 @item -mlarge
3583 Always use @code{calli} instructions.  Specify this option if you expect
3584 a single file to compile into more than 256 KB of code.
3585
3586 @item -m29050
3587 @kindex -m29050
3588 @cindex processor selection (29k)
3589 Generate code for the Am29050.
3590
3591 @item -m29000
3592 @kindex -m29000
3593 Generate code for the Am29000.  This is the default.
3594
3595 @item -mkernel-registers
3596 @kindex -mkernel-registers
3597 @cindex kernel and user registers (29k)
3598 Generate references to registers @code{gr64-gr95} instead of to
3599 registers @code{gr96-gr127}.  This option can be used when compiling
3600 kernel code that wants a set of global registers disjoint from that used
3601 by user-mode code.
3602
3603 Note that when this option is used, register names in @samp{-f} flags
3604 must use the normal, user-mode, names.
3605
3606 @item -muser-registers
3607 @kindex -muser-registers
3608 Use the normal set of global registers, @code{gr96-gr127}.  This is the
3609 default.
3610
3611 @item -mstack-check
3612 @itemx -mno-stack-check
3613 @kindex -mstack-check
3614 @cindex stack checks (29k)
3615 Insert (or do not insert) a call to @code{__msp_check} after each stack
3616 adjustment.  This is often used for kernel code.
3617
3618 @item -mstorem-bug
3619 @itemx -mno-storem-bug
3620 @kindex -mstorem-bug
3621 @cindex storem bug (29k)
3622 @samp{-mstorem-bug} handles 29k processors which cannot handle the
3623 separation of a mtsrim insn and a storem instruction (most 29000 chips
3624 to date, but not the 29050).
3625
3626 @item -mno-reuse-arg-regs
3627 @itemx -mreuse-arg-regs
3628 @kindex -mreuse-arg-regs
3629 @samp{-mno-reuse-arg-regs} tells the compiler to only use incoming argument
3630 registers for copying out arguments.  This helps detect calling a function
3631 with fewer arguments than it was declared with.
3632
3633 @item -mno-impure-text
3634 @itemx -mimpure-text
3635 @kindex -mimpure-text
3636 @samp{-mimpure-text}, used in addition to @samp{-shared}, tells the compiler to
3637 not pass @samp{-assert pure-text} to the linker when linking a shared object.
3638
3639 @item -msoft-float
3640 @kindex -msoft-float
3641 Generate output containing library calls for floating point.
3642 @strong{Warning:} the requisite libraries are not part of GNU CC.
3643 Normally the facilities of the machine's usual C compiler are used, but
3644 this can't be done directly in cross-compilation.  You must make your
3645 own arrangements to provide suitable library functions for
3646 cross-compilation.
3647 @end table
3648
3649 @node ARM Options
3650 @subsection ARM Options
3651 @cindex ARM options
3652
3653 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
3654 architectures:
3655
3656 @table @code
3657 @item -mapcs-frame
3658 @kindex -mapcs-frame
3659 Generate a stack frame that is compliant with the ARM Procedure Call
3660 Standard for all functions, even if this is not strictly necessary for
3661 correct execution of the code.  Specifying @samp{-fomit-frame-pointer}
3662 with this option will cause the stack frames not to be generated for
3663 leaf functions.  The default is @samp{-mno-apcs-frame}.
3664
3665 @item -mapcs
3666 @kindex -mapcs
3667 This is a synonym for @samp{-mapcs-frame}.
3668
3669 @item -mapcs-26
3670 @kindex -mapcs-26
3671 Generate code for a processor running with a 26-bit program counter,
3672 and conforming to the function calling standards for the APCS 26-bit
3673 option.  This option replaces the @samp{-m2} and @samp{-m3} options
3674 of previous releases of the compiler.
3675
3676 @item -mapcs-32
3677 @kindex -mapcs-32
3678 Generate code for a processor running with a 32-bit program counter,
3679 and conforming to the function calling standards for the APCS 32-bit
3680 option.  This option replaces the @samp{-m6} option of previous releases
3681 of the compiler.
3682
3683 @item -mapcs-stack-check
3684 @kindex -mapcs-stack-check
3685 @kindex -mno-apcs-stack-check
3686 Generate code to check the amount of stack space available upon entry to
3687 every function (that actually uses some stack space).  If there is
3688 insufficient space available then either the function
3689 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
3690 called, depending upon the amount of stack space required.  The run time
3691 system is required to provide these functions.  The default is
3692 @samp{-mno-apcs-stack-check}, since this produces smaller code.
3693
3694 @item -mapcs-float
3695 @kindex -mapcs-float
3696 @kindex -mno-apcs-float
3697 Pass floating point arguments using the float point registers.  This is
3698 one of the variants of the APCS.  This option is reccommended if the
3699 target hardware has a floating point unit or if a lot of floating point
3700 arithmetic is going to be performed by the code.  The default is
3701 @samp{-mno-apcs-float}, since integer only code is slightly increased in
3702 size if @samp{-mapcs-float} is used.
3703
3704 @item -mapcs-reentrant
3705 @kindex -mapcs-reentrant
3706 @kindex -mno-apcs-reentrant
3707 Generate reentrant, position independent code.  This is the equivalent
3708 to specifying the @samp{-fpic} option.  The default is
3709 @samp{-mno-apcs-reentrant}.
3710
3711 @item -mthumb-interwork
3712 @kindex -mthumb-interwork
3713 @kindex -mno-thumb-interwork
3714 Generate code which supports calling between the ARM and THUMB
3715 instruction sets.  Without this option the two instruction sets cannot
3716 be reliably used inside one program.  The default is
3717 @samp{-mno-thumb-interwork}, since slightly larger code is generated
3718 when @samp{-mthumb-interwork} is specified.
3719
3720 @item -mno-sched-prolog
3721 @kindex -mno-sched-prolog
3722 @kindex -msched-prolog
3723 Prevent the reordering of instructions in the function prolog, or the
3724 merging of those instruction with the instructions in the function's
3725 body.  This means that all functions will start with a recognisable set
3726 of instructions (or in fact one of a chioce from a small set of
3727 different function prologues), and this information can be used to
3728 locate the start if functions inside an executable piece of code.  The
3729 default is @samp{-msched-prolog}.
3730
3731 @item -mhard-float
3732 Generate output containing floating point instructions.  This is the
3733 default.
3734
3735 @item -msoft-float
3736 Generate output containing library calls for floating point.
3737 @strong{Warning:} the requisite libraries are not available for all ARM
3738 targets.  Normally the facilities of the machine's usual C compiler are
3739 used, but this cannot be done directly in cross-compilation.  You must make
3740 your own arrangements to provide suitable library functions for
3741 cross-compilation.
3742
3743 @samp{-msoft-float} changes the calling convention in the output file;
3744 therefore, it is only useful if you compile @emph{all} of a program with
3745 this option.  In particular, you need to compile @file{libgcc.a}, the
3746 library that comes with GNU CC, with @samp{-msoft-float} in order for
3747 this to work.
3748
3749 @item -mlittle-endian
3750 Generate code for a processor running in little-endian mode.  This is
3751 the default for all standard configurations.
3752
3753 @item -mbig-endian
3754 Generate code for a processor running in big-endian mode; the default is
3755 to compile code for a little-endian processor.
3756
3757 @item -mwords-little-endian
3758 This option only applies when generating code for big-endian processors.
3759 Generate code for a little-endian word order but a big-endian byte
3760 order.  That is, a byte order of the form @samp{32107654}.  Note: this
3761 option should only be used if you require compatibility with code for
3762 big-endian ARM processors generated by versions of the compiler prior to
3763 2.8.
3764
3765 @item -mshort-load-bytes
3766 @kindex -mshort-load-bytes
3767 Do not try to load half-words (eg @samp{short}s) by loading a word from
3768 an unaligned address.  For some targets the MMU is configured to trap
3769 unaligned loads; use this option to generate code that is safe in these
3770 environments.
3771
3772 @item -mno-short-load-bytes
3773 @kindex -mno-short-load-bytes
3774 Use unaligned word loads to load half-words (eg @samp{short}s).  This
3775 option produces more efficient code, but the MMU is sometimes configured
3776 to trap these instructions.
3777
3778 @item -mshort-load-words
3779 @kindex -mshort-load-words
3780 This is a synonym for the @samp{-mno-short-load-bytes}.
3781
3782 @item -mno-short-load-words
3783 @kindex -mno-short-load-words
3784 This is a synonym for the @samp{-mshort-load-bytes}.
3785
3786 @item -mbsd
3787 @kindex -mbsd
3788 This option only applies to RISC iX.  Emulate the native BSD-mode
3789 compiler.  This is the default if @samp{-ansi} is not specified.
3790
3791 @item -mxopen
3792 @kindex -mxopen
3793 This option only applies to RISC iX.  Emulate the native X/Open-mode
3794 compiler.
3795
3796 @item -mno-symrename
3797 @kindex -mno-symrename
3798 This option only applies to RISC iX.  Do not run the assembler
3799 post-processor, @samp{symrename}, after code has been assembled.
3800 Normally it is necessary to modify some of the standard symbols in
3801 preparation for linking with the RISC iX C library; this option
3802 suppresses this pass.  The post-processor is never run when the
3803 compiler is built for cross-compilation.
3804
3805 @item -mcpu=<name>
3806 @item -mtune=<name>
3807 @kindex -mcpu=
3808 @kindex -mtune=
3809 This specifies the name of the target ARM processor.  GCC uses this name
3810 to determine what kind of instructions it can use when generating
3811 assembly code.  Permissable names are: arm2, arm250, arm3, arm6, arm60,
3812 arm600, arm610, arm620, arm7, arm7m, arm7d, arm7dm, arm7di, arm7dmi,
3813 arm70, arm700, arm700i, arm710, arm710c, arm7100, arm7500, arm7500fe,
3814 arm7tdmi, arm8, strongarm, strongarm110, strongarm1100, arm8, arm810,
3815 arm9, arm9tdmi.  @samp{-mtune=} is a synonym for @samp{-mcpue=} to
3816 support older versions of GCC.
3817
3818 @item -march=<name>
3819 @kindex -march=
3820 This specifies the name of the target ARM architecture.  GCC uses this
3821 name to determine what kind of instructions it can use when generating
3822 assembly code.  This option can be used in conjunction with or instead
3823 of the @samp{-mcpu=} option.  Permissable names are: armv2, armv2a,
3824 armv3, armv3m, armv4, armv4t
3825
3826 @item -mfpe=<number>
3827 @item -mfp=<number>
3828 @kindex -mfpe=
3829 @kindex -mfp=
3830 This specifes the version of the floating point emulation available on
3831 the target.  Permissable values are 2 and 3.  @samp{-mfp=} is a synonym
3832 for @samp{-mfpe=} to support older versions of GCC.
3833
3834 @item -mstructure-size-boundary=<n>
3835 @kindex -mstructure-size-boundary
3836 The size of all structures and unions will be rounded up to a multiple
3837 of the number of bits set by this option.  Permissable values are 8 and
3838 32.  The default value varies for different toolchains.  For the COFF
3839 targeted toolchain the default value is 8.  Specifying the larger number
3840 can produced faster, more efficient code, but can also increase the size
3841 of the program.  The two values are potentially incompatible.  Code
3842 compiled with one value cannot necessarily expect to work with code or
3843 libraries compiled with the other value, if they exchange information
3844 using structures or unions.  Programmers are encouraged to use the 32
3845 value as future versions of the toolchain may default to this value.
3846
3847 @item -mabort-on-noreturn
3848 @kindex -mabort-on-noreturn
3849 @kindex -mnoabort-on-noreturn
3850 Generate a call to the function abort at the end of a noreturn function.
3851 It will be executed if the function tries to return.
3852
3853 @end table
3854
3855 @node Thumb Options
3856 @subsection Thumb Options
3857 @cindex Thumb Options
3858
3859 @table @code
3860
3861 @item -mthumb-interwork
3862 @kindex -mthumb-interwork
3863 @kindex -mno-thumb-interwork
3864 Generate code which supports calling between the THUMB and ARM
3865 instruction sets.  Without this option the two instruction sets cannot
3866 be reliably used inside one program.  The default is
3867 @samp{-mno-thumb-interwork}, since slightly smaller code is generated
3868 with this option.
3869
3870 @item -mtpcs-frame
3871 @kindex -mtpcs-frame
3872 @kindex -mno-tpcs-frame
3873 Generate a stack frame that is compliant with the Thumb Procedure Call
3874 Standard for all non-leaf functions.  (A leaf function is one that does
3875 not call any other functions).  The default is @samp{-mno-apcs-frame}. 
3876
3877 @item -mtpcs-leaf-frame
3878 @kindex -mtpcs-leaf-frame
3879 @kindex -mno-tpcs-leaf-frame
3880 Generate a stack frame that is compliant with the Thumb Procedure Call
3881 Standard for all leaf functions.  (A leaf function is one that does
3882 not call any other functions).  The default is @samp{-mno-apcs-leaf-frame}. 
3883
3884 @item -mlittle-endian
3885 @kindex -mlittle-endian
3886 Generate code for a processor running in little-endian mode.  This is
3887 the default for all standard configurations.
3888
3889 @item -mbig-endian
3890 @kindex -mbig-endian
3891 Generate code for a processor running in big-endian mode.
3892
3893 @item -mstructure-size-boundary=<n>
3894 @kindex -mstructure-size-boundary
3895 The size of all structures and unions will be rounded up to a multiple
3896 of the number of bits set by this option.  Permissable values are 8 and
3897 32.  The default value varies for different toolchains.  For the COFF
3898 targeted toolchain the default value is 8.  Specifying the larger number
3899 can produced faster, more efficient code, but can also increase the size
3900 of the program.  The two values are potentially incompatible.  Code
3901 compiled with one value cannot necessarily expect to work with code or
3902 libraries compiled with the other value, if they exchange information
3903 using structures or unions.  Programmers are encouraged to use the 32
3904 value as future versions of the toolchain may default to this value.
3905
3906 @end table
3907
3908 @node MN10200 Options
3909 @subsection MN10200 Options
3910 @cindex MN10200 options
3911 These @samp{-m} options are defined for Matsushita MN10200 architectures:
3912 @table @code
3913
3914 @item -mrelax
3915 Indicate to the linker that it should perform a relaxation optimization pass
3916 to shorten branches, calls and absolute memory addresses.  This option only
3917 has an effect when used on the command line for the final link step.
3918
3919 This option makes symbolic debugging impossible. 
3920 @end table
3921
3922 @node MN10300 Options
3923 @subsection MN10300 Options
3924 @cindex MN10300 options
3925 These @samp{-m} options are defined for Matsushita MN10300 architectures:
3926
3927 @table @code
3928 @item -mmult-bug
3929 Generate code to avoid bugs in the multiply instructions for the MN10300
3930 processors.  This is the default.
3931
3932 @item -mno-mult-bug
3933 Do not generate code to avoid bugs in the multiply instructions for the
3934 MN10300 processors.
3935
3936 @item -mrelax
3937 Indicate to the linker that it should perform a relaxation optimization pass
3938 to shorten branches, calls and absolute memory addresses.  This option only
3939 has an effect when used on the command line for the final link step.
3940
3941 This option makes symbolic debugging impossible. 
3942 @end table
3943
3944
3945 @node M32R/D Options
3946 @subsection M32R/D Options
3947 @cindex M32R/D options
3948
3949 These @samp{-m} options are defined for Mitsubishi M32R/D architectures:
3950
3951 @table @code
3952 @item -mcode-model=small
3953 Assume all objects live in the lower 16MB of memory (so that their addresses
3954 can be loaded with the @code{ld24} instruction), and assume all subroutines
3955 are reachable with the @code{bl} instruction.
3956 This is the default.
3957
3958 The addressability of a particular object can be set with the
3959 @code{model} attribute.
3960
3961 @item -mcode-model=medium
3962 Assume objects may be anywhere in the 32 bit address space (the compiler
3963 will generate @code{seth/add3} instructions to load their addresses), and
3964 assume all subroutines are reachable with the @code{bl} instruction.
3965
3966 @item -mcode-model=large
3967 Assume objects may be anywhere in the 32 bit address space (the compiler
3968 will generate @code{seth/add3} instructions to load their addresses), and
3969 assume subroutines may not be reachable with the @code{bl} instruction
3970 (the compiler will generate the much slower @code{seth/add3/jl}
3971 instruction sequence).
3972
3973 @item -msdata=none
3974 Disable use of the small data area.  Variables will be put into
3975 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
3976 @code{section} attribute has been specified).
3977 This is the default.
3978
3979 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
3980 Objects may be explicitly put in the small data area with the
3981 @code{section} attribute using one of these sections.
3982
3983 @item -msdata=sdata
3984 Put small global and static data in the small data area, but do not
3985 generate special code to reference them.
3986
3987 @item -msdata=use
3988 Put small global and static data in the small data area, and generate
3989 special instructions to reference them.
3990
3991 @item -G @var{num}
3992 @cindex smaller data references
3993 Put global and static objects less than or equal to @var{num} bytes
3994 into the small data or bss sections instead of the normal data or bss
3995 sections.  The default value of @var{num} is 8.
3996 The @samp{-msdata} option must be set to one of @samp{sdata} or @samp{use}
3997 for this option to have any effect.
3998
3999 All modules should be compiled with the same @samp{-G @var{num}} value.
4000 Compiling with different values of @var{num} may or may not work; if it
4001 doesn't the linker will give an error message - incorrect code will not be
4002 generated.
4003
4004 @end table
4005
4006 @node M88K Options
4007 @subsection M88K Options
4008 @cindex M88k options
4009
4010 These @samp{-m} options are defined for Motorola 88k architectures:
4011
4012 @table @code
4013 @item -m88000
4014 @kindex -m88000
4015 Generate code that works well on both the m88100 and the
4016 m88110.
4017
4018 @item -m88100
4019 @kindex -m88100
4020 Generate code that works best for the m88100, but that also
4021 runs on the m88110.
4022
4023 @item -m88110
4024 @kindex -m88110
4025 Generate code that works best for the m88110, and may not run
4026 on the m88100.
4027
4028 @item -mbig-pic
4029 @kindex -mbig-pic
4030 Obsolete option to be removed from the next revision.
4031 Use @samp{-fPIC}.
4032
4033 @item -midentify-revision
4034 @kindex -midentify-revision
4035 @kindex ident
4036 @cindex identifying source, compiler (88k)
4037 Include an @code{ident} directive in the assembler output recording the
4038 source file name, compiler name and version, timestamp, and compilation
4039 flags used.
4040
4041 @item -mno-underscores
4042 @kindex -mno-underscores
4043 @cindex underscores, avoiding (88k)
4044 In assembler output, emit symbol names without adding an underscore
4045 character at the beginning of each name.  The default is to use an
4046 underscore as prefix on each name.
4047
4048 @item -mocs-debug-info
4049 @itemx -mno-ocs-debug-info
4050 @kindex -mocs-debug-info
4051 @kindex -mno-ocs-debug-info
4052 @cindex OCS (88k)
4053 @cindex debugging, 88k OCS
4054 Include (or omit) additional debugging information (about registers used
4055 in each stack frame) as specified in the 88open Object Compatibility
4056 Standard, ``OCS''.  This extra information allows debugging of code that
4057 has had the frame pointer eliminated.  The default for DG/UX, SVr4, and
4058 Delta 88 SVr3.2 is to include this information; other 88k configurations
4059 omit this information by default.
4060
4061 @item -mocs-frame-position
4062 @kindex -mocs-frame-position
4063 @cindex register positions in frame (88k)
4064 When emitting COFF debugging information for automatic variables and
4065 parameters stored on the stack, use the offset from the canonical frame
4066 address, which is the stack pointer (register 31) on entry to the
4067 function.  The DG/UX, SVr4, Delta88 SVr3.2, and BCS configurations use
4068 @samp{-mocs-frame-position}; other 88k configurations have the default
4069 @samp{-mno-ocs-frame-position}.
4070
4071 @item -mno-ocs-frame-position
4072 @kindex -mno-ocs-frame-position
4073 @cindex register positions in frame (88k)
4074 When emitting COFF debugging information for automatic variables and
4075 parameters stored on the stack, use the offset from the frame pointer
4076 register (register 30).  When this option is in effect, the frame
4077 pointer is not eliminated when debugging information is selected by the
4078 -g switch.
4079
4080 @item -moptimize-arg-area
4081 @itemx -mno-optimize-arg-area
4082 @kindex -moptimize-arg-area
4083 @kindex -mno-optimize-arg-area
4084 @cindex arguments in frame (88k)
4085 Control how function arguments are stored in stack frames.
4086 @samp{-moptimize-arg-area} saves space by optimizing them, but this
4087 conflicts with the 88open specifications.  The opposite alternative,
4088 @samp{-mno-optimize-arg-area}, agrees with 88open standards.  By default
4089 GNU CC does not optimize the argument area.
4090
4091 @item -mshort-data-@var{num}
4092 @kindex -mshort-data-@var{num}
4093 @cindex smaller data references (88k)
4094 @cindex r0-relative references (88k)
4095 Generate smaller data references by making them relative to @code{r0},
4096 which allows loading a value using a single instruction (rather than the
4097 usual two).  You control which data references are affected by
4098 specifying @var{num} with this option.  For example, if you specify
4099 @samp{-mshort-data-512}, then the data references affected are those
4100 involving displacements of less than 512 bytes.
4101 @samp{-mshort-data-@var{num}} is not effective for @var{num} greater
4102 than 64k.
4103
4104 @item -mserialize-volatile
4105 @kindex -mserialize-volatile
4106 @itemx -mno-serialize-volatile
4107 @kindex -mno-serialize-volatile
4108 @cindex sequential consistency on 88k
4109 Do, or don't, generate code to guarantee sequential consistency
4110 of volatile memory references.  By default, consistency is
4111 guaranteed.
4112
4113 The order of memory references made by the MC88110 processor does
4114 not always match the order of the instructions requesting those
4115 references.  In particular, a load instruction may execute before
4116 a preceding store instruction.  Such reordering violates
4117 sequential consistency of volatile memory references, when there
4118 are multiple processors.   When consistency must be guaranteed,
4119 GNU C generates special instructions, as needed, to force
4120 execution in the proper order.
4121
4122 The MC88100 processor does not reorder memory references and so
4123 always provides sequential consistency.  However, by default, GNU
4124 C generates the special instructions to guarantee consistency
4125 even when you use @samp{-m88100}, so that the code may be run on an
4126 MC88110 processor.  If you intend to run your code only on the
4127 MC88100 processor, you may use @samp{-mno-serialize-volatile}.
4128
4129 The extra code generated to guarantee consistency may affect the
4130 performance of your application.  If you know that you can safely
4131 forgo this guarantee, you may use @samp{-mno-serialize-volatile}.
4132
4133 @item -msvr4
4134 @itemx -msvr3
4135 @kindex -msvr4
4136 @kindex -msvr3
4137 @cindex assembler syntax, 88k
4138 @cindex SVr4
4139 Turn on (@samp{-msvr4}) or off (@samp{-msvr3}) compiler extensions
4140 related to System V release 4 (SVr4).  This controls the following:
4141
4142 @enumerate
4143 @item
4144 Which variant of the assembler syntax to emit.
4145 @item
4146 @samp{-msvr4} makes the C preprocessor recognize @samp{#pragma weak}
4147 that is used on System V release 4.
4148 @item
4149 @samp{-msvr4} makes GNU CC issue additional declaration directives used in
4150 SVr4.
4151 @end enumerate
4152
4153 @samp{-msvr4} is the default for the m88k-motorola-sysv4 and
4154 m88k-dg-dgux m88k configurations. @samp{-msvr3} is the default for all
4155 other m88k configurations.
4156
4157 @item -mversion-03.00
4158 @kindex -mversion-03.00
4159 This option is obsolete, and is ignored.
4160 @c ??? which asm syntax better for GAS?  option there too?
4161
4162 @item -mno-check-zero-division
4163 @itemx -mcheck-zero-division
4164 @kindex -mno-check-zero-division
4165 @kindex -mcheck-zero-division
4166 @cindex zero division on 88k
4167 Do, or don't, generate code to guarantee that integer division by
4168 zero will be detected.  By default, detection is guaranteed.
4169
4170 Some models of the MC88100 processor fail to trap upon integer
4171 division by zero under certain conditions.  By default, when
4172 compiling code that might be run on such a processor, GNU C
4173 generates code that explicitly checks for zero-valued divisors
4174 and traps with exception number 503 when one is detected.  Use of
4175 mno-check-zero-division suppresses such checking for code
4176 generated to run on an MC88100 processor.
4177
4178 GNU C assumes that the MC88110 processor correctly detects all
4179 instances of integer division by zero.  When @samp{-m88110} is
4180 specified, both @samp{-mcheck-zero-division} and
4181 @samp{-mno-check-zero-division} are ignored, and no explicit checks for
4182 zero-valued divisors are generated.
4183
4184 @item -muse-div-instruction
4185 @kindex -muse-div-instruction
4186 @cindex divide instruction, 88k
4187 Use the div instruction for signed integer division on the
4188 MC88100 processor.  By default, the div instruction is not used.
4189
4190 On the MC88100 processor the signed integer division instruction
4191 div) traps to the operating system on a negative operand.  The
4192 operating system transparently completes the operation, but at a
4193 large cost in execution time.  By default, when compiling code
4194 that might be run on an MC88100 processor, GNU C emulates signed
4195 integer division using the unsigned integer division instruction
4196 divu), thereby avoiding the large penalty of a trap to the
4197 operating system.  Such emulation has its own, smaller, execution
4198 cost in both time and space.  To the extent that your code's
4199 important signed integer division operations are performed on two
4200 nonnegative operands, it may be desirable to use the div
4201 instruction directly.
4202
4203 On the MC88110 processor the div instruction (also known as the
4204 divs instruction) processes negative operands without trapping to
4205 the operating system.  When @samp{-m88110} is specified,
4206 @samp{-muse-div-instruction} is ignored, and the div instruction is used
4207 for signed integer division.
4208
4209 Note that the result of dividing INT_MIN by -1 is undefined.  In
4210 particular, the behavior of such a division with and without
4211 @samp{-muse-div-instruction}  may differ.
4212
4213 @item -mtrap-large-shift
4214 @itemx -mhandle-large-shift
4215 @kindex -mtrap-large-shift
4216 @kindex -mhandle-large-shift
4217 @cindex bit shift overflow (88k)
4218 @cindex large bit shifts (88k)
4219 Include code to detect bit-shifts of more than 31 bits; respectively,
4220 trap such shifts or emit code to handle them properly.  By default GNU CC
4221 makes no special provision for large bit shifts.
4222
4223 @item -mwarn-passed-structs
4224 @kindex -mwarn-passed-structs
4225 @cindex structure passing (88k)
4226 Warn when a function passes a struct as an argument or result.
4227 Structure-passing conventions have changed during the evolution of the C
4228 language, and are often the source of portability problems.  By default,
4229 GNU CC issues no such warning.
4230 @end table
4231
4232 @node RS/6000 and PowerPC Options
4233 @subsection IBM RS/6000 and PowerPC Options
4234 @cindex RS/6000 and PowerPC Options
4235 @cindex IBM RS/6000 and PowerPC Options
4236
4237 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
4238 @table @code
4239 @item -mpower
4240 @itemx -mno-power
4241 @itemx -mpower2
4242 @itemx -mno-power2
4243 @itemx -mpowerpc
4244 @itemx -mno-powerpc
4245 @itemx -mpowerpc-gpopt
4246 @itemx -mno-powerpc-gpopt
4247 @itemx -mpowerpc-gfxopt
4248 @itemx -mno-powerpc-gfxopt
4249 @itemx -mpowerpc64
4250 @itemx -mno-powerpc64
4251 @kindex -mpower
4252 @kindex -mpower2
4253 @kindex -mpowerpc
4254 @kindex -mpowerpc-gpopt
4255 @kindex -mpowerpc-gfxopt
4256 @kindex -mpowerpc64
4257 GNU CC supports two related instruction set architectures for the
4258 RS/6000 and PowerPC.  The @dfn{POWER} instruction set are those
4259 instructions supported by the @samp{rios} chip set used in the original
4260 RS/6000 systems and the @dfn{PowerPC} instruction set is the
4261 architecture of the Motorola MPC5xx, MPC6xx, MPC8xx microprocessors, and
4262 the IBM 4xx microprocessors.
4263
4264 Neither architecture is a subset of the other.  However there is a
4265 large common subset of instructions supported by both.  An MQ
4266 register is included in processors supporting the POWER architecture.
4267
4268 You use these options to specify which instructions are available on the
4269 processor you are using.  The default value of these options is
4270 determined when configuring GNU CC.  Specifying the
4271 @samp{-mcpu=@var{cpu_type}} overrides the specification of these
4272 options.  We recommend you use the @samp{-mcpu=@var{cpu_type}} option
4273 rather than the options listed above.
4274
4275 The @samp{-mpower} option allows GNU CC to generate instructions that
4276 are found only in the POWER architecture and to use the MQ register.
4277 Specifying @samp{-mpower2} implies @samp{-power} and also allows GNU CC
4278 to generate instructions that are present in the POWER2 architecture but
4279 not the original POWER architecture.
4280
4281 The @samp{-mpowerpc} option allows GNU CC to generate instructions that
4282 are found only in the 32-bit subset of the PowerPC architecture.
4283 Specifying @samp{-mpowerpc-gpopt} implies @samp{-mpowerpc} and also allows
4284 GNU CC to use the optional PowerPC architecture instructions in the
4285 General Purpose group, including floating-point square root.  Specifying
4286 @samp{-mpowerpc-gfxopt} implies @samp{-mpowerpc} and also allows GNU CC to
4287 use the optional PowerPC architecture instructions in the Graphics
4288 group, including floating-point select.
4289
4290 The @samp{-mpowerpc64} option allows GNU CC to generate the additional
4291 64-bit instructions that are found in the full PowerPC64 architecture
4292 and to treat GPRs as 64-bit, doubleword quantities.  GNU CC defaults to
4293 @samp{-mno-powerpc64}.
4294
4295 If you specify both @samp{-mno-power} and @samp{-mno-powerpc}, GNU CC
4296 will use only the instructions in the common subset of both
4297 architectures plus some special AIX common-mode calls, and will not use
4298 the MQ register.  Specifying both @samp{-mpower} and @samp{-mpowerpc}
4299 permits GNU CC to use any instruction from either architecture and to
4300 allow use of the MQ register; specify this for the Motorola MPC601.
4301
4302 @item -mnew-mnemonics
4303 @itemx -mold-mnemonics
4304 @kindex -mnew-mnemonics
4305 @kindex -mold-mnemonics
4306 Select which mnemonics to use in the generated assembler code.
4307 @samp{-mnew-mnemonics} requests output that uses the assembler mnemonics
4308 defined for the PowerPC architecture, while @samp{-mold-mnemonics}
4309 requests the assembler mnemonics defined for the POWER architecture.
4310 Instructions defined in only one architecture have only one mnemonic;
4311 GNU CC uses that mnemonic irrespective of which of these options is
4312 specified.
4313
4314 GNU CC defaults to the mnemonics appropriate for the architecture in
4315 use.  Specifying @samp{-mcpu=@var{cpu_type}} sometimes overrides the
4316 value of these option.  Unless you are building a cross-compiler, you
4317 should normally not specify either @samp{-mnew-mnemonics} or
4318 @samp{-mold-mnemonics}, but should instead accept the default.
4319
4320 @item -mcpu=@var{cpu_type}
4321 @kindex -mcpu
4322 Set architecture type, register usage, choice of mnemonics, and
4323 instruction scheduling parameters for machine type @var{cpu_type}.
4324 Supported values for @var{cpu_type} are @samp{rs6000}, @samp{rios1},
4325 @samp{rios2}, @samp{rsc}, @samp{601}, @samp{602}, @samp{603},
4326 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{740},
4327 @samp{750}, @samp{power}, @samp{power2}, @samp{powerpc}, @samp{403},
4328 @samp{505}, @samp{801}, @samp{821}, @samp{823}, and @samp{860} and
4329 @samp{common}.  @samp{-mcpu=power}, @samp{-mcpu=power2}, and
4330 @samp{-mcpu=powerpc} specify generic POWER, POWER2 and pure PowerPC
4331 (i.e., not MPC601) architecture machine types, with an appropriate,
4332 generic processor model assumed for scheduling purposes.@refill
4333
4334 @c overfull hbox here --bob 22 jul96
4335 @c original text between ignore ... end ignore
4336 @ignore
4337 Specifying any of the @samp{-mcpu=rios1}, @samp{-mcpu=rios2},
4338 @samp{-mcpu=rsc}, @samp{-mcpu=power}, or @samp{-mcpu=power2} options
4339 enables the @samp{-mpower} option and disables the @samp{-mpowerpc}
4340 option; @samp{-mcpu=601} enables both the @samp{-mpower} and
4341 @samp{-mpowerpc} options; all of @samp{-mcpu=602}, @samp{-mcpu=603},
4342 @samp{-mcpu=603e}, @samp{-mcpu=604}, @samp{-mcpu=604e},
4343 @samp{-mcpu=620}, @samp{-mcpu=403}, @samp{-mcpu=505}, @samp{-mcpu=801},
4344 @samp{-mcpu=821}, @samp{-mcpu=823}, @samp{-mcpu=860} and
4345 @samp{-mcpu=powerpc} enable the @samp{-mpowerpc} option and disable the
4346 @samp{-mpower} option; @samp{-mcpu=common} disables both the
4347 @samp{-mpower} and @samp{-mpowerpc} options.@refill
4348 @end ignore
4349 @c            changed paragraph
4350 Specifying any of the following options: 
4351 @samp{-mcpu=rios1}, @samp{-mcpu=rios2}, @samp{-mcpu=rsc},
4352 @samp{-mcpu=power}, or @samp{-mcpu=power2}  
4353 enables the @samp{-mpower} option and disables the @samp{-mpowerpc} option; 
4354 @samp{-mcpu=601} enables both the @samp{-mpower} and @samp{-mpowerpc} options.
4355 All of @samp{-mcpu=602}, @samp{-mcpu=603}, @samp{-mcpu=603e},
4356 @samp{-mcpu=604}, @samp{-mcpu=620}, 
4357 enable the @samp{-mpowerpc} option and disable the @samp{-mpower} option.  
4358 Exactly similarly, all of @samp{-mcpu=403},
4359 @samp{-mcpu=505}, @samp{-mcpu=821}, @samp{-mcpu=860} and @samp{-mcpu=powerpc} 
4360 enable the @samp{-mpowerpc} option and disable the @samp{-mpower} option.
4361 @samp{-mcpu=common} disables both the 
4362 @samp{-mpower} and @samp{-mpowerpc} options.@refill
4363 @c             end changes to prevent overfull hboxes
4364
4365 AIX versions 4 or greater selects @samp{-mcpu=common} by default, so
4366 that code will operate on all members of the RS/6000 and PowerPC
4367 families.  In that case, GNU CC will use only the instructions in the
4368 common subset of both architectures plus some special AIX common-mode
4369 calls, and will not use the MQ register.  GNU CC assumes a generic
4370 processor model for scheduling purposes.
4371
4372 Specifying any of the options @samp{-mcpu=rios1}, @samp{-mcpu=rios2},
4373 @samp{-mcpu=rsc}, @samp{-mcpu=power}, or @samp{-mcpu=power2} also
4374 disables the @samp{new-mnemonics} option.  Specifying @samp{-mcpu=601},
4375 @samp{-mcpu=602}, @samp{-mcpu=603}, @samp{-mcpu=603e}, @samp{-mcpu=604},
4376 @samp{620}, @samp{403}, or @samp{-mcpu=powerpc} also enables the
4377 @samp{new-mnemonics} option.@refill
4378
4379 Specifying @samp{-mcpu=403}, @samp{-mcpu=821}, or @samp{-mcpu=860} also
4380 enables the @samp{-msoft-float} option.
4381
4382 @item -mtune=@var{cpu_type}
4383 Set the instruction scheduling parameters for machine type
4384 @var{cpu_type}, but do not set the architecture type, register usage,
4385 choice of mnemonics like @samp{-mcpu=}@var{cpu_type} would.  The same
4386 values for @var{cpu_type} are used for @samp{-mtune=}@var{cpu_type} as
4387 for @samp{-mcpu=}@var{cpu_type}.  The @samp{-mtune=}@var{cpu_type}
4388 option overrides the @samp{-mcpu=}@var{cpu_type} option in terms of
4389 instruction scheduling parameters.
4390
4391 @item -mfull-toc
4392 @itemx -mno-fp-in-toc
4393 @itemx -mno-sum-in-toc
4394 @itemx -mminimal-toc
4395 @kindex -mminimal-toc
4396 Modify generation of the TOC (Table Of Contents), which is created for
4397 every executable file.  The @samp{-mfull-toc} option is selected by
4398 default.  In that case, GNU CC will allocate at least one TOC entry for
4399 each unique non-automatic variable reference in your program.  GNU CC
4400 will also place floating-point constants in the TOC.  However, only
4401 16,384 entries are available in the TOC.
4402
4403 If you receive a linker error message that saying you have overflowed
4404 the available TOC space, you can reduce the amount of TOC space used
4405 with the @samp{-mno-fp-in-toc} and @samp{-mno-sum-in-toc} options.
4406 @samp{-mno-fp-in-toc} prevents GNU CC from putting floating-point
4407 constants in the TOC and @samp{-mno-sum-in-toc} forces GNU CC to
4408 generate code to calculate the sum of an address and a constant at
4409 run-time instead of putting that sum into the TOC.  You may specify one
4410 or both of these options.  Each causes GNU CC to produce very slightly
4411 slower and larger code at the expense of conserving TOC space.
4412
4413 If you still run out of space in the TOC even when you specify both of
4414 these options, specify @samp{-mminimal-toc} instead.  This option causes
4415 GNU CC to make only one TOC entry for every file.  When you specify this
4416 option, GNU CC will produce code that is slower and larger but which
4417 uses extremely little TOC space.  You may wish to use this option
4418 only on files that contain less frequently executed code. @refill
4419
4420 @item -maix64
4421 @itemx -maix32
4422 @kindex -maix64
4423 @kindex -maix32
4424 Enable AIX 64-bit ABI and calling convention: 64-bit pointers, 64-bit
4425 @code{long} type, and the infrastructure needed to support them.
4426 Specifying @samp{-maix64} implies @samp{-mpowerpc64} and
4427 @samp{-mpowerpc}, while @samp{-maix32} disables the 64-bit ABI and
4428 implies @samp{-mno-powerpc64}.  GNU CC defaults to @samp{-maix32}.
4429
4430 @item -mxl-call
4431 @itemx -mno-xl-call
4432 @kindex -mxl-call
4433 On AIX, pass floating-point arguments to prototyped functions beyond the
4434 register save area (RSA) on the stack in addition to argument FPRs.  The
4435 AIX calling convention was extended but not initially documented to
4436 handle an obscure K&R C case of calling a function that takes the
4437 address of its arguments with fewer arguments than declared.  AIX XL
4438 compilers access floating point arguments which do not fit in the
4439 RSA from the stack when a subroutine is compiled without
4440 optimization.  Because always storing floating-point arguments on the
4441 stack is inefficient and rarely needed, this option is not enabled by
4442 default and only is necessary when calling subroutines compiled by AIX
4443 XL compilers without optimization.
4444
4445 @item -mthreads
4446 @kindex -mthreads
4447 Support @dfn{AIX Threads}.  Link an application written to use
4448 @dfn{pthreads} with special libraries and startup code to enable the
4449 application to run.
4450
4451 @item -mpe
4452 @kindex -mpe
4453 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE).  Link an
4454 application written to use message passing with special startup code to
4455 enable the application to run.  The system must have PE installed in the
4456 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
4457 must be overridden with the @samp{-specs=} option to specify the
4458 appropriate directory location.  The Parallel Environment does not
4459 support threads, so the @samp{-mpe} option and the @samp{-mthreads}
4460 option are incompatible.
4461
4462 @item -msoft-float
4463 @itemx -mhard-float
4464 @kindex -msoft-float
4465 Generate code that does not use (uses) the floating-point register set.
4466 Software floating point emulation is provided if you use the
4467 @samp{-msoft-float} option, and pass the option to GNU CC when linking.
4468
4469 @item -mmultiple
4470 @itemx -mno-multiple
4471 Generate code that uses (does not use) the load multiple word
4472 instructions and the store multiple word instructions.  These
4473 instructions are generated by default on POWER systems, and not
4474 generated on PowerPC systems.  Do not use @samp{-mmultiple} on little
4475 endian PowerPC systems, since those instructions do not work when the
4476 processor is in little endian mode.  The exceptions are PPC740 and
4477 PPC750 which permit the instructions usage in little endian mode.
4478
4479 @item -mstring
4480 @itemx -mno-string
4481 @kindex -mstring
4482 Generate code that uses (does not use) the load string instructions
4483 and the store string word instructions to save multiple registers and
4484 do small block moves.  These instructions are generated by default on
4485 POWER systems, and not generated on PowerPC systems.  Do not use
4486 @samp{-mstring} on little endian PowerPC systems, since those
4487 instructions do not work when the processor is in little endian mode.
4488 The exceptions are PPC740 and PPC750 which permit the instructions
4489 usage in little endian mode.
4490
4491 @item -mupdate
4492 @itemx -mno-update
4493 @kindex -mupdate
4494 Generate code that uses (does not use) the load or store instructions
4495 that update the base register to the address of the calculated memory
4496 location.  These instructions are generated by default.  If you use
4497 @samp{-mno-update}, there is a small window between the time that the
4498 stack pointer is updated and the address of the previous frame is
4499 stored, which means code that walks the stack frame across interrupts or
4500 signals may get corrupted data.
4501
4502 @item -mfused-madd
4503 @itemx -mno-fused-madd
4504 @kindex -mfused-madd
4505 Generate code that uses (does not use) the floating point multiply and
4506 accumulate instructions.  These instructions are generated by default if
4507 hardware floating is used.
4508
4509 @item -mno-bit-align
4510 @itemx -mbit-align
4511 @kindex -mbit-align
4512 On System V.4 and embedded PowerPC systems do not (do) force structures
4513 and unions that contain bit fields to be aligned to the base type of the
4514 bit field.
4515
4516 For example, by default a structure containing nothing but 8
4517 @code{unsigned} bitfields of length 1 would be aligned to a 4 byte
4518 boundary and have a size of 4 bytes.  By using @samp{-mno-bit-align},
4519 the structure would be aligned to a 1 byte boundary and be one byte in
4520 size.
4521
4522 @item -mno-strict-align
4523 @itemx -mstrict-align
4524 @kindex -mstrict-align
4525 On System V.4 and embedded PowerPC systems do not (do) assume that
4526 unaligned memory references will be handled by the system.
4527
4528 @item -mrelocatable
4529 @itemx -mno-relocatable
4530 @kindex -mrelocatable
4531 On embedded PowerPC systems generate code that allows (does not allow)
4532 the program to be relocated to a different address at runtime.  If you
4533 use @samp{-mrelocatable} on any module, all objects linked together must
4534 be compiled with @samp{-mrelocatable} or @samp{-mrelocatable-lib}.
4535
4536 @item -mrelocatable-lib
4537 @itemx -mno-relocatable-lib
4538 On embedded PowerPC systems generate code that allows (does not allow)
4539 the program to be relocated to a different address at runtime.  Modules
4540 compiled with @samp{-mrelocatable-lib} can be linked with either modules
4541 compiled without @samp{-mrelocatable} and @samp{-mrelocatable-lib} or
4542 with modules compiled with the @samp{-mrelocatable} options.
4543
4544 @item -mno-toc
4545 @itemx -mtoc
4546 On System V.4 and embedded PowerPC systems do not (do) assume that
4547 register 2 contains a pointer to a global area pointing to the addresses
4548 used in the program.
4549
4550 @item -mlittle
4551 @itemx -mlittle-endian
4552 On System V.4 and embedded PowerPC systems compile code for the
4553 processor in little endian mode.  The @samp{-mlittle-endian} option is
4554 the same as @samp{-mlittle}.
4555
4556 @item -mbig
4557 @itemx -mbig-endian
4558 On System V.4 and embedded PowerPC systems compile code for the
4559 processor in big endian mode.  The @samp{-mbig-endian} option is
4560 the same as @samp{-mbig}.
4561
4562 @item -mcall-sysv
4563 On System V.4 and embedded PowerPC systems compile code using calling
4564 conventions that adheres to the March 1995 draft of the System V
4565 Application Binary Interface, PowerPC processor supplement.  This is the
4566 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
4567
4568 @item -mcall-sysv-eabi
4569 Specify both @samp{-mcall-sysv} and @samp{-meabi} options.
4570
4571 @item -mcall-sysv-noeabi
4572 Specify both @samp{-mcall-sysv} and @samp{-mno-eabi} options.
4573
4574 @item -mcall-aix
4575 On System V.4 and embedded PowerPC systems compile code using calling
4576 conventions that are similar to those used on AIX.  This is the
4577 default if you configured GCC using @samp{powerpc-*-eabiaix}.
4578
4579 @item -mcall-solaris
4580 On System V.4 and embedded PowerPC systems compile code for the Solaris
4581 operating system.
4582
4583 @item -mcall-linux
4584 On System V.4 and embedded PowerPC systems compile code for the
4585 Linux-based GNU system.
4586
4587 @item -mprototype
4588 @itemx -mno-prototype
4589 On System V.4 and embedded PowerPC systems assume that all calls to
4590 variable argument functions are properly prototyped.  Otherwise, the
4591 compiler must insert an instruction before every non prototyped call to
4592 set or clear bit 6 of the condition code register (@var{CR}) to
4593 indicate whether floating point values were passed in the floating point
4594 registers in case the function takes a variable arguments.  With
4595 @samp{-mprototype}, only calls to prototyped variable argument functions
4596 will set or clear the bit.
4597
4598 @item -msim
4599 On embedded PowerPC systems, assume that the startup module is called
4600 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
4601 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}.
4602 configurations.
4603
4604 @item -mmvme
4605 On embedded PowerPC systems, assume that the startup module is called
4606 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
4607 @file{libc.a}.
4608
4609 @item -mads
4610 On embedded PowerPC systems, assume that the startup module is called
4611 @file{crt0.o} and the standard C libraries are @file{libads.a} and
4612 @file{libc.a}.
4613
4614 @item -myellowknife
4615 On embedded PowerPC systems, assume that the startup module is called
4616 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
4617 @file{libc.a}.
4618
4619 @item -memb
4620 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
4621 header to indicate that @samp{eabi} extended relocations are used.
4622
4623 @item -meabi
4624 @itemx -mno-eabi
4625 On System V.4 and embedded PowerPC systems do (do not) adhere to the
4626 Embedded Applications Binary Interface (eabi) which is a set of
4627 modifications to the System V.4 specifications.  Selecting @code{-meabi}
4628 means that the stack is aligned to an 8 byte boundary, a function
4629 @code{__eabi} is called to from @code{main} to set up the eabi
4630 environment, and the @samp{-msdata} option can use both @code{r2} and
4631 @code{r13} to point to two separate small data areas.  Selecting
4632 @code{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
4633 do not call an initialization function from @code{main}, and the
4634 @samp{-msdata} option will only use @code{r13} to point to a single
4635 small data area.  The @samp{-meabi} option is on by default if you
4636 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
4637
4638 @item -msdata=eabi
4639 On System V.4 and embedded PowerPC systems, put small initialized
4640 @code{const} global and static data in the @samp{.sdata2} section, which
4641 is pointed to by register @code{r2}.  Put small initialized
4642 non-@code{const} global and static data in the @samp{.sdata} section,
4643 which is pointed to by register @code{r13}.  Put small uninitialized
4644 global and static data in the @samp{.sbss} section, which is adjacent to
4645 the @samp{.sdata} section.  The @samp{-msdata=eabi} option is
4646 incompatible with the @samp{-mrelocatable} option.  The
4647 @samp{-msdata=eabi} option also sets the @samp{-memb} option.
4648
4649 @item -msdata=sysv
4650 On System V.4 and embedded PowerPC systems, put small global and static
4651 data in the @samp{.sdata} section, which is pointed to by register
4652 @code{r13}.  Put small uninitialized global and static data in the
4653 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
4654 The @samp{-msdata=sysv} option is incompatible with the
4655 @samp{-mrelocatable} option.
4656
4657 @item -msdata=default
4658 @itemx -msdata
4659 On System V.4 and embedded PowerPC systems, if @samp{-meabi} is used,
4660 compile code the same as @samp{-msdata=eabi}, otherwise compile code the
4661 same as @samp{-msdata=sysv}.
4662
4663 @item -msdata-data
4664 On System V.4 and embedded PowerPC systems, put small global and static
4665 data in the @samp{.sdata} section.  Put small uninitialized global and
4666 static data in the @samp{.sbss} section.  Do not use register @code{r13}
4667 to address small data however.  This is the default behavior unless
4668 other @samp{-msdata} options are used.
4669
4670 @item -msdata=none
4671 @itemx -mno-sdata
4672 On embedded PowerPC systems, put all initialized global and static data
4673 in the @samp{.data} section, and all uninitialized data in the
4674 @samp{.bss} section.
4675
4676 @item -G @var{num}
4677 @cindex smaller data references (PowerPC)
4678 @cindex .sdata/.sdata2 references (PowerPC)
4679 On embedded PowerPC systems, put global and static items less than or
4680 equal to @var{num} bytes into the small data or bss sections instead of
4681 the normal data or bss section.  By default, @var{num} is 8.  The
4682 @samp{-G @var{num}} switch is also passed to the linker.
4683 All modules should be compiled with the same @samp{-G @var{num}} value.
4684
4685 @item -mregnames
4686 @itemx -mno-regnames
4687 On System V.4 and embedded PowerPC systems do (do not) emit register
4688 names in the assembly language output using symbolic forms.
4689
4690 @end table
4691
4692 @node RT Options
4693 @subsection IBM RT Options
4694 @cindex RT options
4695 @cindex IBM RT options
4696
4697 These @samp{-m} options are defined for the IBM RT PC:
4698
4699 @table @code
4700 @item -min-line-mul
4701 Use an in-line code sequence for integer multiplies.  This is the
4702 default.
4703
4704 @item -mcall-lib-mul
4705 Call @code{lmul$$} for integer multiples.
4706
4707 @item -mfull-fp-blocks
4708 Generate full-size floating point data blocks, including the minimum
4709 amount of scratch space recommended by IBM.  This is the default.
4710
4711 @item -mminimum-fp-blocks
4712 Do not include extra scratch space in floating point data blocks.  This
4713 results in smaller code, but slower execution, since scratch space must
4714 be allocated dynamically.
4715
4716 @cindex @file{varargs.h} and RT PC
4717 @cindex @file{stdarg.h} and RT PC
4718 @item -mfp-arg-in-fpregs
4719 Use a calling sequence incompatible with the IBM calling convention in
4720 which floating point arguments are passed in floating point registers.
4721 Note that @code{varargs.h} and @code{stdargs.h} will not work with
4722 floating point operands if this option is specified.
4723
4724 @item -mfp-arg-in-gregs
4725 Use the normal calling convention for floating point arguments.  This is
4726 the default.
4727
4728 @item -mhc-struct-return
4729 Return structures of more than one word in memory, rather than in a
4730 register.  This provides compatibility with the MetaWare HighC (hc)
4731 compiler.  Use the option @samp{-fpcc-struct-return} for compatibility
4732 with the Portable C Compiler (pcc).
4733
4734 @item -mnohc-struct-return
4735 Return some structures of more than one word in registers, when
4736 convenient.  This is the default.  For compatibility with the
4737 IBM-supplied compilers, use the option @samp{-fpcc-struct-return} or the
4738 option @samp{-mhc-struct-return}.
4739 @end table
4740
4741 @node MIPS Options
4742 @subsection MIPS Options
4743 @cindex MIPS options
4744
4745 These @samp{-m} options are defined for the MIPS family of computers:
4746
4747 @table @code
4748 @item -mcpu=@var{cpu type}
4749 Assume the defaults for the machine type @var{cpu type} when scheduling
4750 instructions.  The choices for @var{cpu type} are @samp{r2000}, @samp{r3000},
4751 @samp{r4000}, @samp{r4400}, @samp{r4600}, and @samp{r6000}.  While picking a
4752 specific @var{cpu type} will schedule things appropriately for that
4753 particular chip, the compiler will not generate any code that does not
4754 meet level 1 of the MIPS ISA (instruction set architecture) without
4755 the @samp{-mips2} or @samp{-mips3} switches being used.
4756
4757 @item -mips1
4758 Issue instructions from level 1 of the MIPS ISA.  This is the default.
4759 @samp{r3000} is the default @var{cpu type} at this ISA level.
4760
4761 @item -mips2
4762 Issue instructions from level 2 of the MIPS ISA (branch likely, square
4763 root instructions).  @samp{r6000} is the default @var{cpu type} at this
4764 ISA level.
4765
4766 @item -mips3
4767 Issue instructions from level 3 of the MIPS ISA (64 bit instructions).
4768 @samp{r4000} is the default @var{cpu type} at this ISA level.
4769
4770 @item -mips4
4771 Issue instructions from level 4 of the MIPS ISA.  @samp{r8000} is the
4772 default @var{cpu type} at this ISA level.
4773
4774 @item -mfp32
4775 Assume that 32 32-bit floating point registers are available.  This is
4776 the default.
4777
4778 @item -mfp64
4779 Assume that 32 64-bit floating point registers are available.  This is
4780 the default when the @samp{-mips3} option is used.
4781
4782 @item -mgp32
4783 Assume that 32 32-bit general purpose registers are available.  This is
4784 the default.
4785
4786 @item -mgp64
4787 Assume that 32 64-bit general purpose registers are available.  This is
4788 the default when the @samp{-mips3} option is used.
4789
4790 @item -mint64
4791 Force int and long types to be 64 bits wide.  See @samp{-mlong32} for an
4792 explanation of the default, and the width of pointers.
4793
4794 @item -mlong64
4795 Force long types to be 64 bits wide.  See @samp{-mlong32} for an
4796 explanation of the default, and the width of pointers.
4797
4798 @item -mlong32
4799 Force long, int, and pointer types to be 32 bits wide.
4800
4801 If none of @samp{-mlong32}, @samp{-mlong64}, or @samp{-mint64} are set,
4802 the size of ints, longs, and pointers depends on the ABI and ISA choosen.
4803 For @samp{-mabi=32}, and @samp{-mabi=n32}, ints and longs are 32 bits
4804 wide.  For @samp{-mabi=64}, ints are 32 bits, and longs are 64 bits wide.
4805 For @samp{-mabi=eabi} and either @samp{-mips1} or @samp{-mips2}, ints
4806 and longs are 32 bits wide.  For @samp{-mabi=eabi} and higher ISAs, ints
4807 are 32 bits, and longs are 64 bits wide.  The width of pointer types is
4808 the smaller of the width of longs or the width of general purpose
4809 registers (which in turn depends on the ISA).
4810
4811 @itemx -mabi=32
4812 @itemx -mabi=n32
4813 @itemx -mabi=64
4814 @itemx -mabi=eabi
4815 Generate code for the indicated ABI.
4816
4817 @item -mmips-as
4818 Generate code for the MIPS assembler, and invoke @file{mips-tfile} to
4819 add normal debug information.  This is the default for all
4820 platforms except for the OSF/1 reference platform, using the OSF/rose
4821 object format.  If the either of the @samp{-gstabs} or @samp{-gstabs+}
4822 switches are used, the @file{mips-tfile} program will encapsulate the
4823 stabs within MIPS ECOFF.
4824
4825 @item -mgas
4826 Generate code for the GNU assembler.  This is the default on the OSF/1
4827 reference platform, using the OSF/rose object format.  Also, this is
4828 the default if the configure option @samp{--with-gnu-as} is used.
4829
4830 @item -msplit-addresses
4831 @itemx -mno-split-addresses
4832 Generate code to load the high and low parts of address constants separately.
4833 This allows @code{gcc} to optimize away redundant loads of the high order
4834 bits of addresses.  This optimization requires GNU as and GNU ld.
4835 This optimization is enabled by default for some embedded targets where
4836 GNU as and GNU ld are standard.
4837
4838 @item -mrnames
4839 @itemx -mno-rnames
4840 The @samp{-mrnames} switch says to output code using the MIPS software
4841 names for the registers, instead of the hardware names (ie, @var{a0}
4842 instead of @var{$4}).  The only known assembler that supports this option
4843 is the Algorithmics assembler.
4844
4845 @item -mgpopt
4846 @itemx -mno-gpopt
4847 The @samp{-mgpopt} switch says to write all of the data declarations
4848 before the instructions in the text section, this allows the MIPS
4849 assembler to generate one word memory references instead of using two
4850 words for short global or static data items.  This is on by default if
4851 optimization is selected.
4852
4853 @item -mstats
4854 @itemx -mno-stats
4855 For each non-inline function processed, the @samp{-mstats} switch
4856 causes the compiler to emit one line to the standard error file to
4857 print statistics about the program (number of registers saved, stack
4858 size, etc.).
4859
4860 @item -mmemcpy
4861 @itemx -mno-memcpy
4862 The @samp{-mmemcpy} switch makes all block moves call the appropriate
4863 string function (@samp{memcpy} or @samp{bcopy}) instead of possibly
4864 generating inline code.
4865
4866 @item -mmips-tfile
4867 @itemx -mno-mips-tfile
4868 The @samp{-mno-mips-tfile} switch causes the compiler not
4869 postprocess the object file with the @file{mips-tfile} program,
4870 after the MIPS assembler has generated it to add debug support.  If
4871 @file{mips-tfile} is not run, then no local variables will be
4872 available to the debugger.  In addition, @file{stage2} and
4873 @file{stage3} objects will have the temporary file names passed to the
4874 assembler embedded in the object file, which means the objects will
4875 not compare the same.  The @samp{-mno-mips-tfile} switch should only
4876 be used when there are bugs in the @file{mips-tfile} program that
4877 prevents compilation.
4878
4879 @item -msoft-float
4880 Generate output containing library calls for floating point.
4881 @strong{Warning:} the requisite libraries are not part of GNU CC.
4882 Normally the facilities of the machine's usual C compiler are used, but
4883 this can't be done directly in cross-compilation.  You must make your
4884 own arrangements to provide suitable library functions for
4885 cross-compilation.
4886
4887 @item -mhard-float
4888 Generate output containing floating point instructions.  This is the
4889 default if you use the unmodified sources.
4890
4891 @item -mabicalls
4892 @itemx -mno-abicalls
4893 Emit (or do not emit) the pseudo operations @samp{.abicalls},
4894 @samp{.cpload}, and @samp{.cprestore} that some System V.4 ports use for
4895 position independent code.
4896
4897 @item -mlong-calls
4898 @itemx -mno-long-calls
4899 Do all calls with the @samp{JALR} instruction, which requires
4900 loading up a function's address into a register before the call.
4901 You need to use this switch, if you call outside of the current
4902 512 megabyte segment to functions that are not through pointers.
4903
4904 @item -mhalf-pic
4905 @itemx -mno-half-pic
4906 Put pointers to extern references into the data section and load them
4907 up, rather than put the references in the text section.
4908
4909 @item -membedded-pic
4910 @itemx -mno-embedded-pic
4911 Generate PIC code suitable for some embedded systems.  All calls are
4912 made using PC relative address, and all data is addressed using the $gp
4913 register.  No more than 65536 bytes of global data may be used.  This
4914 requires GNU as and GNU ld which do most of the work.  This currently
4915 only works on targets which use ECOFF; it does not work with ELF.
4916
4917 @item -membedded-data
4918 @itemx -mno-embedded-data
4919 Allocate variables to the read-only data section first if possible, then
4920 next in the small data section if possible, otherwise in data.  This gives
4921 slightly slower code than the default, but reduces the amount of RAM required
4922 when executing, and thus may be preferred for some embedded systems.
4923
4924 @item -msingle-float
4925 @itemx -mdouble-float
4926 The @samp{-msingle-float} switch tells gcc to assume that the floating
4927 point coprocessor only supports single precision operations, as on the
4928 @samp{r4650} chip.  The @samp{-mdouble-float} switch permits gcc to use
4929 double precision operations.  This is the default.
4930
4931 @item -mmad
4932 @itemx -mno-mad
4933 Permit use of the @samp{mad}, @samp{madu} and @samp{mul} instructions,
4934 as on the @samp{r4650} chip.
4935
4936 @item -m4650
4937 Turns on @samp{-msingle-float}, @samp{-mmad}, and, at least for now,
4938 @samp{-mcpu=r4650}.
4939
4940 @item -EL
4941 Compile code for the processor in little endian mode.
4942 The requisite libraries are assumed to exist.
4943
4944 @item -EB
4945 Compile code for the processor in big endian mode.
4946 The requisite libraries are assumed to exist.
4947
4948 @item -G @var{num}
4949 @cindex smaller data references (MIPS)
4950 @cindex gp-relative references (MIPS)
4951 Put global and static items less than or equal to @var{num} bytes into
4952 the small data or bss sections instead of the normal data or bss
4953 section.  This allows the assembler to emit one word memory reference
4954 instructions based on the global pointer (@var{gp} or @var{$28}),
4955 instead of the normal two words used.  By default, @var{num} is 8 when
4956 the MIPS assembler is used, and 0 when the GNU assembler is used.  The
4957 @samp{-G @var{num}} switch is also passed to the assembler and linker.
4958 All modules should be compiled with the same @samp{-G @var{num}}
4959 value.
4960
4961 @item -nocpp
4962 Tell the MIPS assembler to not run its preprocessor over user
4963 assembler files (with a @samp{.s} suffix) when assembling them.
4964 @end table
4965
4966 @ifset INTERNALS
4967 These options are defined by the macro
4968 @code{TARGET_SWITCHES} in the machine description.  The default for the
4969 options is also defined by that macro, which enables you to change the
4970 defaults.
4971 @end ifset
4972
4973 @node i386 Options
4974 @subsection Intel 386 Options
4975 @cindex i386 Options
4976 @cindex Intel 386 Options
4977
4978 These @samp{-m} options are defined for the i386 family of computers:
4979
4980 @table @code
4981 @item -mcpu=@var{cpu type}
4982 Assume the defaults for the machine type @var{cpu type} when scheduling
4983 instructions.  The choices for @var{cpu type} are: @samp{i386},
4984 @samp{i486}, @samp{i586} (@samp{pentium}), @samp{pentium}, @samp{i686}
4985 (@samp{pentiumpro}) and @samp{pentiumpro}. While picking a specific
4986 @var{cpu type} will schedule things appropriately for that particular
4987 chip, the compiler will not generate any code that does not run on the
4988 i386 without the @samp{-march=@var{cpu type}} option being used.
4989
4990 @item -march=@var{cpu type}
4991 Generate instructions for the machine type @var{cpu type}.  The choices
4992 for @var{cpu type} are: @samp{i386}, @samp{i486}, @samp{pentium}, and
4993 @samp{pentiumpro}.  Specifying @samp{-march=@var{cpu type}} implies
4994 @samp{-mcpu=@var{cpu type}}.
4995
4996 @item -m386
4997 @itemx -m486
4998 @itemx -mpentium
4999 @itemx -mpentiumpro
5000 Synonyms for -mcpu=i386, -mcpu=i486, -mcpu=pentium, and -mcpu=pentiumpro
5001 respectively.
5002
5003 @item -mieee-fp
5004 @itemx -mno-ieee-fp
5005 Control whether or not the compiler uses IEEE floating point
5006 comparisons.  These handle correctly the case where the result of a
5007 comparison is unordered.
5008
5009 @item -msoft-float
5010 Generate output containing library calls for floating point.
5011 @strong{Warning:} the requisite libraries are not part of GNU CC.
5012 Normally the facilities of the machine's usual C compiler are used, but
5013 this can't be done directly in cross-compilation.  You must make your
5014 own arrangements to provide suitable library functions for
5015 cross-compilation.
5016
5017 On machines where a function returns floating point results in the 80387
5018 register stack, some floating point opcodes may be emitted even if
5019 @samp{-msoft-float} is used.
5020
5021 @item -mno-fp-ret-in-387
5022 Do not use the FPU registers for return values of functions.
5023
5024 The usual calling convention has functions return values of types
5025 @code{float} and @code{double} in an FPU register, even if there
5026 is no FPU.  The idea is that the operating system should emulate
5027 an FPU.
5028
5029 The option @samp{-mno-fp-ret-in-387} causes such values to be returned
5030 in ordinary CPU registers instead.
5031
5032 @item -mno-fancy-math-387
5033 Some 387 emulators do not support the @code{sin}, @code{cos} and
5034 @code{sqrt} instructions for the 387.  Specify this option to avoid
5035 generating those instructions. This option is the default on FreeBSD.
5036 As of revision 2.6.1, these instructions are not generated unless you
5037 also use the @samp{-ffast-math} switch.
5038
5039 @item -malign-double
5040 @itemx -mno-align-double
5041 Control whether GNU CC aligns @code{double}, @code{long double}, and
5042 @code{long long} variables on a two word boundary or a one word
5043 boundary.  Aligning @code{double} variables on a two word boundary will
5044 produce code that runs somewhat faster on a @samp{Pentium} at the
5045 expense of more memory.
5046
5047 @strong{Warning:} if you use the @samp{-malign-double} switch,
5048 structures containing the above types will be aligned differently than
5049 the published application binary interface specifications for the 386.
5050
5051 @item -msvr3-shlib
5052 @itemx -mno-svr3-shlib
5053 Control whether GNU CC places uninitialized locals into @code{bss} or
5054 @code{data}.  @samp{-msvr3-shlib} places these locals into @code{bss}.
5055 These options are meaningful only on System V Release 3.
5056
5057 @item -mno-wide-multiply
5058 @itemx -mwide-multiply
5059 Control whether GNU CC uses the @code{mul} and @code{imul} that produce
5060 64 bit results in @code{eax:edx} from 32 bit operands to do @code{long
5061 long} multiplies and 32-bit division by constants.
5062
5063 @item -mrtd
5064 Use a different function-calling convention, in which functions that
5065 take a fixed number of arguments return with the @code{ret} @var{num}
5066 instruction, which pops their arguments while returning.  This saves one
5067 instruction in the caller since there is no need to pop the arguments
5068 there.
5069
5070 You can specify that an individual function is called with this calling
5071 sequence with the function attribute @samp{stdcall}.  You can also
5072 override the @samp{-mrtd} option by using the function attribute
5073 @samp{cdecl}.  @xref{Function Attributes}.
5074
5075 @strong{Warning:} this calling convention is incompatible with the one
5076 normally used on Unix, so you cannot use it if you need to call
5077 libraries compiled with the Unix compiler.
5078
5079 Also, you must provide function prototypes for all functions that
5080 take variable numbers of arguments (including @code{printf});
5081 otherwise incorrect code will be generated for calls to those
5082 functions.
5083
5084 In addition, seriously incorrect code will result if you call a
5085 function with too many arguments.  (Normally, extra arguments are
5086 harmlessly ignored.)
5087
5088 @item -mreg-alloc=@var{regs}
5089 Control the default allocation order of integer registers.  The
5090 string @var{regs} is a series of letters specifying a register.  The
5091 supported letters are: @code{a} allocate EAX; @code{b} allocate EBX;
5092 @code{c} allocate ECX; @code{d} allocate EDX; @code{S} allocate ESI;
5093 @code{D} allocate EDI; @code{B} allocate EBP.
5094
5095 @item -mregparm=@var{num}
5096 Control how many registers are used to pass integer arguments.  By
5097 default, no registers are used to pass arguments, and at most 3
5098 registers can be used.  You can control this behavior for a specific
5099 function by using the function attribute @samp{regparm}.
5100 @xref{Function Attributes}.
5101
5102 @strong{Warning:} if you use this switch, and
5103 @var{num} is nonzero, then you must build all modules with the same
5104 value, including any libraries.  This includes the system libraries and
5105 startup modules.
5106
5107 @item -malign-loops=@var{num}
5108 Align loops to a 2 raised to a @var{num} byte boundary.  If
5109 @samp{-malign-loops} is not specified, the default is 2 unless
5110 gas 2.8 (or later) is being used in which case the default is
5111 to align the loop on a 16 byte boundary if it is less than 8
5112 bytes away.
5113
5114 @item -malign-jumps=@var{num}
5115 Align instructions that are only jumped to to a 2 raised to a @var{num}
5116 byte boundary.  If @samp{-malign-jumps} is not specified, the default is
5117 2 if optimizing for a 386, and 4 if optimizing for a 486 unless
5118 gas 2.8 (or later) is being used in which case the default is
5119 to align the instruction on a 16 byte boundary if it is less
5120 than 8 bytes away.
5121
5122 @item -malign-functions=@var{num}
5123 Align the start of functions to a 2 raised to @var{num} byte boundary.
5124 If @samp{-malign-functions} is not specified, the default is 2 if optimizing
5125 for a 386, and 4 if optimizing for a 486.
5126 @end table
5127
5128 @node HPPA Options
5129 @subsection HPPA Options
5130 @cindex HPPA Options
5131
5132 These @samp{-m} options are defined for the HPPA family of computers:
5133
5134 @table @code
5135 @item -mpa-risc-1-0
5136 Generate code for a PA 1.0 processor.
5137
5138 @item -mpa-risc-1-1
5139 Generate code for a PA 1.1 processor.
5140
5141 @item -mbig-switch
5142 Generate code suitable for big switch tables.  Use this option only if
5143 the assembler/linker complain about out of range branches within a switch
5144 table.
5145
5146 @item -mjump-in-delay
5147 Fill delay slots of function calls with unconditional jump instructions
5148 by modifying the return pointer for the function call to be the target
5149 of the conditional jump.
5150
5151 @item -mdisable-fpregs
5152 Prevent floating point registers from being used in any manner.  This is
5153 necessary for compiling kernels which perform lazy context switching of
5154 floating point registers.  If you use this option and attempt to perform
5155 floating point operations, the compiler will abort.
5156
5157 @item -mdisable-indexing
5158 Prevent the compiler from using indexing address modes.  This avoids some
5159 rather obscure problems when compiling MIG generated code under MACH.
5160
5161 @item -mno-space-regs
5162 Generate code that assumes the target has no space registers.  This allows
5163 GCC to generate faster indirect calls and use unscaled index address modes.
5164
5165 Such code is suitable for level 0 PA systems and kernels.
5166
5167 @item -mfast-indirect-calls
5168 Generate code that assumes calls never cross space boundaries.  This
5169 allows GCC to emit code which performs faster indirect calls.
5170
5171 This option will not work in the presense of shared libraries or nested
5172 functions.
5173
5174 @item -mspace
5175 Optimize for space rather than execution time.  Currently this only
5176 enables out of line function prologues and epilogues.  This option is
5177 incompatible with PIC code generation and profiling.
5178
5179 @item -mlong-load-store
5180 Generate 3-instruction load and store sequences as sometimes required by
5181 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
5182 the HP compilers.
5183
5184 @item -mportable-runtime
5185 Use the portable calling conventions proposed by HP for ELF systems.
5186
5187 @item -mgas
5188 Enable the use of assembler directives only GAS understands.
5189
5190 @item -mschedule=@var{cpu type}
5191 Schedule code according to the constraints for the machine type
5192 @var{cpu type}.  The choices for @var{cpu type} are @samp{700} 
5193 @samp{7100}, @samp{7100LC}, @samp{7200}, and @samp{8000}.  Refer to 
5194 @file{/usr/lib/sched.models} on an HP-UX system to determine the
5195 proper scheduling option for your machine.
5196
5197 @item -mlinker-opt
5198 Enable the optimization pass in the HPUX linker.  Note this makes symbolic
5199 debugging impossible.  It also triggers a bug in the HPUX 8 and HPUX 9 linkers
5200 in which they give bogus error messages when linking some programs.
5201
5202 @item -msoft-float
5203 Generate output containing library calls for floating point.
5204 @strong{Warning:} the requisite libraries are not available for all HPPA
5205 targets.  Normally the facilities of the machine's usual C compiler are
5206 used, but this cannot be done directly in cross-compilation.  You must make
5207 your own arrangements to provide suitable library functions for
5208 cross-compilation.  The embedded target @samp{hppa1.1-*-pro}
5209 does provide software floating point support.
5210
5211 @samp{-msoft-float} changes the calling convention in the output file;
5212 therefore, it is only useful if you compile @emph{all} of a program with
5213 this option.  In particular, you need to compile @file{libgcc.a}, the
5214 library that comes with GNU CC, with @samp{-msoft-float} in order for
5215 this to work.
5216 @end table
5217
5218 @node Intel 960 Options
5219 @subsection Intel 960 Options
5220
5221 These @samp{-m} options are defined for the Intel 960 implementations:
5222
5223 @table @code
5224 @item -m@var{cpu type}
5225 Assume the defaults for the machine type @var{cpu type} for some of
5226 the other options, including instruction scheduling, floating point
5227 support, and addressing modes.  The choices for @var{cpu type} are
5228 @samp{ka}, @samp{kb}, @samp{mc}, @samp{ca}, @samp{cf},
5229 @samp{sa}, and @samp{sb}.
5230 The default is
5231 @samp{kb}.
5232
5233 @item -mnumerics
5234 @itemx -msoft-float
5235 The @samp{-mnumerics} option indicates that the processor does support
5236 floating-point instructions.  The @samp{-msoft-float} option indicates
5237 that floating-point support should not be assumed.
5238
5239 @item -mleaf-procedures
5240 @itemx -mno-leaf-procedures
5241 Do (or do not) attempt to alter leaf procedures to be callable with the
5242 @code{bal} instruction as well as @code{call}.  This will result in more
5243 efficient code for explicit calls when the @code{bal} instruction can be
5244 substituted by the assembler or linker, but less efficient code in other
5245 cases, such as calls via function pointers, or using a linker that doesn't
5246 support this optimization.
5247
5248 @item -mtail-call
5249 @itemx -mno-tail-call
5250 Do (or do not) make additional attempts (beyond those of the
5251 machine-independent portions of the compiler) to optimize tail-recursive
5252 calls into branches.  You may not want to do this because the detection of
5253 cases where this is not valid is not totally complete.  The default is
5254 @samp{-mno-tail-call}.
5255
5256 @item -mcomplex-addr
5257 @itemx -mno-complex-addr
5258 Assume (or do not assume) that the use of a complex addressing mode is a
5259 win on this implementation of the i960.  Complex addressing modes may not
5260 be worthwhile on the K-series, but they definitely are on the C-series.
5261 The default is currently @samp{-mcomplex-addr} for all processors except
5262 the CB and CC.
5263
5264 @item -mcode-align
5265 @itemx -mno-code-align
5266 Align code to 8-byte boundaries for faster fetching (or don't bother).
5267 Currently turned on by default for C-series implementations only.
5268
5269 @ignore
5270 @item -mclean-linkage
5271 @itemx -mno-clean-linkage
5272 These options are not fully implemented.
5273 @end ignore
5274
5275 @item -mic-compat
5276 @itemx -mic2.0-compat
5277 @itemx -mic3.0-compat
5278 Enable compatibility with iC960 v2.0 or v3.0.
5279
5280 @item -masm-compat
5281 @itemx -mintel-asm
5282 Enable compatibility with the iC960 assembler.
5283
5284 @item -mstrict-align
5285 @itemx -mno-strict-align
5286 Do not permit (do permit) unaligned accesses.
5287
5288 @item -mold-align
5289 Enable structure-alignment compatibility with Intel's gcc release version
5290 1.3 (based on gcc 1.37).  This option implies @samp{-mstrict-align}.
5291
5292 @item -mlong-double-64
5293 Implement type @samp{long double} as 64-bit floating point numbers.
5294 Without the option @samp{long double} is implemented by 80-bit
5295 floating point numbers.  The only reason we have it because there is
5296 no 128-bit @samp{long double} support in @samp{fp-bit.c} yet.  So it
5297 is only useful for people using soft-float targets.  Otherwise, we
5298 should recommend against use of it.
5299
5300 @end table
5301
5302 @node DEC Alpha Options
5303 @subsection DEC Alpha Options
5304
5305 These @samp{-m} options are defined for the DEC Alpha implementations:
5306
5307 @table @code
5308 @item -mno-soft-float
5309 @itemx -msoft-float
5310 Use (do not use) the hardware floating-point instructions for
5311 floating-point operations.  When @code{-msoft-float} is specified,
5312 functions in @file{libgcc1.c} will be used to perform floating-point
5313 operations.  Unless they are replaced by routines that emulate the
5314 floating-point operations, or compiled in such a way as to call such
5315 emulations routines, these routines will issue floating-point
5316 operations.   If you are compiling for an Alpha without floating-point
5317 operations, you must ensure that the library is built so as not to call
5318 them.
5319
5320 Note that Alpha implementations without floating-point operations are
5321 required to have floating-point registers.
5322
5323 @item -mfp-reg
5324 @itemx -mno-fp-regs
5325 Generate code that uses (does not use) the floating-point register set.
5326 @code{-mno-fp-regs} implies @code{-msoft-float}.  If the floating-point
5327 register set is not used, floating point operands are passed in integer
5328 registers as if they were integers and floating-point results are passed
5329 in $0 instead of $f0.  This is a non-standard calling sequence, so any
5330 function with a floating-point argument or return value called by code
5331 compiled with @code{-mno-fp-regs} must also be compiled with that
5332 option.
5333
5334 A typical use of this option is building a kernel that does not use,
5335 and hence need not save and restore, any floating-point registers.
5336
5337 @item -mieee
5338 The Alpha architecture implements floating-point hardware optimized for
5339 maximum performance.  It is mostly compliant with the IEEE floating
5340 point standard.  However, for full compliance, software assistance is
5341 required.  This option generates code fully IEEE compliant code
5342 @emph{except} that the @var{inexact flag} is not maintained (see below).
5343 If this option is turned on, the CPP macro @code{_IEEE_FP} is defined
5344 during compilation.  The option is a shorthand for: @samp{-D_IEEE_FP
5345 -mfp-trap-mode=su -mtrap-precision=i -mieee-conformant}.  The resulting
5346 code is less efficient but is able to correctly support denormalized
5347 numbers and exceptional IEEE values such as not-a-number and plus/minus
5348 infinity.  Other Alpha compilers call this option
5349 @code{-ieee_with_no_inexact}.
5350
5351 @item -mieee-with-inexact
5352 @c overfull hbox here --bob 22 jul96
5353 @c original text between ignore ... end ignore
5354 @ignore
5355 This is like @samp{-mieee} except the generated code also maintains the
5356 IEEE @var{inexact flag}.  Turning on this option causes the generated
5357 code to implement fully-compliant IEEE math.  The option is a shorthand
5358 for @samp{-D_IEEE_FP -D_IEEE_FP_INEXACT} plus @samp{-mieee-conformant},
5359 @samp{-mfp-trap-mode=sui}, and @samp{-mtrap-precision=i}.  On some Alpha
5360 implementations the resulting code may execute significantly slower than
5361 the code generated by default.  Since there is very little code that
5362 depends on the @var{inexact flag}, you should normally not specify this
5363 option.  Other Alpha compilers call this option
5364 @samp{-ieee_with_inexact}.
5365 @end ignore
5366 @c            changed paragraph
5367 This is like @samp{-mieee} except the generated code also maintains the
5368 IEEE @var{inexact flag}.  Turning on this option causes the generated
5369 code to implement fully-compliant IEEE math.  The option is a shorthand
5370 for @samp{-D_IEEE_FP -D_IEEE_FP_INEXACT} plus the three following:
5371 @samp{-mieee-conformant},
5372 @samp{-mfp-trap-mode=sui}, 
5373 and @samp{-mtrap-precision=i}.  
5374 On some Alpha implementations the resulting code may execute
5375 significantly slower than the code generated by default.  Since there
5376 is very little code that depends on the @var{inexact flag}, you should
5377 normally not specify this option.  Other Alpha compilers call this
5378 option @samp{-ieee_with_inexact}.
5379 @c             end changes to prevent overfull hboxes
5380
5381 @item -mfp-trap-mode=@var{trap mode}
5382 This option controls what floating-point related traps are enabled.
5383 Other Alpha compilers call this option @samp{-fptm }@var{trap mode}.
5384 The trap mode can be set to one of four values:
5385
5386 @table @samp
5387 @item n
5388 This is the default (normal) setting.  The only traps that are enabled
5389 are the ones that cannot be disabled in software (e.g., division by zero
5390 trap).
5391
5392 @item u
5393 In addition to the traps enabled by @samp{n}, underflow traps are enabled
5394 as well.
5395
5396 @item su
5397 Like @samp{su}, but the instructions are marked to be safe for software
5398 completion (see Alpha architecture manual for details).
5399
5400 @item sui
5401 Like @samp{su}, but inexact traps are enabled as well.
5402 @end table
5403
5404 @item -mfp-rounding-mode=@var{rounding mode}
5405 Selects the IEEE rounding mode.  Other Alpha compilers call this option
5406 @samp{-fprm }@var{rounding mode}.  The @var{rounding mode} can be one
5407 of:
5408
5409 @table @samp
5410 @item n
5411 Normal IEEE rounding mode.  Floating point numbers are rounded towards
5412 the nearest machine number or towards the even machine number in case
5413 of a tie.
5414
5415 @item m
5416 Round towards minus infinity.
5417
5418 @item c
5419 Chopped rounding mode.  Floating point numbers are rounded towards zero.
5420
5421 @item d
5422 Dynamic rounding mode.  A field in the floating point control register
5423 (@var{fpcr}, see Alpha architecture reference manual) controls the
5424 rounding mode in effect.  The C library initializes this register for
5425 rounding towards plus infinity.  Thus, unless your program modifies the
5426 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.@end table
5427
5428 @item -mtrap-precision=@var{trap precision}
5429 In the Alpha architecture, floating point traps are imprecise.  This
5430 means without software assistance it is impossible to recover from a
5431 floating trap and program execution normally needs to be terminated.
5432 GNU CC can generate code that can assist operating system trap handlers
5433 in determining the exact location that caused a floating point trap.
5434 Depending on the requirements of an application, different levels of
5435 precisions can be selected:
5436
5437 @table @samp
5438 @item p
5439 Program precision.  This option is the default and means a trap handler
5440 can only identify which program caused a floating point exception.
5441
5442 @item f
5443 Function precision.  The trap handler can determine the function that
5444 caused a floating point exception.
5445
5446 @item i
5447 Instruction precision.  The trap handler can determine the exact
5448 instruction that caused a floating point exception.
5449 @end table
5450
5451 Other Alpha compilers provide the equivalent options called
5452 @samp{-scope_safe} and @samp{-resumption_safe}.
5453
5454 @item -mieee-conformant
5455 This option marks the generated code as IEEE conformant.  You must not
5456 use this option unless you also specify @samp{-mtrap-precision=i} and either
5457 @samp{-mfp-trap-mode=su} or @samp{-mfp-trap-mode=sui}.  Its only effect
5458 is to emit the line @samp{.eflag 48} in the function prologue of the
5459 generated assembly file.  Under DEC Unix, this has the effect that
5460 IEEE-conformant math library routines will be linked in.
5461
5462 @item -mbuild-constants
5463 Normally GNU CC examines a 32- or 64-bit integer constant to
5464 see if it can construct it from smaller constants in two or three
5465 instructions.  If it cannot, it will output the constant as a literal and
5466 generate code to load it from the data segment at runtime.
5467
5468 Use this option to require GNU CC to construct @emph{all} integer constants
5469 using code, even if it takes more instructions (the maximum is six).
5470
5471 You would typically use this option to build a shared library dynamic
5472 loader.  Itself a shared library, it must relocate itself in memory
5473 before it can find the variables and constants in its own data segment.
5474
5475 @item -malpha-as
5476 @itemx -mgas
5477 Select whether to generate code to be assembled by the vendor-supplied
5478 assembler (@samp{-malpha-as}) or by the GNU assembler @samp{-mgas}.
5479
5480 @item -mbwx
5481 @itemx -mno-bwx
5482 @itemx -mcix
5483 @itemx -mno-cix
5484 @itemx -mmax
5485 @itemx -mno-max
5486 Indicate whether GNU CC should generate code to use the optional BWX,
5487 CIX, and MAX instruction sets.  The default is to use the instruction sets
5488 supported by the CPU type specified via @samp{-mcpu=} option or that
5489 of the CPU on which GNU CC was built if none was specified.
5490
5491 @item -mcpu=@var{cpu_type}
5492 Set the instruction set, register set, and instruction scheduling
5493 parameters for machine type @var{cpu_type}.  You can specify either the
5494 @samp{EV} style name or the corresponding chip number.  GNU CC
5495 supports scheduling parameters for the EV4 and EV5 family of processors
5496 and will choose the default values for the instruction set from
5497 the processor you specify.  If you do not specify a processor type,
5498 GNU CC will default to the processor on which the compiler was built.
5499
5500 Supported values for @var{cpu_type} are
5501
5502 @table @samp
5503 @item ev4
5504 @itemx 21064
5505 Schedules as an EV4 and has no instruction set extensions.
5506
5507 @item ev5
5508 @itemx 21164
5509 Schedules as an EV5 and has no instruction set extensions.
5510
5511 @item ev56
5512 @itemx 21164a
5513 Schedules as an EV5 and supports the BWX extension.
5514
5515 @item pca56
5516 @itemx 21164pc
5517 @itemx 21164PC
5518 Schedules as an EV5 and supports the BWX and MAX extensions.
5519
5520 @item ev6
5521 @itemx 21264
5522 Schedules as an EV5 (until Digital releases the scheduling parameters
5523 for the EV6) and supports the BWX, CIX, and MAX extensions.
5524 @end table
5525
5526 @item -mmemory-latency=@var{time}
5527 Sets the latency the scheduler should assume for typical memory
5528 references as seen by the application.  This number is highly
5529 dependant on the memory access patterns used by the application
5530 and the size of the external cache on the machine.
5531
5532 Valid options for @var{time} are
5533
5534 @table @samp
5535 @item @var{number}
5536 A decimal number representing clock cycles.
5537
5538 @item L1
5539 @itemx L2
5540 @itemx L3
5541 @itemx main
5542 The compiler contains estimates of the number of clock cycles for
5543 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
5544 (also called Dcache, Scache, and Bcache), as well as to main memory.
5545 Note that L3 is only valid for EV5.
5546
5547 @end table
5548 @end table
5549
5550 @node Clipper Options
5551 @subsection Clipper Options
5552
5553 These @samp{-m} options are defined for the Clipper implementations:
5554
5555 @table @code
5556 @item -mc300
5557 Produce code for a C300 Clipper processor. This is the default.
5558
5559 @itemx -mc400
5560 Produce code for a C400 Clipper processor i.e. use floating point
5561 registers f8..f15.
5562 @end table
5563
5564 @node H8/300 Options
5565 @subsection H8/300 Options
5566
5567 These @samp{-m} options are defined for the H8/300 implementations:
5568
5569 @table @code
5570 @item -mrelax
5571 Shorten some address references at link time, when possible; uses the
5572 linker option @samp{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
5573 ld.info, Using ld}, for a fuller description.
5574
5575 @item -mh
5576 Generate code for the H8/300H.
5577
5578 @item -ms
5579 Generate code for the H8/S.
5580
5581 @item -mint32
5582 Make @code{int} data 32 bits by default.
5583
5584 @item -malign-300
5585 On the h8/300h, use the same alignment rules as for the h8/300.
5586 The default for the h8/300h is to align longs and floats on 4 byte boundaries.
5587 @samp{-malign-300} causes them to be aligned on 2 byte boundaries.
5588 This option has no effect on the h8/300.
5589 @end table
5590
5591 @node SH Options
5592 @subsection SH Options
5593
5594 These @samp{-m} options are defined for the SH implementations:
5595
5596 @table @code
5597 @item -m1
5598 Generate code for the SH1.
5599
5600 @item -m2
5601 Generate code for the SH2.
5602
5603 @item -m3
5604 Generate code for the SH3.
5605
5606 @item -m3e
5607 Generate code for the SH3e.
5608
5609 @item -mb
5610 Compile code for the processor in big endian mode.
5611
5612 @item -ml
5613 Compile code for the processor in little endian mode.
5614
5615 @item -mdalign
5616 Align doubles at 64 bit boundaries.  Note that this changes the calling
5617 conventions, and thus some functions from the standard C library will
5618 not work unless you recompile it first with -mdalign.
5619
5620 @item -mrelax
5621 Shorten some address references at link time, when possible; uses the
5622 linker option @samp{-relax}.
5623 @end table
5624
5625 @node System V Options
5626 @subsection Options for System V
5627
5628 These additional options are available on System V Release 4 for
5629 compatibility with other compilers on those systems:
5630
5631 @table @code
5632 @item -G
5633 Create a shared object.
5634 It is recommended that @samp{-symbolic} or @samp{-shared} be used instead.
5635
5636 @item -Qy
5637 Identify the versions of each tool used by the compiler, in a
5638 @code{.ident} assembler directive in the output.
5639
5640 @item -Qn
5641 Refrain from adding @code{.ident} directives to the output file (this is
5642 the default).
5643
5644 @item -YP,@var{dirs}
5645 Search the directories @var{dirs}, and no others, for libraries
5646 specified with @samp{-l}.
5647
5648 @item -Ym,@var{dir}
5649 Look in the directory @var{dir} to find the M4 preprocessor.
5650 The assembler uses this option.
5651 @c This is supposed to go with a -Yd for predefined M4 macro files, but
5652 @c the generic assembler that comes with Solaris takes just -Ym.
5653 @end table
5654
5655 @node V850 Options
5656 @subsection V850 Options
5657 @cindex V850 Options
5658
5659 These @samp{-m} options are defined for V850 implementations:
5660
5661 @table @code
5662 @item -mlong-calls
5663 @itemx -mno-long-calls
5664 Treat all calls as being far away (near).  If calls are assumed to be
5665 far away, the compiler will always load the functions address up into a
5666 register, and call indirect through the pointer.
5667
5668 @item -mno-ep
5669 @itemx -mep
5670 Do not optimize (do optimize) basic blocks that use the same index
5671 pointer 4 or more times to copy pointer into the @code{ep} register, and
5672 use the shorter @code{sld} and @code{sst} instructions.  The @samp{-mep}
5673 option is on by default if you optimize.
5674
5675 @item -mno-prolog-function
5676 @itemx -mprolog-function
5677 Do not use (do use) external functions to save and restore registers at
5678 the prolog and epilog of a function.  The external functions are slower,
5679 but use less code space if more than one function saves the same number
5680 of registers.  The @samp{-mprolog-function} option is on by default if
5681 you optimize.
5682
5683 @item -mspace
5684 Try to make the code as small as possible.  At present, this just turns
5685 on the @samp{-mep} and @samp{-mprolog-function} options.
5686
5687 @item -mtda=@var{n}
5688 Put static or global variables whose size is @var{n} bytes or less into
5689 the tiny data area that register @code{ep} points to.  The tiny data
5690 area can hold up to 256 bytes in total (128 bytes for byte references).
5691
5692 @item -msda=@var{n}
5693 Put static or global variables whose size is @var{n} bytes or less into
5694 the small data area that register @code{gp} points to.  The small data
5695 area can hold up to 64 kilobytes.
5696
5697 @item -mzda=@var{n}
5698 Put static or global variables whose size is @var{n} bytes or less into
5699 the first 32 kilobytes of memory.
5700  
5701 @item -mv850
5702 Specify that the target processor is the V850.
5703
5704 @item -mbig-switch
5705 Generate code suitable for big switch tables.  Use this option only if
5706 the assembler/linker complain about out of range branches within a switch
5707 table.
5708 @end table
5709
5710 @node ARC Options
5711 @subsection ARC Options
5712 @cindex ARC Options
5713
5714 These options are defined for ARC implementations:
5715
5716 @table @code
5717 @item -EL
5718 Compile code for little endian mode.  This is the default.
5719
5720 @item -EB
5721 Compile code for big endian mode.
5722
5723 @item -mmangle-cpu
5724 Prepend the name of the cpu to all public symbol names.
5725 In multiple-processor systems, there are many ARC variants with different
5726 instruction and register set characteristics.  This flag prevents code
5727 compiled for one cpu to be linked with code compiled for another.
5728 No facility exists for handling variants that are "almost identical".
5729 This is an all or nothing option.
5730
5731 @item -mcpu=@var{cpu}
5732 Compile code for ARC variant @var{cpu}.
5733 Which variants are supported depend on the configuration.
5734 All variants support @samp{-mcpu=base}, this is the default.
5735
5736 @item -mtext=@var{text section}
5737 @item -mdata=@var{data section}
5738 @item -mrodata=@var{readonly data section}
5739 Put functions, data, and readonly data in @var{text section},
5740 @var{data section}, and @var{readonly data section} respectively
5741 by default.  This can be overridden with the @code{section} attribute.
5742 @xref{Variable Attributes}.
5743
5744 @end table
5745
5746 @node NS32K Options
5747 @subsection NS32K Options
5748 @cindex NS32K options
5749
5750 These are the @samp{-m} options defined for the 32000 series.  The default
5751 values for these options depends on which style of 32000 was selected when
5752 the compiler was configured; the defaults for the most common choices are
5753 given below.
5754
5755 @table @code
5756 @item -m32032
5757 @itemx -m32032
5758 Generate output for a 32032.  This is the default
5759 when the compiler is configured for 32032 and 32016 based systems.
5760
5761 @item -m32332
5762 @itemx -m32332
5763 Generate output for a 32332.  This is the default
5764 when the compiler is configured for 32332-based systems.
5765
5766 @item -m32532
5767 @itemx -m32532
5768 Generate output for a 32532.  This is the default
5769 when the compiler is configured for 32532-based systems.
5770
5771 @item -m32081
5772 Generate output containing 32081 instructions for floating point.
5773 This is the default for all systems.
5774
5775 @item -m32381
5776 Generate output containing 32381 instructions for floating point.  This
5777 also implies @samp{-m32081}. The 32381 is only compatible with the 32332
5778 and 32532 cpus. This is the default for the pc532-netbsd configuration.
5779
5780 @item -mmulti-add
5781 Try and generate multiply-add floating point instructions @code{polyF}
5782 and @code{dotF}. This option is only available if the @samp{-m32381}
5783 option is in effect. Using these instructions requires changes to to
5784 register allocation which generally has a negative impact on
5785 performance.  This option should only be enabled when compiling code
5786 particularly likely to make heavy use of multiply-add instructions.
5787
5788 @item -mnomulti-add
5789 Do not try and generate multiply-add floating point instructions
5790 @code{polyF} and @code{dotF}. This is the default on all platforms.
5791
5792 @item -msoft-float
5793 Generate output containing library calls for floating point.
5794 @strong{Warning:} the requisite libraries may not be available.
5795
5796 @item -mnobitfield
5797 Do not use the bit-field instructions. On some machines it is faster to
5798 use shifting and masking operations. This is the default for the pc532.
5799
5800 @item -mbitfield
5801 Do use the bit-field instructions. This is the default for all platforms
5802 except the pc532.
5803
5804 @item -mrtd
5805 Use a different function-calling convention, in which functions
5806 that take a fixed number of arguments return pop their
5807 arguments on return with the @code{ret} instruction.
5808
5809 This calling convention is incompatible with the one normally
5810 used on Unix, so you cannot use it if you need to call libraries
5811 compiled with the Unix compiler.
5812
5813 Also, you must provide function prototypes for all functions that
5814 take variable numbers of arguments (including @code{printf});
5815 otherwise incorrect code will be generated for calls to those
5816 functions.
5817
5818 In addition, seriously incorrect code will result if you call a
5819 function with too many arguments.  (Normally, extra arguments are
5820 harmlessly ignored.)
5821
5822 This option takes its name from the 680x0 @code{rtd} instruction.
5823
5824
5825 @item -mregparam
5826 Use a different function-calling convention where the first two arguments
5827 are passed in registers.
5828
5829 This calling convention is incompatible with the one normally
5830 used on Unix, so you cannot use it if you need to call libraries
5831 compiled with the Unix compiler.
5832
5833 @item -mnoregparam
5834 Do not pass any arguments in registers. This is the default for all
5835 targets.
5836
5837 @item -msb
5838 It is OK to use the sb as an index register which is always loaded with
5839 zero. This is the default for the pc532-netbsd target.
5840
5841 @item -mnosb
5842 The sb register is not available for use or has not been initialized to
5843 zero by the run time system. This is the default for all targets except
5844 the pc532-netbsd. It is also implied whenever @samp{-mhimem} or
5845 @samp{-fpic} is set.
5846
5847 @item -mhimem
5848 Many ns32000 series addressing modes use displacements of up to 512MB.
5849 If an address is above 512MB then displacements from zero can not be used.
5850 This option causes code to be generated which can be loaded above 512MB.
5851 This may be useful for operating systems or ROM code.
5852
5853 @item -mnohimem
5854 Assume code will be loaded in the first 512MB of virtual address space.
5855 This is the default for all platforms.
5856
5857
5858 @end table
5859
5860
5861
5862 @node Code Gen Options
5863 @section Options for Code Generation Conventions
5864 @cindex code generation conventions
5865 @cindex options, code generation
5866 @cindex run-time options
5867
5868 These machine-independent options control the interface conventions
5869 used in code generation.
5870
5871 Most of them have both positive and negative forms; the negative form
5872 of @samp{-ffoo} would be @samp{-fno-foo}.  In the table below, only
5873 one of the forms is listed---the one which is not the default.  You
5874 can figure out the other form by either removing @samp{no-} or adding
5875 it.
5876
5877 @table @code
5878 @item -fexceptions
5879 Enable exception handling. Generates extra code needed to propagate
5880 exceptions.  For some targets, this implies generation of frame unwind 
5881 information for all functions. This can produce significant data size 
5882 overhead, although it does not affect execution.
5883 If you do not specify this option, it is enabled by
5884 default for languages like C++ which normally require exception handling,
5885 and disabled for languages like C that do not normally require it.
5886 However, when compiling C code that needs to interoperate properly with
5887 exception handlers written in C++, you may need to enable this option.
5888 You may also wish to disable this option is you are compiling older C++
5889 programs that don't use exception handling.
5890
5891 @item -fpcc-struct-return
5892 Return ``short'' @code{struct} and @code{union} values in memory like
5893 longer ones, rather than in registers.  This convention is less
5894 efficient, but it has the advantage of allowing intercallability between
5895 GNU CC-compiled files and files compiled with other compilers.
5896
5897 The precise convention for returning structures in memory depends
5898 on the target configuration macros.
5899
5900 Short structures and unions are those whose size and alignment match
5901 that of some integer type.
5902
5903 @item -freg-struct-return
5904 Use the convention that @code{struct} and @code{union} values are
5905 returned in registers when possible.  This is more efficient for small
5906 structures than @samp{-fpcc-struct-return}.
5907
5908 If you specify neither @samp{-fpcc-struct-return} nor its contrary
5909 @samp{-freg-struct-return}, GNU CC defaults to whichever convention is
5910 standard for the target.  If there is no standard convention, GNU CC
5911 defaults to @samp{-fpcc-struct-return}, except on targets where GNU CC
5912 is the principal compiler.  In those cases, we can choose the standard,
5913 and we chose the more efficient register return alternative.
5914
5915 @item -fshort-enums
5916 Allocate to an @code{enum} type only as many bytes as it needs for the
5917 declared range of possible values.  Specifically, the @code{enum} type
5918 will be equivalent to the smallest integer type which has enough room.
5919
5920 @item -fshort-double
5921 Use the same size for @code{double} as for @code{float}.
5922
5923 @item -fshared-data
5924 Requests that the data and non-@code{const} variables of this
5925 compilation be shared data rather than private data.  The distinction
5926 makes sense only on certain operating systems, where shared data is
5927 shared between processes running the same program, while private data
5928 exists in one copy per process.
5929
5930 @item -fno-common
5931 Allocate even uninitialized global variables in the bss section of the
5932 object file, rather than generating them as common blocks.  This has the
5933 effect that if the same variable is declared (without @code{extern}) in
5934 two different compilations, you will get an error when you link them.
5935 The only reason this might be useful is if you wish to verify that the
5936 program will work on other systems which always work this way.
5937
5938 @item -fno-ident
5939 Ignore the @samp{#ident} directive.
5940
5941 @item -fno-gnu-linker
5942 Do not output global initializations (such as C++ constructors and
5943 destructors) in the form used by the GNU linker (on systems where the GNU
5944 linker is the standard method of handling them).  Use this option when
5945 you want to use a non-GNU linker, which also requires using the
5946 @code{collect2} program to make sure the system linker includes
5947 constructors and destructors.  (@code{collect2} is included in the GNU CC
5948 distribution.)  For systems which @emph{must} use @code{collect2}, the
5949 compiler driver @code{gcc} is configured to do this automatically.
5950
5951 @item -finhibit-size-directive
5952 Don't output a @code{.size} assembler directive, or anything else that
5953 would cause trouble if the function is split in the middle, and the
5954 two halves are placed at locations far apart in memory.  This option is
5955 used when compiling @file{crtstuff.c}; you should not need to use it
5956 for anything else.
5957
5958 @item -fverbose-asm
5959 Put extra commentary information in the generated assembly code to
5960 make it more readable.  This option is generally only of use to those
5961 who actually need to read the generated assembly code (perhaps while
5962 debugging the compiler itself).
5963
5964 @samp{-fno-verbose-asm}, the default, causes the
5965 extra information to be omitted and is useful when comparing two assembler
5966 files.
5967
5968 @item -fvolatile
5969 Consider all memory references through pointers to be volatile.
5970
5971 @item -fvolatile-global
5972 Consider all memory references to extern and global data items to
5973 be volatile.  GNU CC does not consider static data items to be volatile
5974 because of this switch.
5975
5976 @item -fvolatile-static
5977 Consider all memory references to static data to be volatile.
5978
5979 @item -fpic
5980 @cindex global offset table
5981 @cindex PIC
5982 Generate position-independent code (PIC) suitable for use in a shared
5983 library, if supported for the target machine.  Such code accesses all
5984 constant addresses through a global offset table (GOT).  The dynamic
5985 loader resolves the GOT entries when the program starts (the dynamic
5986 loader is not part of GNU CC; it is part of the operating system).  If
5987 the GOT size for the linked executable exceeds a machine-specific
5988 maximum size, you get an error message from the linker indicating that
5989 @samp{-fpic} does not work; in that case, recompile with @samp{-fPIC}
5990 instead.  (These maximums are 16k on the m88k, 8k on the Sparc, and 32k
5991 on the m68k and RS/6000.  The 386 has no such limit.)
5992
5993 Position-independent code requires special support, and therefore works
5994 only on certain machines.  For the 386, GNU CC supports PIC for System V
5995 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
5996 position-independent.
5997
5998 @item -fPIC
5999 If supported for the target machine, emit position-independent code,
6000 suitable for dynamic linking and avoiding any limit on the size of the
6001 global offset table.  This option makes a difference on the m68k, m88k,
6002 and the Sparc.
6003
6004 Position-independent code requires special support, and therefore works
6005 only on certain machines.
6006
6007 @item -ffixed-@var{reg}
6008 Treat the register named @var{reg} as a fixed register; generated code
6009 should never refer to it (except perhaps as a stack pointer, frame
6010 pointer or in some other fixed role).
6011
6012 @var{reg} must be the name of a register.  The register names accepted
6013 are machine-specific and are defined in the @code{REGISTER_NAMES}
6014 macro in the machine description macro file.
6015
6016 This flag does not have a negative form, because it specifies a
6017 three-way choice.
6018
6019 @item -fcall-used-@var{reg}
6020 Treat the register named @var{reg} as an allocable register that is
6021 clobbered by function calls.  It may be allocated for temporaries or
6022 variables that do not live across a call.  Functions compiled this way
6023 will not save and restore the register @var{reg}.
6024
6025 It is an error to used this flag with the frame pointer or stack pointer.
6026 Use of this flag for other registers that have fixed pervasive roles in
6027 the machine's execution model will produce disastrous results.
6028
6029 This flag does not have a negative form, because it specifies a
6030 three-way choice.
6031
6032 @item -fcall-saved-@var{reg}
6033 Treat the register named @var{reg} as an allocable register saved by
6034 functions.  It may be allocated even for temporaries or variables that
6035 live across a call.  Functions compiled this way will save and restore
6036 the register @var{reg} if they use it.
6037
6038 It is an error to used this flag with the frame pointer or stack pointer.
6039 Use of this flag for other registers that have fixed pervasive roles in
6040 the machine's execution model will produce disastrous results.
6041
6042 A different sort of disaster will result from the use of this flag for
6043 a register in which function values may be returned.
6044
6045 This flag does not have a negative form, because it specifies a
6046 three-way choice.
6047
6048 @item -fpack-struct
6049 Pack all structure members together without holes.  Usually you would
6050 not want to use this option, since it makes the code suboptimal, and
6051 the offsets of structure members won't agree with system libraries.
6052
6053 @item -fcheck-memory-usage
6054 Generate extra code to check each memory access.  GNU CC will generate
6055 code that is suitable for a detector of bad memory accesses such as
6056 @file{Checker}.
6057
6058 You must also specify this option when you compile functions you call that
6059 have side effects.  If you do not, you may get erroneous messages from
6060 the detector.  Normally,  you should compile all your code with this option.
6061 If you use functions from a library that have side-effects (such as
6062 @code{read}), you may not be able to recompile the library and
6063 specify this option.  In that case, you can enable the
6064 @samp{-fprefix-function-name} option, which requests GNU CC to encapsulate
6065 your code and make other functions look as if they were compiled with
6066 @samp{-fcheck-memory-usage}.  This is done by calling ``stubs'',
6067 which are provided by the detector.  If you cannot find or build
6068 stubs for every function you call, you may have to specify
6069 @samp{-fcheck-memory-usage} without @samp{-fprefix-function-name}.
6070
6071 If you specify this option, you can not use the @code{asm} or
6072 @code{__asm__} keywords in functions with memory checking enabled.  The
6073 compiler cannot understand what the @code{asm} statement will do, and
6074 therefore cannot generate the appropriate code, so it is rejected.
6075 However, the function attribute @code{no_check_memory_usage} will
6076 disable memory checking within a function, and @code{asm} statements can
6077 be put inside such functions.  Inline expansion of a non-checked
6078 function within a checked function is permitted; the inline function's
6079 memory accesses won't be checked, but the rest will.
6080
6081 If you move your @code{asm} statements to non-checked inline functions,
6082 but they do access memory, you can add calls to the support code in your
6083 inline function, to indicate any reads, writes, or copies being done.
6084 These calls would be similar to those done in the stubs described above.
6085
6086 @c FIXME: The support-routine interface is defined by the compiler and
6087 @c        should be documented!
6088
6089 @item -fprefix-function-name
6090 Request GNU CC to add a prefix to the symbols generated for function names.
6091 GNU CC adds a prefix to the names of functions defined as well as
6092 functions called.  Code compiled with this option and code compiled
6093 without the option can't be linked together, unless or stubs are used.
6094
6095 If you compile the following code with @samp{-fprefix-function-name}
6096 @example
6097 extern void bar (int);
6098 void
6099 foo (int a)
6100 @{
6101   return bar (a + 5);
6102
6103 @}
6104 @end example
6105
6106 @noindent
6107 GNU CC will compile the code as if it was written:
6108 @example
6109 extern void prefix_bar (int);
6110 void
6111 prefix_foo (int a)
6112 @{
6113   return prefix_bar (a + 5);
6114 @}
6115 @end example
6116 This option is designed to be used with @samp{-fcheck-memory-usage}.
6117
6118 @item -finstrument-functions
6119 Generate instrumentation calls for entry and exit to functions.  Just
6120 after function entry and just before function exit, the following
6121 profiling functions will be called with the address of the current
6122 function and its call site.  (On some platforms,
6123 @code{__builtin_return_address} does not work beyond the current
6124 function, so the call site information may not be available to the
6125 profiling functions otherwise.)
6126
6127 @example
6128 void __cyg_profile_func_enter (void *this_fn, void *call_site);
6129 void __cyg_profile_func_exit  (void *this_fn, void *call_site);
6130 @end example
6131
6132 The first argument is the address of the start of the current function,
6133 which may be looked up exactly in the symbol table.
6134
6135 This instrumentation is also done for functions expanded inline in other
6136 functions.  The profiling calls will indicate where, conceptually, the
6137 inline function is entered and exited.  This means that addressable
6138 versions of such functions must be available.  If all your uses of a
6139 function are expanded inline, this may mean an additional expansion of
6140 code size.  If you use @samp{extern inline} in your C code, an
6141 addressable version of such functions must be provided.  (This is
6142 normally the case anyways, but if you get lucky and the optimizer always
6143 expands the functions inline, you might have gotten away without
6144 providing static copies.)
6145
6146 A function may be given the attribute @code{no_instrument_function}, in
6147 which case this instrumentation will not be done.  This can be used, for
6148 example, for the profiling functions listed above, high-priority
6149 interrupt routines, and any functions from which the profiling functions
6150 cannot safely be called (perhaps signal handlers, if the profiling
6151 routines generate output or allocate memory).
6152
6153 @item -fstack-check
6154 Generate code to verify that you do not go beyond the boundary of the
6155 stack.  You should specify this flag if you are running in an
6156 environment with multiple threads, but only rarely need to specify it in
6157 a single-threaded environment since stack overflow is automatically
6158 detected on nearly all systems if there is only one stack.
6159
6160 @cindex aliasing of parameters
6161 @cindex parameters, aliased
6162 @item -fargument-alias
6163 @itemx -fargument-noalias
6164 @itemx -fargument-noalias-global
6165 Specify the possible relationships among parameters and between
6166 parameters and global data.
6167
6168 @samp{-fargument-alias} specifies that arguments (parameters) may
6169 alias each other and may alias global storage.
6170 @samp{-fargument-noalias} specifies that arguments do not alias
6171 each other, but may alias global storage.
6172 @samp{-fargument-noalias-global} specifies that arguments do not
6173 alias each other and do not alias global storage.
6174
6175 Each language will automatically use whatever option is required by
6176 the language standard.  You should not need to use these options yourself.
6177
6178 @item -fleading-underscore
6179 This option and its counterpart, -fno-leading-underscore, forcibly
6180 change the way C symbols are represented in the object file.  One use
6181 is to help link with legacy assembly code.
6182
6183 Be warned that you should know what you are doing when invoking this
6184 option, and that not all targets provide complete support for it.
6185 @end table
6186
6187 @node Environment Variables
6188 @section Environment Variables Affecting GNU CC
6189 @cindex environment variables
6190
6191 This section describes several environment variables that affect how GNU
6192 CC operates.  Some of them work by specifying directories or prefixes to use
6193 when searching for various kinds of files. Some are used to specify other
6194 aspects of the compilation environment.
6195
6196 @ifclear INTERNALS
6197 Note that you can also specify places to search using options such as
6198 @samp{-B}, @samp{-I} and @samp{-L} (@pxref{Directory Options}).  These
6199 take precedence over places specified using environment variables, which
6200 in turn take precedence over those specified by the configuration of GNU
6201 CC.
6202 @end ifclear
6203 @ifset INTERNALS
6204 Note that you can also specify places to search using options such as
6205 @samp{-B}, @samp{-I} and @samp{-L} (@pxref{Directory Options}).  These
6206 take precedence over places specified using environment variables, which
6207 in turn take precedence over those specified by the configuration of GNU
6208 CC.  @xref{Driver}.
6209 @end ifset
6210
6211 @table @code
6212 @item LANG
6213 @itemx LC_CTYPE
6214 @c @itemx LC_COLLATE
6215 @itemx LC_MESSAGES
6216 @c @itemx LC_MONETARY
6217 @c @itemx LC_NUMERIC
6218 @c @itemx LC_TIME
6219 @itemx LC_ALL
6220 @findex LANG
6221 @findex LC_CTYPE
6222 @c @findex LC_COLLATE
6223 @findex LC_MESSAGES
6224 @c @findex LC_MONETARY
6225 @c @findex LC_NUMERIC
6226 @c @findex LC_TIME
6227 @findex LC_ALL
6228 @cindex locale
6229 These environment variables control the way that GNU CC uses
6230 localization information that allow GNU CC to work with different
6231 national conventions.  GNU CC inspects the locale categories
6232 @code{LC_CTYPE} and @code{LC_MESSAGES} if it has been configured to do
6233 so.  These locale categories can be set to any value supported by your
6234 installation.  A typical value is @samp{en_UK} for English in the United
6235 Kingdom.
6236
6237 The @code{LC_CTYPE} environment variable specifies character
6238 classification.  GNU CC uses it to determine the character boundaries in
6239 a string; this is needed for some multibyte encodings that contain quote
6240 and escape characters that would otherwise be interpreted as a string
6241 end or escape.
6242
6243 The @code{LC_MESSAGES} environment variable specifies the language to
6244 use in diagnostic messages.
6245
6246 If the @code{LC_ALL} environment variable is set, it overrides the value
6247 of @code{LC_CTYPE} and @code{LC_MESSAGES}; otherwise, @code{LC_CTYPE}
6248 and @code{LC_MESSAGES} default to the value of the @code{LANG}
6249 environment variable.  If none of these variables are set, GNU CC
6250 defaults to traditional C English behavior.
6251
6252 @item TMPDIR
6253 @findex TMPDIR
6254 If @code{TMPDIR} is set, it specifies the directory to use for temporary
6255 files.  GNU CC uses temporary files to hold the output of one stage of
6256 compilation which is to be used as input to the next stage: for example,
6257 the output of the preprocessor, which is the input to the compiler
6258 proper.
6259
6260 @item GCC_EXEC_PREFIX
6261 @findex GCC_EXEC_PREFIX
6262 If @code{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
6263 names of the subprograms executed by the compiler.  No slash is added
6264 when this prefix is combined with the name of a subprogram, but you can
6265 specify a prefix that ends with a slash if you wish.
6266
6267 If GNU CC cannot find the subprogram using the specified prefix, it
6268 tries looking in the usual places for the subprogram.
6269
6270 The default value of @code{GCC_EXEC_PREFIX} is
6271 @file{@var{prefix}/lib/gcc-lib/} where @var{prefix} is the value
6272 of @code{prefix} when you ran the @file{configure} script.
6273
6274 Other prefixes specified with @samp{-B} take precedence over this prefix.
6275
6276 This prefix is also used for finding files such as @file{crt0.o} that are
6277 used for linking.
6278
6279 In addition, the prefix is used in an unusual way in finding the
6280 directories to search for header files.  For each of the standard
6281 directories whose name normally begins with @samp{/usr/local/lib/gcc-lib}
6282 (more precisely, with the value of @code{GCC_INCLUDE_DIR}), GNU CC tries
6283 replacing that beginning with the specified prefix to produce an
6284 alternate directory name.  Thus, with @samp{-Bfoo/}, GNU CC will search
6285 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
6286 These alternate directories are searched first; the standard directories
6287 come next.
6288
6289 @item COMPILER_PATH
6290 @findex COMPILER_PATH
6291 The value of @code{COMPILER_PATH} is a colon-separated list of
6292 directories, much like @code{PATH}.  GNU CC tries the directories thus
6293 specified when searching for subprograms, if it can't find the
6294 subprograms using @code{GCC_EXEC_PREFIX}.
6295
6296 @item LIBRARY_PATH
6297 @findex LIBRARY_PATH
6298 The value of @code{LIBRARY_PATH} is a colon-separated list of
6299 directories, much like @code{PATH}.  When configured as a native compiler,
6300 GNU CC tries the directories thus specified when searching for special
6301 linker files, if it can't find them using @code{GCC_EXEC_PREFIX}.  Linking
6302 using GNU CC also uses these directories when searching for ordinary
6303 libraries for the @samp{-l} option (but directories specified with
6304 @samp{-L} come first).
6305
6306 @item C_INCLUDE_PATH
6307 @itemx CPLUS_INCLUDE_PATH
6308 @itemx OBJC_INCLUDE_PATH
6309 @findex C_INCLUDE_PATH
6310 @findex CPLUS_INCLUDE_PATH
6311 @findex OBJC_INCLUDE_PATH
6312 @c @itemx OBJCPLUS_INCLUDE_PATH
6313 These environment variables pertain to particular languages.  Each
6314 variable's value is a colon-separated list of directories, much like
6315 @code{PATH}.  When GNU CC searches for header files, it tries the
6316 directories listed in the variable for the language you are using, after
6317 the directories specified with @samp{-I} but before the standard header
6318 file directories.
6319
6320 @item DEPENDENCIES_OUTPUT
6321 @findex DEPENDENCIES_OUTPUT
6322 @cindex dependencies for make as output
6323 If this variable is set, its value specifies how to output dependencies
6324 for Make based on the header files processed by the compiler.  This
6325 output looks much like the output from the @samp{-M} option
6326 (@pxref{Preprocessor Options}), but it goes to a separate file, and is
6327 in addition to the usual results of compilation.
6328
6329 The value of @code{DEPENDENCIES_OUTPUT} can be just a file name, in
6330 which case the Make rules are written to that file, guessing the target
6331 name from the source file name.  Or the value can have the form
6332 @samp{@var{file} @var{target}}, in which case the rules are written to
6333 file @var{file} using @var{target} as the target name.
6334
6335 @item LANG
6336 @findex LANG
6337 @cindex locale definition
6338 This variable is used to pass locale information to the compiler. One way in
6339 which this information is used is to determine the character set to be used
6340 when character literals, string literals and comments are parsed in C and C++.
6341 When the compiler is configured to allow multibyte characters,
6342 the following values for @code{LANG} are recognized:
6343
6344 @table @code
6345 @item C-JIS
6346 Recognize JIS characters.
6347 @item C-SJIS
6348 Recognize SJIS characters.
6349 @item C-EUCJP
6350 Recognize EUCJP characters.
6351 @end table
6352
6353 If @code{LANG} is not defined, or if it has some other value, then the
6354 compiler will use mblen and mbtowc as defined by the default locale to
6355 recognize and translate multibyte characters.
6356 @end table
6357
6358 @node Running Protoize
6359 @section Running Protoize
6360
6361 The program @code{protoize} is an optional part of GNU C.  You can use
6362 it to add prototypes to a program, thus converting the program to ANSI
6363 C in one respect.  The companion program @code{unprotoize} does the
6364 reverse: it removes argument types from any prototypes that are found.
6365
6366 When you run these programs, you must specify a set of source files as
6367 command line arguments.  The conversion programs start out by compiling
6368 these files to see what functions they define.  The information gathered
6369 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
6370
6371 After scanning comes actual conversion.  The specified files are all
6372 eligible to be converted; any files they include (whether sources or
6373 just headers) are eligible as well.
6374
6375 But not all the eligible files are converted.  By default,
6376 @code{protoize} and @code{unprotoize} convert only source and header
6377 files in the current directory.  You can specify additional directories
6378 whose files should be converted with the @samp{-d @var{directory}}
6379 option.  You can also specify particular files to exclude with the
6380 @samp{-x @var{file}} option.  A file is converted if it is eligible, its
6381 directory name matches one of the specified directory names, and its
6382 name within the directory has not been excluded.
6383
6384 Basic conversion with @code{protoize} consists of rewriting most
6385 function definitions and function declarations to specify the types of
6386 the arguments.  The only ones not rewritten are those for varargs
6387 functions.
6388
6389 @code{protoize} optionally inserts prototype declarations at the
6390 beginning of the source file, to make them available for any calls that
6391 precede the function's definition.  Or it can insert prototype
6392 declarations with block scope in the blocks where undeclared functions
6393 are called.
6394
6395 Basic conversion with @code{unprotoize} consists of rewriting most
6396 function declarations to remove any argument types, and rewriting
6397 function definitions to the old-style pre-ANSI form.
6398
6399 Both conversion programs print a warning for any function declaration or
6400 definition that they can't convert.  You can suppress these warnings
6401 with @samp{-q}.
6402
6403 The output from @code{protoize} or @code{unprotoize} replaces the
6404 original source file.  The original file is renamed to a name ending
6405 with @samp{.save}.  If the @samp{.save} file already exists, then
6406 the source file is simply discarded.
6407
6408 @code{protoize} and @code{unprotoize} both depend on GNU CC itself to
6409 scan the program and collect information about the functions it uses.
6410 So neither of these programs will work until GNU CC is installed.
6411
6412 Here is a table of the options you can use with @code{protoize} and
6413 @code{unprotoize}.  Each option works with both programs unless
6414 otherwise stated.
6415
6416 @table @code
6417 @item -B @var{directory}
6418 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
6419 usual directory (normally @file{/usr/local/lib}).  This file contains
6420 prototype information about standard system functions.  This option
6421 applies only to @code{protoize}.
6422
6423 @item -c @var{compilation-options}
6424 Use  @var{compilation-options} as the options when running @code{gcc} to
6425 produce the @samp{.X} files.  The special option @samp{-aux-info} is
6426 always passed in addition, to tell @code{gcc} to write a @samp{.X} file.
6427
6428 Note that the compilation options must be given as a single argument to
6429 @code{protoize} or @code{unprotoize}.  If you want to specify several
6430 @code{gcc} options, you must quote the entire set of compilation options
6431 to make them a single word in the shell.
6432
6433 There are certain @code{gcc} arguments that you cannot use, because they
6434 would produce the wrong kind of output.  These include @samp{-g},
6435 @samp{-O}, @samp{-c}, @samp{-S}, and @samp{-o} If you include these in
6436 the @var{compilation-options}, they are ignored.
6437
6438 @item -C
6439 Rename files to end in @samp{.C} instead of @samp{.c}.
6440 This is convenient if you are converting a C program to C++.
6441 This option applies only to @code{protoize}.
6442
6443 @item -g
6444 Add explicit global declarations.  This means inserting explicit
6445 declarations at the beginning of each source file for each function
6446 that is called in the file and was not declared.  These declarations
6447 precede the first function definition that contains a call to an
6448 undeclared function.  This option applies only to @code{protoize}.
6449
6450 @item -i @var{string}
6451 Indent old-style parameter declarations with the string @var{string}.
6452 This option applies only to @code{protoize}.
6453
6454 @code{unprotoize} converts prototyped function definitions to old-style
6455 function definitions, where the arguments are declared between the
6456 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
6457 uses five spaces as the indentation.  If you want to indent with just
6458 one space instead, use @samp{-i " "}.
6459
6460 @item -k
6461 Keep the @samp{.X} files.  Normally, they are deleted after conversion
6462 is finished.
6463
6464 @item -l
6465 Add explicit local declarations.  @code{protoize} with @samp{-l} inserts
6466 a prototype declaration for each function in each block which calls the
6467 function without any declaration.  This option applies only to
6468 @code{protoize}.
6469
6470 @item -n
6471 Make no real changes.  This mode just prints information about the conversions
6472 that would have been done without @samp{-n}.
6473
6474 @item -N
6475 Make no @samp{.save} files.  The original files are simply deleted.
6476 Use this option with caution.
6477
6478 @item -p @var{program}
6479 Use the program @var{program} as the compiler.  Normally, the name
6480 @file{gcc} is used.
6481
6482 @item -q
6483 Work quietly.  Most warnings are suppressed.
6484
6485 @item -v
6486 Print the version number, just like @samp{-v} for @code{gcc}.
6487 @end table
6488
6489 If you need special compiler options to compile one of your program's
6490 source files, then you should generate that file's @samp{.X} file
6491 specially, by running @code{gcc} on that source file with the
6492 appropriate options and the option @samp{-aux-info}.  Then run
6493 @code{protoize} on the entire set of files.  @code{protoize} will use
6494 the existing @samp{.X} file because it is newer than the source file.
6495 For example:
6496
6497 @example
6498 gcc -Dfoo=bar file1.c -aux-info
6499 protoize *.c
6500 @end example
6501
6502 @noindent
6503 You need to include the special files along with the rest in the
6504 @code{protoize} command, even though their @samp{.X} files already
6505 exist, because otherwise they won't get converted.
6506
6507 @xref{Protoize Caveats}, for more information on how to use
6508 @code{protoize} successfully.
6509