OSDN Git Service

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