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