1 .\" Automatically generated by Pod::Man version 1.15
2 .\" Wed Apr 25 21:32:12 2001
5 .\" ======================================================================
6 .de Sh \" Subsection heading
14 .de Sp \" Vertical space (when we can't use .PP)
20 .ie \\n(.$>=3 .ne \\$3
24 .de Vb \" Begin verbatim text
29 .de Ve \" End verbatim text
34 .\" Set up some character translations and predefined strings. \*(-- will
35 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
36 .\" double quote, and \*(R" will give a right double quote. | will give a
37 .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used
38 .\" to do unbreakable dashes and therefore won't be available. \*(C` and
39 .\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
41 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
45 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
46 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
59 .\" If the F register is turned on, we'll generate index entries on stderr
60 .\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
61 .\" index entries marked with X<> in POD. Of course, you'll have to process
62 .\" the output yourself in some meaningful fashion.
65 . tm Index:\\$1\t\\n%\t"\\$2"
71 .\" For nroff, turn off justification. Always turn off hyphenation; it
72 .\" makes way too many mistakes in technical documents.
76 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
77 .\" Fear. Run. Save yourself. No user-serviceable parts.
79 . \" fudge factors for nroff and troff
88 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
94 . \" simple accents for nroff and troff
104 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
105 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
106 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
107 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
108 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
109 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
111 . \" troff and (daisy-wheel) nroff accents
112 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
113 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
114 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
115 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
116 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
117 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
118 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
119 .ds ae a\h'-(\w'a'u*4/10)'e
120 .ds Ae A\h'-(\w'A'u*4/10)'E
121 . \" corrections for vroff
122 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
123 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
124 . \" for low resolution devices (crt and lpr)
125 .if \n(.H>23 .if \n(.V>19 \
138 .\" ======================================================================
141 .TH GCC 1 "gcc-3.0" "2001-04-25" "GNU"
144 gcc \- \s-1GNU\s0 project C and \*(C+ compiler
146 .IX Header "SYNOPSIS"
147 gcc [\fB\-c\fR|\fB\-S\fR|\fB\-E\fR] [\fB\-std=\fR\fIstandard\fR]
148 [\fB\-g\fR] [\fB\-pg\fR] [\fB\-O\fR\fIlevel\fR]
149 [\fB\-W\fR\fIwarn\fR...] [\fB\-pedantic\fR]
150 [\fB\-I\fR\fIdir\fR...] [\fB\-L\fR\fIdir\fR...]
151 [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR]
152 [\fB\-f\fR\fIoption\fR...] [\fB\-m\fR\fImachine-option\fR...]
153 [\fB\-o\fR \fIoutfile\fR] \fIinfile\fR...
155 Only the most useful options are listed here; see below for the
156 remainder. \fBg++\fR accepts mostly the same options as \fBgcc\fR.
158 .IX Header "DESCRIPTION"
159 When you invoke \s-1GCC\s0, it normally does preprocessing, compilation,
160 assembly and linking. The ``overall options'' allow you to stop this
161 process at an intermediate stage. For example, the \fB\-c\fR option
162 says not to run the linker. Then the output consists of object files
163 output by the assembler.
165 Other options are passed on to one stage of processing. Some options
166 control the preprocessor and others the compiler itself. Yet other
167 options control the assembler and linker; most of these are not
168 documented here, since you rarely need to use any of them.
170 Most of the command line options that you can use with \s-1GCC\s0 are useful
171 for C programs; when an option is only useful with another language
172 (usually \*(C+), the explanation says so explicitly. If the description
173 for a particular option does not mention a source language, you can use
174 that option with all supported languages.
176 The \fBgcc\fR program accepts options and file names as operands. Many
177 options have multi-letter names; therefore multiple single-letter options
178 may \fInot\fR be grouped: \fB\-dr\fR is very different from \fB\-d\ \-r\fR.
180 You can mix options and other arguments. For the most part, the order
181 you use doesn't matter. Order does matter when you use several options
182 of the same kind; for example, if you specify \fB\-L\fR more than once,
183 the directories are searched in the order specified.
185 Many options have long names starting with \fB\-f\fR or with
186 \&\fB\-W\fR\-\-\-for example, \fB\-fforce-mem\fR,
187 \&\fB\-fstrength-reduce\fR, \fB\-Wformat\fR and so on. Most of
188 these have both positive and negative forms; the negative form of
189 \&\fB\-ffoo\fR would be \fB\-fno-foo\fR. This manual documents
190 only one of these two forms, whichever one is not the default.
194 .IX Subsection "Option Summary"
195 Here is a summary of all the options, grouped by type. Explanations are
196 in the following sections.
197 .Ip "\fIOverall Options\fR" 4
198 .IX Item "Overall Options"
199 \&\fB\-c \-S \-E \-o\fR \fIfile\fR \fB\-pipe \-pass-exit-codes \-x\fR \fIlanguage\fR
200 \&\fB\-v \-\-target-help \-\-help\fR
201 .Ip "\fIC Language Options\fR" 4
202 .IX Item "C Language Options"
203 \&\fB\-ansi \-std=\fR\fIstandard\fR \fB\-fno-asm \-fno-builtin
204 \&\-fhosted \-ffreestanding
205 \&\-trigraphs \-traditional \-traditional-cpp
206 \&\-fallow-single-precision \-fcond-mismatch
207 \&\-fsigned-bitfields \-fsigned-char
208 \&\-funsigned-bitfields \-funsigned-char
209 \&\-fwritable-strings \-fshort-wchar\fR
210 .Ip "\fI\*(C+ Language Options\fR" 4
211 .IX Item " Language Options"
212 \&\fB\-fno-access-control \-fcheck-new \-fconserve-space
213 \&\-fdollars-in-identifiers \-fno-elide-constructors
214 \&\-fno-enforce-eh-specs \-fexternal-templates
215 \&\-falt-external-templates
216 \&\-ffor-scope \-fno-for-scope \-fno-gnu-keywords \-fhonor-std
217 \&\-fhuge-objects \-fno-implicit-templates
218 \&\-fno-implicit-inline-templates
219 \&\-fno-implement-inlines \-fms-extensions
220 \&\-fno-operator-names
221 \&\-fno-optional-diags \-fpermissive
222 \&\-frepo \-fno-rtti \-ftemplate-depth-\fR\fIn\fR
223 \&\fB\-fuse-cxa-atexit \-fvtable-thunks \-nostdinc++
224 \&\-fno-default-inline \-Wctor-dtor-privacy
225 \&\-Wnon-virtual-dtor \-Wreorder
226 \&\-Weffc++ \-Wno-deprecated
227 \&\-Wno-non-template-friend \-Wold-style-cast
228 \&\-Woverloaded-virtual \-Wno-pmf-conversions
229 \&\-Wsign-promo \-Wsynth\fR
230 .Ip "\fILanguage Independent Options\fR" 4
231 .IX Item "Language Independent Options"
232 \&\fB\-fmessage-length=\fR\fIn\fR
233 \&\fB\-fdiagnostics-show-location=\fR[\fBonce\fR|\fBevery-line\fR]
234 .Ip "\fIWarning Options\fR" 4
235 .IX Item "Warning Options"
236 \&\fB\-fsyntax-only \-pedantic \-pedantic-errors
237 \&\-w \-W \-Wall \-Waggregate-return
238 \&\-Wcast-align \-Wcast-qual \-Wchar-subscripts \-Wcomment
239 \&\-Wconversion \-Wdisabled-optimization \-Werror
240 \&\-Wfloat-equal \-Wformat \-Wformat=2
241 \&\-Wformat-nonliteral \-Wformat-security
242 \&\-Wid-clash-\fR\fIlen\fR \fB\-Wimplicit \-Wimplicit-int
243 \&\-Wimplicit-function-declaration
244 \&\-Werror-implicit-function-declaration
245 \&\-Wimport \-Winline
246 \&\-Wlarger-than-\fR\fIlen\fR \fB\-Wlong-long
247 \&\-Wmain \-Wmissing-braces \-Wmissing-declarations
248 \&\-Wmissing-format-attribute \-Wmissing-noreturn
249 \&\-Wmultichar \-Wno-format-extra-args \-Wno-format-y2k
250 \&\-Wno-import \-Wpacked \-Wpadded
251 \&\-Wparentheses \-Wpointer-arith \-Wredundant-decls
252 \&\-Wreturn-type \-Wsequence-point \-Wshadow
253 \&\-Wsign-compare \-Wswitch \-Wsystem-headers
254 \&\-Wtrigraphs \-Wundef \-Wuninitialized
255 \&\-Wunknown-pragmas \-Wunreachable-code
256 \&\-Wunused \-Wunused-function \-Wunused-label \-Wunused-parameter
257 \&\-Wunused-value \-Wunused-variable \-Wwrite-strings\fR
258 .Ip "\fIC-only Warning Options\fR" 4
259 .IX Item "C-only Warning Options"
260 \&\fB\-Wbad-function-cast \-Wmissing-prototypes \-Wnested-externs
261 \&\-Wstrict-prototypes \-Wtraditional\fR
262 .Ip "\fIDebugging Options\fR" 4
263 .IX Item "Debugging Options"
264 \&\fB\-a \-ax \-d\fR\fIletters\fR \fB\-dumpspecs \-dumpmachine \-dumpversion
265 \&\-fdump-unnumbered \-fdump-translation-unit=\fR\fIfile\fR
266 \&\fB\-fdump-class-layout=\fR\fIfile\fR \fB\-fmem-report \-fpretend-float
267 \&\-fprofile-arcs \-ftest-coverage \-ftime-report
268 \&\-g \-g\fR\fIlevel\fR \fB\-gcoff \-gdwarf \-gdwarf-1 \-gdwarf-1+ \-gdwarf-2
269 \&\-ggdb \-gstabs \-gstabs+ \-gxcoff \-gxcoff+
270 \&\-p \-pg \-print-file-name=\fR\fIlibrary\fR \fB\-print-libgcc-file-name
271 \&\-print-prog-name=\fR\fIprogram\fR \fB\-print-search-dirs \-Q
272 \&\-save-temps \-time\fR
273 .Ip "\fIOptimization Options\fR" 4
274 .IX Item "Optimization Options"
275 \&\fB\-falign-functions=\fR\fIn\fR \fB\-falign-jumps=\fR\fIn\fR
276 \&\fB\-falign-labels=\fR\fIn\fR \fB\-falign-loops=\fR\fIn\fR
277 \&\fB\-fbranch-probabilities \-fcaller-saves
278 \&\-fcse-follow-jumps \-fcse-skip-blocks \-fdata-sections \-fdce
279 \&\-fdelayed-branch \-fdelete-null-pointer-checks
280 \&\-fexpensive-optimizations \-ffast-math \-ffloat-store
281 \&\-fforce-addr \-fforce-mem \-ffunction-sections \-fgcse
282 \&\-finline-functions \-finline-limit=\fR\fIn\fR \fB\-fkeep-inline-functions
283 \&\-fkeep-static-consts \-fmove-all-movables
284 \&\-fno-default-inline \-fno-defer-pop
285 \&\-fno-function-cse \-fno-guess-branch-probability
286 \&\-fno-inline \-fno-math-errno \-fno-peephole
287 \&\-fomit-frame-pointer \-foptimize-register-move
288 \&\-foptimize-sibling-calls \-freduce-all-givs
289 \&\-fregmove \-frename-registers
290 \&\-frerun-cse-after-loop \-frerun-loop-opt
291 \&\-fschedule-insns \-fschedule-insns2
292 \&\-fsingle-precision-constant \-fssa
293 \&\-fstrength-reduce \-fstrict-aliasing \-fthread-jumps \-ftrapv
294 \&\-funroll-all-loops \-funroll-loops
295 \&\-\-param\fR \fIname\fR\fB=\fR\fIvalue\fR
296 \&\fB\-O \-O0 \-O1 \-O2 \-O3 \-Os\fR
297 .Ip "\fIPreprocessor Options\fR" 4
298 .IX Item "Preprocessor Options"
299 \&\fB\-$ \-A\fR\fIquestion\fR\fB=\fR\fIanswer\fR \fB\-A-\fR\fIquestion\fR[\fB=\fR\fIanswer\fR]
300 \&\fB\-C \-dD \-dI \-dM \-dN
301 \&\-D\fR\fImacro\fR[\fB=\fR\fIdefn\fR] \fB\-E \-H
302 \&\-idirafter\fR \fIdir\fR
303 \&\fB\-include\fR \fIfile\fR \fB\-imacros\fR \fIfile\fR
304 \&\fB\-iprefix\fR \fIfile\fR \fB\-iwithprefix\fR \fIdir\fR
305 \&\fB\-iwithprefixbefore\fR \fIdir\fR \fB\-isystem\fR \fIdir\fR \fB\-isystem-c++\fR \fIdir\fR
306 \&\fB\-M \-MM \-MF \-MG \-MP \-MQ \-MT \-nostdinc \-P \-remap
307 \&\-trigraphs \-undef \-U\fR\fImacro\fR \fB\-Wp,\fR\fIoption\fR
308 .Ip "\fIAssembler Option\fR" 4
309 .IX Item "Assembler Option"
310 \&\fB\-Wa,\fR\fIoption\fR
311 .Ip "\fILinker Options\fR" 4
312 .IX Item "Linker Options"
314 \&\fR\fIobject-file-name\fR \fB\-l\fR\fIlibrary\fR
315 \&\fB\-nostartfiles \-nodefaultlibs \-nostdlib
316 \&\-s \-static \-static-libgcc \-shared \-shared-libgcc \-symbolic
317 \&\-Wl,\fR\fIoption\fR \fB\-Xlinker\fR \fIoption\fR
318 \&\fB\-u\fR \fIsymbol\fR
319 .Ip "\fIDirectory Options\fR" 4
320 .IX Item "Directory Options"
321 \&\fB\-B\fR\fIprefix\fR \fB\-I\fR\fIdir\fR \fB\-I- \-L\fR\fIdir\fR \fB\-specs=\fR\fIfile\fR
322 .Ip "\fITarget Options\fR" 4
323 .IX Item "Target Options"
324 \&\fB\-b\fR \fImachine\fR \fB\-V\fR \fIversion\fR
325 .Ip "\fIMachine Dependent Options\fR" 4
326 .IX Item "Machine Dependent Options"
327 \&\fIM680x0 Options\fR
329 \&\fB\-m68000 \-m68020 \-m68020\-40 \-m68020\-60 \-m68030 \-m68040
330 \&\-m68060 \-mcpu32 \-m5200 \-m68881 \-mbitfield \-mc68000 \-mc68020
331 \&\-mfpa \-mnobitfield \-mrtd \-mshort \-msoft-float \-mpcrel
332 \&\-malign-int \-mstrict-align\fR
334 \&\fIM68hc1x Options\fR
336 \&\fB\-m6811 \-m6812 \-m68hc11 \-m68hc12
337 \&\-mauto-incdec \-mshort \-msoft-reg-count=\fR\fIcount\fR
339 \&\fI\s-1VAX\s0 Options\fR
341 \&\fB\-mg \-mgnu \-munix\fR
343 \&\fI\s-1SPARC\s0 Options\fR
345 \&\fB\-mcpu=\fR\fIcpu type\fR
346 \&\fB\-mtune=\fR\fIcpu type\fR
347 \&\fB\-mcmodel=\fR\fIcode model\fR
349 \&\-mapp-regs \-mbroken-saverestore \-mcypress
350 \&\-mepilogue \-mfaster-structs \-mflat
351 \&\-mfpu \-mhard-float \-mhard-quad-float
352 \&\-mimpure-text \-mlive-g0 \-mno-app-regs
353 \&\-mno-epilogue \-mno-faster-structs \-mno-flat \-mno-fpu
354 \&\-mno-impure-text \-mno-stack-bias \-mno-unaligned-doubles
355 \&\-msoft-float \-msoft-quad-float \-msparclite \-mstack-bias
356 \&\-msupersparc \-munaligned-doubles \-mv8\fR
358 \&\fIConvex Options\fR
360 \&\fB\-mc1 \-mc2 \-mc32 \-mc34 \-mc38
361 \&\-margcount \-mnoargcount
362 \&\-mlong32 \-mlong64
363 \&\-mvolatile-cache \-mvolatile-nocache\fR
365 \&\fI\s-1AMD29K\s0 Options\fR
367 \&\fB\-m29000 \-m29050 \-mbw \-mnbw \-mdw \-mndw
368 \&\-mlarge \-mnormal \-msmall
369 \&\-mkernel-registers \-mno-reuse-arg-regs
370 \&\-mno-stack-check \-mno-storem-bug
371 \&\-mreuse-arg-regs \-msoft-float \-mstack-check
372 \&\-mstorem-bug \-muser-registers\fR
374 \&\fI\s-1ARM\s0 Options\fR
376 \&\fB\-mapcs-frame \-mno-apcs-frame
377 \&\-mapcs-26 \-mapcs-32
378 \&\-mapcs-stack-check \-mno-apcs-stack-check
379 \&\-mapcs-float \-mno-apcs-float
380 \&\-mapcs-reentrant \-mno-apcs-reentrant
381 \&\-msched-prolog \-mno-sched-prolog
382 \&\-mlittle-endian \-mbig-endian \-mwords-little-endian
383 \&\-malignment-traps \-mno-alignment-traps
384 \&\-msoft-float \-mhard-float \-mfpe
385 \&\-mthumb-interwork \-mno-thumb-interwork
386 \&\-mcpu= \-march= \-mfpe=
387 \&\-mstructure-size-boundary=
388 \&\-mbsd \-mxopen \-mno-symrename
389 \&\-mabort-on-noreturn
390 \&\-mlong-calls \-mno-long-calls
391 \&\-mnop-fun-dllimport \-mno-nop-fun-dllimport
392 \&\-msingle-pic-base \-mno-single-pic-base
393 \&\-mpic-register=\fR
395 \&\fIThumb Options\fR
397 \&\fB\-mtpcs-frame \-mno-tpcs-frame
398 \&\-mtpcs-leaf-frame \-mno-tpcs-leaf-frame
399 \&\-mlittle-endian \-mbig-endian
400 \&\-mthumb-interwork \-mno-thumb-interwork
401 \&\-mstructure-size-boundary=
402 \&\-mnop-fun-dllimport \-mno-nop-fun-dllimport
403 \&\-mcallee-super-interworking \-mno-callee-super-interworking
404 \&\-mcaller-super-interworking \-mno-caller-super-interworking
405 \&\-msingle-pic-base \-mno-single-pic-base
406 \&\-mpic-register=\fR
408 \&\fI\s-1MN10200\s0 Options\fR
412 \&\fI\s-1MN10300\s0 Options\fR
420 \&\fIM32R/D Options\fR
422 \&\fB\-mcode-model=\fR\fImodel type\fR \fB\-msdata=\fR\fIsdata type\fR
423 \&\fB\-G\fR \fInum\fR
427 \&\fB\-m88000 \-m88100 \-m88110 \-mbig-pic
428 \&\-mcheck-zero-division \-mhandle-large-shift
429 \&\-midentify-revision \-mno-check-zero-division
430 \&\-mno-ocs-debug-info \-mno-ocs-frame-position
431 \&\-mno-optimize-arg-area \-mno-serialize-volatile
432 \&\-mno-underscores \-mocs-debug-info
433 \&\-mocs-frame-position \-moptimize-arg-area
434 \&\-mserialize-volatile \-mshort-data-\fR\fInum\fR \fB\-msvr3
435 \&\-msvr4 \-mtrap-large-shift \-muse-div-instruction
436 \&\-mversion-03.00 \-mwarn-passed-structs\fR
438 \&\fI\s-1RS/6000\s0 and PowerPC Options\fR
440 \&\fB\-mcpu=\fR\fIcpu type\fR
441 \&\fB\-mtune=\fR\fIcpu type\fR
442 \&\fB\-mpower \-mno-power \-mpower2 \-mno-power2
443 \&\-mpowerpc \-mpowerpc64 \-mno-powerpc
444 \&\-mpowerpc-gpopt \-mno-powerpc-gpopt
445 \&\-mpowerpc-gfxopt \-mno-powerpc-gfxopt
446 \&\-mnew-mnemonics \-mold-mnemonics
447 \&\-mfull-toc \-mminimal-toc \-mno-fop-in-toc \-mno-sum-in-toc
448 \&\-m64 \-m32 \-mxl-call \-mno-xl-call \-mthreads \-mpe
449 \&\-msoft-float \-mhard-float \-mmultiple \-mno-multiple
450 \&\-mstring \-mno-string \-mupdate \-mno-update
451 \&\-mfused-madd \-mno-fused-madd \-mbit-align \-mno-bit-align
452 \&\-mstrict-align \-mno-strict-align \-mrelocatable
453 \&\-mno-relocatable \-mrelocatable-lib \-mno-relocatable-lib
454 \&\-mtoc \-mno-toc \-mlittle \-mlittle-endian \-mbig \-mbig-endian
455 \&\-mcall-aix \-mcall-sysv \-mprototype \-mno-prototype
456 \&\-msim \-mmvme \-mads \-myellowknife \-memb \-msdata
457 \&\-msdata=\fR\fIopt\fR \fB\-mvxworks \-G\fR \fInum\fR
459 \&\fI\s-1RT\s0 Options\fR
461 \&\fB\-mcall-lib-mul \-mfp-arg-in-fpregs \-mfp-arg-in-gregs
462 \&\-mfull-fp-blocks \-mhc-struct-return \-min-line-mul
463 \&\-mminimum-fp-blocks \-mnohc-struct-return\fR
465 \&\fI\s-1MIPS\s0 Options\fR
467 \&\fB\-mabicalls \-mcpu=\fR\fIcpu type\fR
468 \&\fB\-membedded-data \-muninit-const-in-rodata
469 \&\-membedded-pic \-mfp32 \-mfp64 \-mgas \-mgp32 \-mgp64
470 \&\-mgpopt \-mhalf-pic \-mhard-float \-mint64 \-mips1
471 \&\-mips2 \-mips3 \-mips4 \-mlong64 \-mlong32 \-mlong-calls \-mmemcpy
472 \&\-mmips-as \-mmips-tfile \-mno-abicalls
473 \&\-mno-embedded-data \-mno-uninit-const-in-rodata \-mno-embedded-pic
474 \&\-mno-gpopt \-mno-long-calls
475 \&\-mno-memcpy \-mno-mips-tfile \-mno-rnames \-mno-stats
476 \&\-mrnames \-msoft-float
477 \&\-m4650 \-msingle-float \-mmad
478 \&\-mstats \-EL \-EB \-G\fR \fInum\fR \fB\-nocpp
479 \&\-mabi=32 \-mabi=n32 \-mabi=64 \-mabi=eabi
480 \&\-mfix7000 \-mno-crt0\fR
484 \&\fB\-mcpu=\fR\fIcpu type\fR \fB\-march=\fR\fIcpu type\fR
485 \&\fB\-mintel-syntax \-mieee-fp \-mno-fancy-math-387
486 \&\-mno-fp-ret-in-387 \-msoft-float \-msvr3\-shlib
487 \&\-mno-wide-multiply \-mrtd \-malign-double
488 \&\-mreg-alloc=\fR\fIlist\fR \fB\-mregparm=\fR\fInum\fR
489 \&\fB\-malign-jumps=\fR\fInum\fR \fB\-malign-loops=\fR\fInum\fR
490 \&\fB\-malign-functions=\fR\fInum\fR \fB\-mpreferred-stack-boundary=\fR\fInum\fR
491 \&\fB\-mthreads \-mno-align-stringops \-minline-all-stringops
492 \&\-mpush-args \-maccumulate-outgoing-args \-m128bit-long-double
493 \&\-m96bit-long-double\fR
495 \&\fI\s-1HPPA\s0 Options\fR
497 \&\fB\-march=\fR\fIarchitecture type\fR
498 \&\fB\-mbig-switch \-mdisable-fpregs \-mdisable-indexing
499 \&\-mfast-indirect-calls \-mgas \-mjump-in-delay
500 \&\-mlong-load-store \-mno-big-switch \-mno-disable-fpregs
501 \&\-mno-disable-indexing \-mno-fast-indirect-calls \-mno-gas
502 \&\-mno-jump-in-delay \-mno-long-load-store
503 \&\-mno-portable-runtime \-mno-soft-float
504 \&\-mno-space-regs \-msoft-float \-mpa-risc-1\-0
505 \&\-mpa-risc-1\-1 \-mpa-risc-2\-0 \-mportable-runtime
506 \&\-mschedule=\fR\fIcpu type\fR \fB\-mspace-regs\fR
508 \&\fIIntel 960 Options\fR
510 \&\fB\-m\fR\fIcpu type\fR \fB\-masm-compat \-mclean-linkage
511 \&\-mcode-align \-mcomplex-addr \-mleaf-procedures
512 \&\-mic-compat \-mic2.0\-compat \-mic3.0\-compat
513 \&\-mintel-asm \-mno-clean-linkage \-mno-code-align
514 \&\-mno-complex-addr \-mno-leaf-procedures
515 \&\-mno-old-align \-mno-strict-align \-mno-tail-call
516 \&\-mnumerics \-mold-align \-msoft-float \-mstrict-align
519 \&\fI\s-1DEC\s0 Alpha Options\fR
521 \&\fB\-mfp-regs \-mno-fp-regs \-mno-soft-float \-msoft-float
523 \&\-mieee \-mieee-with-inexact \-mieee-conformant
524 \&\-mfp-trap-mode=\fR\fImode\fR \fB\-mfp-rounding-mode=\fR\fImode\fR
525 \&\fB\-mtrap-precision=\fR\fImode\fR \fB\-mbuild-constants
526 \&\-mcpu=\fR\fIcpu type\fR
527 \&\fB\-mbwx \-mno-bwx \-mcix \-mno-cix \-mmax \-mno-max
528 \&\-mmemory-latency=\fR\fItime\fR
530 \&\fIClipper Options\fR
532 \&\fB\-mc300 \-mc400\fR
534 \&\fIH8/300 Options\fR
536 \&\fB\-mrelax \-mh \-ms \-mint32 \-malign-300\fR
538 \&\fI\s-1SH\s0 Options\fR
540 \&\fB\-m1 \-m2 \-m3 \-m3e
541 \&\-m4\-nofpu \-m4\-single-only \-m4\-single \-m4
542 \&\-mb \-ml \-mdalign \-mrelax
543 \&\-mbigtable \-mfmovd \-mhitachi \-mnomacsave
544 \&\-misize \-mpadstruct \-mspace
548 \&\fISystem V Options\fR
550 \&\fB\-Qy \-Qn \-YP,\fR\fIpaths\fR \fB\-Ym,\fR\fIdir\fR
552 \&\fI\s-1ARC\s0 Options\fR
555 \&\-mmangle-cpu \-mcpu=\fR\fIcpu\fR \fB\-mtext=\fR\fItext section\fR
556 \&\fB\-mdata=\fR\fIdata section\fR \fB\-mrodata=\fR\fIreadonly data section\fR
558 \&\fITMS320C3x/C4x Options\fR
560 \&\fB\-mcpu=\fR\fIcpu\fR \fB\-mbig \-msmall \-mregparm \-mmemparm
561 \&\-mfast-fix \-mmpyi \-mbk \-mti \-mdp-isr-reload
562 \&\-mrpts=\fR\fIcount\fR \fB\-mrptb \-mdb \-mloop-unsigned
563 \&\-mparallel-insns \-mparallel-mpy \-mpreserve-float\fR
567 \&\fB\-mlong-calls \-mno-long-calls \-mep \-mno-ep
568 \&\-mprolog-function \-mno-prolog-function \-mspace
569 \&\-mtda=\fR\fIn\fR \fB\-msda=\fR\fIn\fR \fB\-mzda=\fR\fIn\fR
570 \&\fB\-mv850 \-mbig-switch\fR
572 \&\fI\s-1NS32K\s0 Options\fR
574 \&\fB\-m32032 \-m32332 \-m32532 \-m32081 \-m32381 \-mmult-add \-mnomult-add
575 \&\-msoft-float \-mrtd \-mnortd \-mregparam \-mnoregparam \-msb \-mnosb
576 \&\-mbitfield \-mnobitfield \-mhimem \-mnohimem\fR
578 \&\fI\s-1AVR\s0 Options\fR
580 \&\fB\-mmcu=\fR\fImcu\fR \fB\-msize \-minit-stack=\fR\fIn\fR \fB\-mno-interrupts
581 \&\-mcall-prologues \-mno-tablejump \-mtiny-stack\fR
583 \&\fIMCore Options\fR
585 \&\fB\-mhardlit \-mno-hardlit \-mdiv \-mno-div \-mrelax-immediates
586 \&\-mno-relax-immediates \-mwide-bitfields \-mno-wide-bitfields
587 \&\-m4byte-functions \-mno-4byte-functions \-mcallgraph-data
588 \&\-mno-callgraph-data \-mslow-bytes \-mno-slow-bytes \-mno-lsim
589 \&\-mlittle-endian \-mbig-endian \-m210 \-m340 \-mstack-increment\fR
591 \&\fI\s-1IA-64\s0 Options\fR
593 \&\fB\-mbig-endian \-mlittle-endian \-mgnu-as \-mgnu-ld \-mno-pic
594 \&\-mvolatile-asm-stop \-mb-step \-mregister-names \-mno-sdata
595 \&\-mconstant-gp \-mauto-pic \-minline-divide-min-latency
596 \&\-minline-divide-max-throughput \-mno-dwarf2\-asm
597 \&\-mfixed-range=\fR\fIregister range\fR
598 .Ip "\fICode Generation Options\fR" 4
599 .IX Item "Code Generation Options"
600 \&\fB\-fcall-saved-\fR\fIreg\fR \fB\-fcall-used-\fR\fIreg\fR
601 \&\fB\-fexceptions \-funwind-tables \-ffixed-\fR\fIreg\fR
602 \&\fB\-finhibit-size-directive \-finstrument-functions
603 \&\-fcheck-memory-usage \-fprefix-function-name
604 \&\-fno-common \-fno-ident \-fno-gnu-linker
605 \&\-fpcc-struct-return \-fpic \-fPIC
606 \&\-freg-struct-return \-fshared-data \-fshort-enums
607 \&\-fshort-double \-fvolatile \-fvolatile-global \-fvolatile-static
608 \&\-fverbose-asm \-fpack-struct \-fstack-check
609 \&\-fstack-limit-register=\fR\fIreg\fR \fB\-fstack-limit-symbol=\fR\fIsym\fR
610 \&\fB\-fargument-alias \-fargument-noalias
611 \&\-fargument-noalias-global
612 \&\-fleading-underscore\fR
613 .Sh "Options Controlling the Kind of Output"
614 .IX Subsection "Options Controlling the Kind of Output"
615 Compilation can involve up to four stages: preprocessing, compilation
616 proper, assembly and linking, always in that order. The first three
617 stages apply to an individual source file, and end by producing an
618 object file; linking combines all the object files (those newly
619 compiled, and those specified as input) into an executable file.
621 For any given input file, the file name suffix determines what kind of
623 .Ip "\fIfile\fR\fB.c\fR" 4
625 C source code which must be preprocessed.
626 .Ip "\fIfile\fR\fB.i\fR" 4
628 C source code which should not be preprocessed.
629 .Ip "\fIfile\fR\fB.ii\fR" 4
631 \&\*(C+ source code which should not be preprocessed.
632 .Ip "\fIfile\fR\fB.m\fR" 4
634 Objective-C source code. Note that you must link with the library
635 \&\fIlibobjc.a\fR to make an Objective-C program work.
636 .Ip "\fIfile\fR\fB.mi\fR" 4
638 Objective-C source code which should not be preprocessed.
639 .Ip "\fIfile\fR\fB.h\fR" 4
641 C header file (not to be compiled or linked).
642 .Ip "\fIfile\fR\fB.cc\fR" 4
645 .Ip "\fIfile\fR\fB.cp\fR" 4
647 .Ip "\fIfile\fR\fB.cxx\fR" 4
649 .Ip "\fIfile\fR\fB.cpp\fR" 4
651 .Ip "\fIfile\fR\fB.c++\fR" 4
653 .Ip "\fIfile\fR\fB.C\fR" 4
656 \&\*(C+ source code which must be preprocessed. Note that in \fB.cxx\fR,
657 the last two letters must both be literally \fBx\fR. Likewise,
658 \&\fB.C\fR refers to a literal capital C.
659 .Ip "\fIfile\fR\fB.f\fR" 4
662 .Ip "\fIfile\fR\fB.for\fR" 4
664 .Ip "\fIfile\fR\fB.FOR\fR" 4
667 Fortran source code which should not be preprocessed.
668 .Ip "\fIfile\fR\fB.F\fR" 4
671 .Ip "\fIfile\fR\fB.fpp\fR" 4
673 .Ip "\fIfile\fR\fB.FPP\fR" 4
676 Fortran source code which must be preprocessed (with the traditional
678 .Ip "\fIfile\fR\fB.r\fR" 4
680 Fortran source code which must be preprocessed with a \s-1RATFOR\s0
681 preprocessor (not included with \s-1GCC\s0).
682 .Ip "\fIfile\fR\fB.ch\fR" 4
685 .Ip "\fIfile\fR\fB.chi\fR" 4
688 \&\s-1CHILL\s0 source code (preprocessed with the traditional preprocessor).
689 .Ip "\fIfile\fR\fB.s\fR" 4
692 .Ip "\fIfile\fR\fB.S\fR" 4
694 Assembler code which must be preprocessed.
697 An object file to be fed straight into linking.
698 Any file name with no recognized suffix is treated this way.
700 You can specify the input language explicitly with the \fB\-x\fR option:
701 .Ip "\fB\-x\fR \fIlanguage\fR" 4
702 .IX Item "-x language"
703 Specify explicitly the \fIlanguage\fR for the following input files
704 (rather than letting the compiler choose a default based on the file
705 name suffix). This option applies to all following input files until
706 the next \fB\-x\fR option. Possible values for \fIlanguage\fR are:
709 \& c c-header cpp-output
710 \& c++ c++-cpp-output
711 \& objective-c objc-cpp-output
712 \& assembler assembler-with-cpp
713 \& f77 f77-cpp-input ratfor
716 .Ip "\fB\-x none\fR" 4
718 Turn off any specification of a language, so that subsequent files are
719 handled according to their file name suffixes (as they are if \fB\-x\fR
720 has not been used at all).
721 .Ip "\fB\-pass-exit-codes\fR" 4
722 .IX Item "-pass-exit-codes"
723 Normally the \fBgcc\fR program will exit with the code of 1 if any
724 phase of the compiler returns a non-success return code. If you specify
725 \&\fB\-pass-exit-codes\fR, the \fBgcc\fR program will instead return with
726 numerically highest error produced by any phase that returned an error
729 If you only want some of the stages of compilation, you can use
730 \&\fB\-x\fR (or filename suffixes) to tell \fBgcc\fR where to start, and
731 one of the options \fB\-c\fR, \fB\-S\fR, or \fB\-E\fR to say where
732 \&\fBgcc\fR is to stop. Note that some combinations (for example,
733 \&\fB\-x cpp-output \-E\fR) instruct \fBgcc\fR to do nothing at all.
736 Compile or assemble the source files, but do not link. The linking
737 stage simply is not done. The ultimate output is in the form of an
738 object file for each source file.
740 By default, the object file name for a source file is made by replacing
741 the suffix \fB.c\fR, \fB.i\fR, \fB.s\fR, etc., with \fB.o\fR.
743 Unrecognized input files, not requiring compilation or assembly, are
747 Stop after the stage of compilation proper; do not assemble. The output
748 is in the form of an assembler code file for each non-assembler input
751 By default, the assembler file name for a source file is made by
752 replacing the suffix \fB.c\fR, \fB.i\fR, etc., with \fB.s\fR.
754 Input files that don't require compilation are ignored.
757 Stop after the preprocessing stage; do not run the compiler proper. The
758 output is in the form of preprocessed source code, which is sent to the
761 Input files which don't require preprocessing are ignored.
762 .Ip "\fB\-o\fR \fIfile\fR" 4
764 Place output in file \fIfile\fR. This applies regardless to whatever
765 sort of output is being produced, whether it be an executable file,
766 an object file, an assembler file or preprocessed C code.
768 Since only one output file can be specified, it does not make sense to
769 use \fB\-o\fR when compiling more than one input file, unless you are
770 producing an executable file as output.
772 If \fB\-o\fR is not specified, the default is to put an executable file
773 in \fIa.out\fR, the object file for \fI\fIsource\fI.\fIsuffix\fI\fR in
774 \&\fI\fIsource\fI.o\fR, its assembler file in \fI\fIsource\fI.s\fR, and
775 all preprocessed C source on standard output.
778 Print (on standard error output) the commands executed to run the stages
779 of compilation. Also print the version number of the compiler driver
780 program and of the preprocessor and the compiler proper.
783 Use pipes rather than temporary files for communication between the
784 various stages of compilation. This fails to work on some systems where
785 the assembler is unable to read from a pipe; but the \s-1GNU\s0 assembler has
787 .Ip "\fB\*(--help\fR" 4
789 Print (on the standard output) a description of the command line options
790 understood by \fBgcc\fR. If the \fB\-v\fR option is also specified
791 then \fB\*(--help\fR will also be passed on to the various processes
792 invoked by \fBgcc\fR, so that they can display the command line options
793 they accept. If the \fB\-W\fR option is also specified then command
794 line options which have no documentation associated with them will also
796 .Ip "\fB\*(--target-help\fR" 4
797 .IX Item "target-help"
798 Print (on the standard output) a description of target specific command
799 line options for each tool.
800 .Sh "Compiling \*(C+ Programs"
801 .IX Subsection "Compiling Programs"
802 \&\*(C+ source files conventionally use one of the suffixes \fB.C\fR,
803 \&\fB.cc\fR, \fB.cpp\fR, \fB.c++\fR, \fB.cp\fR, or \fB.cxx\fR;
804 preprocessed \*(C+ files use the suffix \fB.ii\fR. \s-1GCC\s0 recognizes
805 files with these names and compiles them as \*(C+ programs even if you
806 call the compiler the same way as for compiling C programs (usually with
809 However, \*(C+ programs often require class libraries as well as a
810 compiler that understands the \*(C+ language\-\-\-and under some
811 circumstances, you might want to compile programs from standard input,
812 or otherwise without a suffix that flags them as \*(C+ programs.
813 \&\fBg++\fR is a program that calls \s-1GCC\s0 with the default language
814 set to \*(C+, and automatically specifies linking against the \*(C+
815 library. On many systems, \fBg++\fR is also
816 installed with the name \fBc++\fR.
818 When you compile \*(C+ programs, you may specify many of the same
819 command-line options that you use for compiling programs in any
820 language; or command-line options meaningful for C and related
821 languages; or options that are meaningful only for \*(C+ programs.
822 .Sh "Options Controlling C Dialect"
823 .IX Subsection "Options Controlling C Dialect"
824 The following options control the dialect of C (or languages derived
825 from C, such as \*(C+ and Objective C) that the compiler accepts:
828 In C mode, support all \s-1ISO\s0 C89 programs. In \*(C+ mode,
829 remove \s-1GNU\s0 extensions that conflict with \s-1ISO\s0 \*(C+.
831 This turns off certain features of \s-1GCC\s0 that are incompatible with \s-1ISO\s0
832 C (when compiling C code), or of standard \*(C+ (when compiling \*(C+ code),
833 such as the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR keywords, and
834 predefined macros such as \f(CW\*(C`unix\*(C'\fR and \f(CW\*(C`vax\*(C'\fR that identify the
835 type of system you are using. It also enables the undesirable and
836 rarely used \s-1ISO\s0 trigraph feature. For the C compiler,
837 it disables recognition of \*(C+ style \fB//\fR comments as well as
838 the \f(CW\*(C`inline\*(C'\fR keyword.
840 The alternate keywords \f(CW\*(C`_\|_asm_\|_\*(C'\fR, \f(CW\*(C`_\|_extension_\|_\*(C'\fR,
841 \&\f(CW\*(C`_\|_inline_\|_\*(C'\fR and \f(CW\*(C`_\|_typeof_\|_\*(C'\fR continue to work despite
842 \&\fB\-ansi\fR. You would not want to use them in an \s-1ISO\s0 C program, of
843 course, but it is useful to put them in header files that might be included
844 in compilations done with \fB\-ansi\fR. Alternate predefined macros
845 such as \f(CW\*(C`_\|_unix_\|_\*(C'\fR and \f(CW\*(C`_\|_vax_\|_\*(C'\fR are also available, with or
846 without \fB\-ansi\fR.
848 The \fB\-ansi\fR option does not cause non-ISO programs to be
849 rejected gratuitously. For that, \fB\-pedantic\fR is required in
850 addition to \fB\-ansi\fR.
852 The macro \f(CW\*(C`_\|_STRICT_ANSI_\|_\*(C'\fR is predefined when the \fB\-ansi\fR
853 option is used. Some header files may notice this macro and refrain
854 from declaring certain functions or defining certain macros that the
855 \&\s-1ISO\s0 standard doesn't call for; this is to avoid interfering with any
856 programs that might use these names for other things.
858 Functions which would normally be builtin but do not have semantics
859 defined by \s-1ISO\s0 C (such as \f(CW\*(C`alloca\*(C'\fR and \f(CW\*(C`ffs\*(C'\fR) are not builtin
860 functions with \fB\-ansi\fR is used.
863 Determine the language standard. A value for this option must be provided;
866 .Ip "\fBiso9899:1990\fR" 4
867 .IX Item "iso9899:1990"
869 .Ip "\fBiso9899:199409\fR" 4
870 .IX Item "iso9899:199409"
871 \&\s-1ISO\s0 C as modified in amend. 1
872 .Ip "\fBiso9899:1999\fR" 4
873 .IX Item "iso9899:1999"
874 \&\s-1ISO\s0 C99. Note that this standard is not yet fully supported; see
875 <\fBhttp://gcc.gnu.org/gcc-3.0/c99status.html\fR> for more information.
878 same as \fB\-std=iso9899:1990\fR
881 same as \fB\-std=iso9899:1999\fR
884 default, iso9899:1990 + gnu extensions
887 iso9899:1999 + gnu extensions
888 .Ip "\fBiso9899:199x\fR" 4
889 .IX Item "iso9899:199x"
890 same as \fB\-std=iso9899:1999\fR, deprecated
893 same as \fB\-std=iso9899:1999\fR, deprecated
896 same as \fB\-std=gnu99\fR, deprecated
900 Even when this option is not specified, you can still use some of the
901 features of newer standards in so far as they do not conflict with
902 previous C standards. For example, you may use \f(CW\*(C`_\|_restrict_\|_\*(C'\fR even
903 when \fB\-std=c99\fR is not specified.
905 The \fB\-std\fR options specifying some version of \s-1ISO\s0 C have the same
906 effects as \fB\-ansi\fR, except that features that were not in \s-1ISO\s0 C89
907 but are in the specified version (for example, \fB//\fR comments and
908 the \f(CW\*(C`inline\*(C'\fR keyword in \s-1ISO\s0 C99) are not disabled.
910 .Ip "\fB\-fno-asm\fR" 4
912 Do not recognize \f(CW\*(C`asm\*(C'\fR, \f(CW\*(C`inline\*(C'\fR or \f(CW\*(C`typeof\*(C'\fR as a
913 keyword, so that code can use these words as identifiers. You can use
914 the keywords \f(CW\*(C`_\|_asm_\|_\*(C'\fR, \f(CW\*(C`_\|_inline_\|_\*(C'\fR and \f(CW\*(C`_\|_typeof_\|_\*(C'\fR
915 instead. \fB\-ansi\fR implies \fB\-fno-asm\fR.
917 In \*(C+, this switch only affects the \f(CW\*(C`typeof\*(C'\fR keyword, since
918 \&\f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`inline\*(C'\fR are standard keywords. You may want to
919 use the \fB\-fno-gnu-keywords\fR flag instead, which has the same
920 effect. In C99 mode (\fB\-std=c99\fR or \fB\-std=gnu99\fR), this
921 switch only affects the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR keywords, since
922 \&\f(CW\*(C`inline\*(C'\fR is a standard keyword in \s-1ISO\s0 C99.
923 .Ip "\fB\-fno-builtin\fR" 4
924 .IX Item "-fno-builtin"
925 Don't recognize builtin functions that do not begin with
926 \&\fB_\|_builtin_\fR as prefix.
928 \&\s-1GCC\s0 normally generates special code to handle certain builtin functions
929 more efficiently; for instance, calls to \f(CW\*(C`alloca\*(C'\fR may become single
930 instructions that adjust the stack directly, and calls to \f(CW\*(C`memcpy\*(C'\fR
931 may become inline copy loops. The resulting code is often both smaller
932 and faster, but since the function calls no longer appear as such, you
933 cannot set a breakpoint on those calls, nor can you change the behavior
934 of the functions by linking with a different library.
935 .Ip "\fB\-fhosted\fR" 4
937 Assert that compilation takes place in a hosted environment. This implies
938 \&\fB\-fbuiltin\fR. A hosted environment is one in which the
939 entire standard library is available, and in which \f(CW\*(C`main\*(C'\fR has a return
940 type of \f(CW\*(C`int\*(C'\fR. Examples are nearly everything except a kernel.
941 This is equivalent to \fB\-fno-freestanding\fR.
942 .Ip "\fB\-ffreestanding\fR" 4
943 .IX Item "-ffreestanding"
944 Assert that compilation takes place in a freestanding environment. This
945 implies \fB\-fno-builtin\fR. A freestanding environment
946 is one in which the standard library may not exist, and program startup may
947 not necessarily be at \f(CW\*(C`main\*(C'\fR. The most obvious example is an \s-1OS\s0 kernel.
948 This is equivalent to \fB\-fno-hosted\fR.
949 .Ip "\fB\-trigraphs\fR" 4
950 .IX Item "-trigraphs"
951 Support \s-1ISO\s0 C trigraphs. You don't want to know about this
952 brain-damage. The \fB\-ansi\fR option (and \fB\-std\fR options for
953 strict \s-1ISO\s0 C conformance) implies \fB\-trigraphs\fR.
954 .Ip "\fB\-traditional\fR" 4
955 .IX Item "-traditional"
956 Attempt to support some aspects of traditional C compilers.
960 All \f(CW\*(C`extern\*(C'\fR declarations take effect globally even if they
961 are written inside of a function definition. This includes implicit
962 declarations of functions.
964 The newer keywords \f(CW\*(C`typeof\*(C'\fR, \f(CW\*(C`inline\*(C'\fR, \f(CW\*(C`signed\*(C'\fR, \f(CW\*(C`const\*(C'\fR
965 and \f(CW\*(C`volatile\*(C'\fR are not recognized. (You can still use the
966 alternative keywords such as \f(CW\*(C`_\|_typeof_\|_\*(C'\fR, \f(CW\*(C`_\|_inline_\|_\*(C'\fR, and
969 Comparisons between pointers and integers are always allowed.
971 Integer types \f(CW\*(C`unsigned short\*(C'\fR and \f(CW\*(C`unsigned char\*(C'\fR promote
972 to \f(CW\*(C`unsigned int\*(C'\fR.
974 Out-of-range floating point literals are not an error.
976 Certain constructs which \s-1ISO\s0 regards as a single invalid preprocessing
977 number, such as \fB0xe-0xd\fR, are treated as expressions instead.
979 String ``constants'' are not necessarily constant; they are stored in
980 writable space, and identical looking constants are allocated
981 separately. (This is the same as the effect of
982 \&\fB\-fwritable-strings\fR.)
984 All automatic variables not declared \f(CW\*(C`register\*(C'\fR are preserved by
985 \&\f(CW\*(C`longjmp\*(C'\fR. Ordinarily, \s-1GNU\s0 C follows \s-1ISO\s0 C: automatic variables
986 not declared \f(CW\*(C`volatile\*(C'\fR may be clobbered.
988 The character escape sequences \fB\ex\fR and \fB\ea\fR evaluate as the
989 literal characters \fBx\fR and \fBa\fR respectively. Without
990 \&\fB\-traditional\fR, \fB\ex\fR is a prefix for the hexadecimal
991 representation of a character, and \fB\ea\fR produces a bell.
995 You may wish to use \fB\-fno-builtin\fR as well as \fB\-traditional\fR
996 if your program uses names that are normally \s-1GNU\s0 C builtin functions for
997 other purposes of its own.
999 You cannot use \fB\-traditional\fR if you include any header files that
1000 rely on \s-1ISO\s0 C features. Some vendors are starting to ship systems with
1001 \&\s-1ISO\s0 C header files and you cannot use \fB\-traditional\fR on such
1002 systems to compile files that include any system headers.
1004 The \fB\-traditional\fR option also enables \fB\-traditional-cpp\fR,
1005 which is described next.
1007 .Ip "\fB\-traditional-cpp\fR" 4
1008 .IX Item "-traditional-cpp"
1009 Attempt to support some aspects of traditional C preprocessors.
1013 Comments convert to nothing at all, rather than to a space. This allows
1014 traditional token concatenation.
1016 In a preprocessing directive, the \fB#\fR symbol must appear as the first
1017 character of a line.
1019 Macro arguments are recognized within string constants in a macro
1020 definition (and their values are stringified, though without additional
1021 quote marks, when they appear in such a context). The preprocessor
1022 always considers a string constant to end at a newline.
1024 The predefined macro \f(CW\*(C`_\|_STDC_\|_\*(C'\fR is not defined when you use
1025 \&\fB\-traditional\fR, but \f(CW\*(C`_\|_GNUC_\|_\*(C'\fR is (since the \s-1GNU\s0 extensions
1026 which \f(CW\*(C`_\|_GNUC_\|_\*(C'\fR indicates are not affected by
1027 \&\fB\-traditional\fR). If you need to write header files that work
1028 differently depending on whether \fB\-traditional\fR is in use, by
1029 testing both of these predefined macros you can distinguish four
1030 situations: \s-1GNU\s0 C, traditional \s-1GNU\s0 C, other \s-1ISO\s0 C compilers, and other
1031 old C compilers. The predefined macro \f(CW\*(C`_\|_STDC_VERSION_\|_\*(C'\fR is also
1032 not defined when you use \fB\-traditional\fR.
1034 The preprocessor considers a string constant to end at a newline (unless
1035 the newline is escaped with \fB\e\fR). (Without \fB\-traditional\fR,
1036 string constants can contain the newline character as typed.)
1040 .Ip "\fB\-fcond-mismatch\fR" 4
1041 .IX Item "-fcond-mismatch"
1042 Allow conditional expressions with mismatched types in the second and
1043 third arguments. The value of such an expression is void. This option
1044 is not supported for \*(C+.
1045 .Ip "\fB\-funsigned-char\fR" 4
1046 .IX Item "-funsigned-char"
1047 Let the type \f(CW\*(C`char\*(C'\fR be unsigned, like \f(CW\*(C`unsigned char\*(C'\fR.
1049 Each kind of machine has a default for what \f(CW\*(C`char\*(C'\fR should
1050 be. It is either like \f(CW\*(C`unsigned char\*(C'\fR by default or like
1051 \&\f(CW\*(C`signed char\*(C'\fR by default.
1053 Ideally, a portable program should always use \f(CW\*(C`signed char\*(C'\fR or
1054 \&\f(CW\*(C`unsigned char\*(C'\fR when it depends on the signedness of an object.
1055 But many programs have been written to use plain \f(CW\*(C`char\*(C'\fR and
1056 expect it to be signed, or expect it to be unsigned, depending on the
1057 machines they were written for. This option, and its inverse, let you
1058 make such a program work with the opposite default.
1060 The type \f(CW\*(C`char\*(C'\fR is always a distinct type from each of
1061 \&\f(CW\*(C`signed char\*(C'\fR or \f(CW\*(C`unsigned char\*(C'\fR, even though its behavior
1062 is always just like one of those two.
1063 .Ip "\fB\-fsigned-char\fR" 4
1064 .IX Item "-fsigned-char"
1065 Let the type \f(CW\*(C`char\*(C'\fR be signed, like \f(CW\*(C`signed char\*(C'\fR.
1067 Note that this is equivalent to \fB\-fno-unsigned-char\fR, which is
1068 the negative form of \fB\-funsigned-char\fR. Likewise, the option
1069 \&\fB\-fno-signed-char\fR is equivalent to \fB\-funsigned-char\fR.
1071 You may wish to use \fB\-fno-builtin\fR as well as \fB\-traditional\fR
1072 if your program uses names that are normally \s-1GNU\s0 C builtin functions for
1073 other purposes of its own.
1075 You cannot use \fB\-traditional\fR if you include any header files that
1076 rely on \s-1ISO\s0 C features. Some vendors are starting to ship systems with
1077 \&\s-1ISO\s0 C header files and you cannot use \fB\-traditional\fR on such
1078 systems to compile files that include any system headers.
1079 .Ip "\fB\-fsigned-bitfields\fR" 4
1080 .IX Item "-fsigned-bitfields"
1082 .Ip "\fB\-funsigned-bitfields\fR" 4
1083 .IX Item "-funsigned-bitfields"
1084 .Ip "\fB\-fno-signed-bitfields\fR" 4
1085 .IX Item "-fno-signed-bitfields"
1086 .Ip "\fB\-fno-unsigned-bitfields\fR" 4
1087 .IX Item "-fno-unsigned-bitfields"
1089 These options control whether a bitfield is signed or unsigned, when the
1090 declaration does not use either \f(CW\*(C`signed\*(C'\fR or \f(CW\*(C`unsigned\*(C'\fR. By
1091 default, such a bitfield is signed, because this is consistent: the
1092 basic integer types such as \f(CW\*(C`int\*(C'\fR are signed types.
1094 However, when \fB\-traditional\fR is used, bitfields are all unsigned
1096 .Ip "\fB\-fwritable-strings\fR" 4
1097 .IX Item "-fwritable-strings"
1098 Store string constants in the writable data segment and don't uniquize
1099 them. This is for compatibility with old programs which assume they can
1100 write into string constants. The option \fB\-traditional\fR also has
1103 Writing into string constants is a very bad idea; ``constants'' should
1105 .Ip "\fB\-fallow-single-precision\fR" 4
1106 .IX Item "-fallow-single-precision"
1107 Do not promote single precision math operations to double precision,
1108 even when compiling with \fB\-traditional\fR.
1110 Traditional K&R C promotes all floating point operations to double
1111 precision, regardless of the sizes of the operands. On the
1112 architecture for which you are compiling, single precision may be faster
1113 than double precision. If you must use \fB\-traditional\fR, but want
1114 to use single precision operations when the operands are single
1115 precision, use this option. This option has no effect when compiling
1116 with \s-1ISO\s0 or \s-1GNU\s0 C conventions (the default).
1117 .Ip "\fB\-fshort-wchar\fR" 4
1118 .IX Item "-fshort-wchar"
1119 Override the underlying type for \fBwchar_t\fR to be \fBshort
1120 unsigned int\fR instead of the default for the target. This option is
1121 useful for building programs to run under \s-1WINE\s0.
1122 .Sh "Options Controlling \*(C+ Dialect"
1123 .IX Subsection "Options Controlling Dialect"
1124 This section describes the command-line options that are only meaningful
1125 for \*(C+ programs; but you can also use most of the \s-1GNU\s0 compiler options
1126 regardless of what language your program is in. For example, you
1127 might compile a file \f(CW\*(C`firstClass.C\*(C'\fR like this:
1130 \& g++ -g -frepo -O -c firstClass.C
1132 In this example, only \fB\-frepo\fR is an option meant
1133 only for \*(C+ programs; you can use the other options with any
1134 language supported by \s-1GCC\s0.
1136 Here is a list of options that are \fIonly\fR for compiling \*(C+ programs:
1137 .Ip "\fB\-fno-access-control\fR" 4
1138 .IX Item "-fno-access-control"
1139 Turn off all access checking. This switch is mainly useful for working
1140 around bugs in the access control code.
1141 .Ip "\fB\-fcheck-new\fR" 4
1142 .IX Item "-fcheck-new"
1143 Check that the pointer returned by \f(CW\*(C`operator new\*(C'\fR is non-null
1144 before attempting to modify the storage allocated. The current Working
1145 Paper requires that \f(CW\*(C`operator new\*(C'\fR never return a null pointer, so
1146 this check is normally unnecessary.
1148 An alternative to using this option is to specify that your
1149 \&\f(CW\*(C`operator new\*(C'\fR does not throw any exceptions; if you declare it
1150 \&\fB\f(BIthrow()\fB\fR, g++ will check the return value. See also \fBnew
1152 .Ip "\fB\-fconserve-space\fR" 4
1153 .IX Item "-fconserve-space"
1154 Put uninitialized or runtime-initialized global variables into the
1155 common segment, as C does. This saves space in the executable at the
1156 cost of not diagnosing duplicate definitions. If you compile with this
1157 flag and your program mysteriously crashes after \f(CW\*(C`main()\*(C'\fR has
1158 completed, you may have an object that is being destroyed twice because
1159 two definitions were merged.
1161 This option is no longer useful on most targets, now that support has
1162 been added for putting variables into \s-1BSS\s0 without making them common.
1163 .Ip "\fB\-fdollars-in-identifiers\fR" 4
1164 .IX Item "-fdollars-in-identifiers"
1165 Accept \fB$\fR in identifiers. You can also explicitly prohibit use of
1166 \&\fB$\fR with the option \fB\-fno-dollars-in-identifiers\fR. (\s-1GNU\s0 C allows
1167 \&\fB$\fR by default on most target systems, but there are a few exceptions.)
1168 Traditional C allowed the character \fB$\fR to form part of
1169 identifiers. However, \s-1ISO\s0 C and \*(C+ forbid \fB$\fR in identifiers.
1170 .Ip "\fB\-fno-elide-constructors\fR" 4
1171 .IX Item "-fno-elide-constructors"
1172 The \*(C+ standard allows an implementation to omit creating a temporary
1173 which is only used to initialize another object of the same type.
1174 Specifying this option disables that optimization, and forces g++ to
1175 call the copy constructor in all cases.
1176 .Ip "\fB\-fno-enforce-eh-specs\fR" 4
1177 .IX Item "-fno-enforce-eh-specs"
1178 Don't check for violation of exception specifications at runtime. This
1179 option violates the \*(C+ standard, but may be useful for reducing code
1180 size in production builds, much like defining \fB\s-1NDEBUG\s0\fR. The compiler
1181 will still optimize based on the exception specifications.
1182 .Ip "\fB\-fexternal-templates\fR" 4
1183 .IX Item "-fexternal-templates"
1184 Cause template instantiations to obey \fB#pragma interface\fR and
1185 \&\fBimplementation\fR; template instances are emitted or not according
1186 to the location of the template definition.
1188 This option is deprecated.
1189 .Ip "\fB\-falt-external-templates\fR" 4
1190 .IX Item "-falt-external-templates"
1191 Similar to \-fexternal-templates, but template instances are emitted or
1192 not according to the place where they are first instantiated.
1194 This option is deprecated.
1195 .Ip "\fB\-ffor-scope\fR" 4
1196 .IX Item "-ffor-scope"
1198 .Ip "\fB\-fno-for-scope\fR" 4
1199 .IX Item "-fno-for-scope"
1201 If \-ffor-scope is specified, the scope of variables declared in
1202 a \fIfor-init-statement\fR is limited to the \fBfor\fR loop itself,
1203 as specified by the \*(C+ standard.
1204 If \-fno-for-scope is specified, the scope of variables declared in
1205 a \fIfor-init-statement\fR extends to the end of the enclosing scope,
1206 as was the case in old versions of gcc, and other (traditional)
1207 implementations of \*(C+.
1209 The default if neither flag is given to follow the standard,
1210 but to allow and give a warning for old-style code that would
1211 otherwise be invalid, or have different behavior.
1212 .Ip "\fB\-fno-gnu-keywords\fR" 4
1213 .IX Item "-fno-gnu-keywords"
1214 Do not recognize \f(CW\*(C`typeof\*(C'\fR as a keyword, so that code can use this
1215 word as an identifier. You can use the keyword \f(CW\*(C`_\|_typeof_\|_\*(C'\fR instead.
1216 \&\fB\-ansi\fR implies \fB\-fno-gnu-keywords\fR.
1217 .Ip "\fB\-fhonor-std\fR" 4
1218 .IX Item "-fhonor-std"
1219 Treat the \f(CW\*(C`namespace std\*(C'\fR as a namespace, instead of ignoring
1220 it. For compatibility with earlier versions of g++, the compiler will,
1221 by default, ignore \f(CW\*(C`namespace\-declarations\*(C'\fR,
1222 \&\f(CW\*(C`using\-declarations\*(C'\fR, \f(CW\*(C`using\-directives\*(C'\fR, and
1223 \&\f(CW\*(C`namespace\-names\*(C'\fR, if they involve \f(CW\*(C`std\*(C'\fR.
1224 .Ip "\fB\-fhuge-objects\fR" 4
1225 .IX Item "-fhuge-objects"
1226 Support virtual function calls for objects that exceed the size
1227 representable by a \fBshort int\fR. Users should not use this flag by
1228 default; if you need to use it, the compiler will tell you so.
1230 This flag is not useful when compiling with \-fvtable-thunks.
1232 Like all options that change the \s-1ABI\s0, all \*(C+ code, \fIincluding
1233 libgcc\fR must be built with the same setting of this option.
1234 .Ip "\fB\-fno-implicit-templates\fR" 4
1235 .IX Item "-fno-implicit-templates"
1236 Never emit code for non-inline templates which are instantiated
1237 implicitly (i.e. by use); only emit code for explicit instantiations.
1238 .Ip "\fB\-fno-implicit-inline-templates\fR" 4
1239 .IX Item "-fno-implicit-inline-templates"
1240 Don't emit code for implicit instantiations of inline templates, either.
1241 The default is to handle inlines differently so that compiles with and
1242 without optimization will need the same set of explicit instantiations.
1243 .Ip "\fB\-fno-implement-inlines\fR" 4
1244 .IX Item "-fno-implement-inlines"
1245 To save space, do not emit out-of-line copies of inline functions
1246 controlled by \fB#pragma implementation\fR. This will cause linker
1247 errors if these functions are not inlined everywhere they are called.
1248 .Ip "\fB\-fms-extensions\fR" 4
1249 .IX Item "-fms-extensions"
1250 Disable pedantic warnings about constructs used in \s-1MFC\s0, such as implicit
1251 int and getting a pointer to member function via non-standard syntax.
1252 .Ip "\fB\-fno-operator-names\fR" 4
1253 .IX Item "-fno-operator-names"
1254 Do not treat the operator name keywords \f(CW\*(C`and\*(C'\fR, \f(CW\*(C`bitand\*(C'\fR,
1255 \&\f(CW\*(C`bitor\*(C'\fR, \f(CW\*(C`compl\*(C'\fR, \f(CW\*(C`not\*(C'\fR, \f(CW\*(C`or\*(C'\fR and \f(CW\*(C`xor\*(C'\fR as
1256 synonyms as keywords.
1257 .Ip "\fB\-fno-optional-diags\fR" 4
1258 .IX Item "-fno-optional-diags"
1259 Disable diagnostics that the standard says a compiler does not need to
1260 issue. Currently, the only such diagnostic issued by g++ is the one for
1261 a name having multiple meanings within a class.
1262 .Ip "\fB\-fpermissive\fR" 4
1263 .IX Item "-fpermissive"
1264 Downgrade messages about nonconformant code from errors to warnings. By
1265 default, g++ effectively sets \fB\-pedantic-errors\fR without
1266 \&\fB\-pedantic\fR; this option reverses that. This behavior and this
1267 option are superseded by \fB\-pedantic\fR, which works as it does for \s-1GNU\s0 C.
1268 .Ip "\fB\-frepo\fR" 4
1270 Enable automatic template instantiation. This option also implies
1271 \&\fB\-fno-implicit-templates\fR.
1272 .Ip "\fB\-fno-rtti\fR" 4
1273 .IX Item "-fno-rtti"
1274 Disable generation of information about every class with virtual
1275 functions for use by the \*(C+ runtime type identification features
1276 (\fBdynamic_cast\fR and \fBtypeid\fR). If you don't use those parts
1277 of the language, you can save some space by using this flag. Note that
1278 exception handling uses the same information, but it will generate it as
1280 .Ip "\fB\-ftemplate-depth-\fR\fIn\fR" 4
1281 .IX Item "-ftemplate-depth-n"
1282 Set the maximum instantiation depth for template classes to \fIn\fR.
1283 A limit on the template instantiation depth is needed to detect
1284 endless recursions during template class instantiation. \s-1ANSI/ISO\s0 \*(C+
1285 conforming programs must not rely on a maximum depth greater than 17.
1286 .Ip "\fB\-fuse-cxa-atexit\fR" 4
1287 .IX Item "-fuse-cxa-atexit"
1288 Register destructors for objects with static storage duration with the
1289 \&\f(CW\*(C`_\|_cxa_atexit\*(C'\fR function rather than the \f(CW\*(C`atexit\*(C'\fR function.
1290 This option is required for fully standards-compliant handling of static
1291 destructors, but will only work if your C library supports
1292 \&\f(CW\*(C`_\|_cxa_atexit\*(C'\fR.
1293 .Ip "\fB\-fvtable-thunks\fR" 4
1294 .IX Item "-fvtable-thunks"
1295 Use \fBthunks\fR to implement the virtual function dispatch table
1296 (\fBvtable\fR). The traditional (cfront-style) approach to
1297 implementing vtables was to store a pointer to the function and two
1298 offsets for adjusting the \fBthis\fR pointer at the call site. Newer
1299 implementations store a single pointer to a \fBthunk\fR function which
1300 does any necessary adjustment and then calls the target function.
1302 This option also enables a heuristic for controlling emission of
1303 vtables; if a class has any non-inline virtual functions, the vtable
1304 will be emitted in the translation unit containing the first one of
1307 Like all options that change the \s-1ABI\s0, all \*(C+ code, \fIincluding
1308 libgcc.a\fR must be built with the same setting of this option.
1309 .Ip "\fB\-nostdinc++\fR" 4
1310 .IX Item "-nostdinc++"
1311 Do not search for header files in the standard directories specific to
1312 \&\*(C+, but do still search the other standard directories. (This option
1313 is used when building the \*(C+ library.)
1315 In addition, these optimization, warning, and code generation options
1316 have meanings only for \*(C+ programs:
1317 .Ip "\fB\-fno-default-inline\fR" 4
1318 .IX Item "-fno-default-inline"
1319 Do not assume \fBinline\fR for functions defined inside a class scope.
1321 functions will have linkage like inline functions; they just won't be
1323 .Ip "\fB\-Wctor-dtor-privacy (\*(C+ only)\fR" 4
1324 .IX Item "-Wctor-dtor-privacy ( only)"
1325 Warn when a class seems unusable, because all the constructors or
1326 destructors in a class are private and the class has no friends or
1327 public static member functions.
1328 .Ip "\fB\-Wnon-virtual-dtor (\*(C+ only)\fR" 4
1329 .IX Item "-Wnon-virtual-dtor ( only)"
1330 Warn when a class declares a non-virtual destructor that should probably
1331 be virtual, because it looks like the class will be used polymorphically.
1332 .Ip "\fB\-Wreorder (\*(C+ only)\fR" 4
1333 .IX Item "-Wreorder ( only)"
1334 Warn when the order of member initializers given in the code does not
1335 match the order in which they must be executed. For instance:
1341 \& A(): j (0), i (1) { }
1344 Here the compiler will warn that the member initializers for \fBi\fR
1345 and \fBj\fR will be rearranged to match the declaration order of the
1348 The following \fB\-W...\fR options are not affected by \fB\-Wall\fR.
1349 .Ip "\fB\-Weffc++ (\*(C+ only)\fR" 4
1350 .IX Item "-Weffc++ ( only)"
1351 Warn about violations of various style guidelines from Scott Meyers'
1352 \&\fIEffective \*(C+\fR books. If you use this option, you should be aware
1353 that the standard library headers do not obey all of these guidelines;
1354 you can use \fBgrep \-v\fR to filter out those warnings.
1355 .Ip "\fB\-Wno-deprecated (\*(C+ only)\fR" 4
1356 .IX Item "-Wno-deprecated ( only)"
1357 Do not warn about usage of deprecated features.
1358 .Ip "\fB\-Wno-non-template-friend (\*(C+ only)\fR" 4
1359 .IX Item "-Wno-non-template-friend ( only)"
1360 Disable warnings when non-templatized friend functions are declared
1361 within a template. With the advent of explicit template specification
1362 support in g++, if the name of the friend is an unqualified-id (ie,
1363 \&\fBfriend foo(int)\fR), the \*(C+ language specification demands that the
1364 friend declare or define an ordinary, nontemplate function. (Section
1365 14.5.3). Before g++ implemented explicit specification, unqualified-ids
1366 could be interpreted as a particular specialization of a templatized
1367 function. Because this non-conforming behavior is no longer the default
1368 behavior for g++, \fB\-Wnon-template-friend\fR allows the compiler to
1369 check existing code for potential trouble spots, and is on by default.
1370 This new compiler behavior can be turned off with
1371 \&\fB\-Wno-non-template-friend\fR which keeps the conformant compiler code
1372 but disables the helpful warning.
1373 .Ip "\fB\-Wold-style-cast (\*(C+ only)\fR" 4
1374 .IX Item "-Wold-style-cast ( only)"
1375 Warn if an old-style (C-style) cast is used within a \*(C+ program. The
1376 new-style casts (\fBstatic_cast\fR, \fBreinterpret_cast\fR, and
1377 \&\fBconst_cast\fR) are less vulnerable to unintended effects.
1378 .Ip "\fB\-Woverloaded-virtual (\*(C+ only)\fR" 4
1379 .IX Item "-Woverloaded-virtual ( only)"
1380 Warn when a derived class function declaration may be an error in
1381 defining a virtual function. In a derived class, the
1382 definitions of virtual functions must match the type signature of a
1383 virtual function declared in the base class. With this option, the
1384 compiler warns when you define a function with the same name as a
1385 virtual function, but with a type signature that does not match any
1386 declarations from the base class.
1387 .Ip "\fB\-Wno-pmf-conversions (\*(C+ only)\fR" 4
1388 .IX Item "-Wno-pmf-conversions ( only)"
1389 Disable the diagnostic for converting a bound pointer to member function
1391 .Ip "\fB\-Wsign-promo (\*(C+ only)\fR" 4
1392 .IX Item "-Wsign-promo ( only)"
1393 Warn when overload resolution chooses a promotion from unsigned or
1394 enumeral type to a signed type over a conversion to an unsigned type of
1395 the same size. Previous versions of g++ would try to preserve
1396 unsignedness, but the standard mandates the current behavior.
1397 .Ip "\fB\-Wsynth (\*(C+ only)\fR" 4
1398 .IX Item "-Wsynth ( only)"
1399 Warn when g++'s synthesis behavior does not match that of cfront. For
1405 \& A& operator = (int);
1415 In this example, g++ will synthesize a default \fBA& operator =
1416 (const A&);\fR, while cfront will use the user-defined \fBoperator =\fR.
1417 .Sh "Options to Control Diagnostic Messages Formatting"
1418 .IX Subsection "Options to Control Diagnostic Messages Formatting"
1419 Traditionally, diagnostic messages have been formatted irrespective of
1420 the output device's aspect (e.g. its width, ...). The options described
1421 below can be used to control the diagnostic messages formatting
1422 algorithm, e.g. how many characters per line, how often source location
1423 information should be reported. Right now, only the \*(C+ front-end can
1424 honor these options. However it is expected, in the near future, that
1425 the remaining front-ends would be able to digest them correctly.
1426 .Ip "\fB\-fmessage-length=\fR\fIn\fR" 4
1427 .IX Item "-fmessage-length=n"
1428 Try to format error messages so that they fit on lines of about \fIn\fR
1429 characters. The default is 72 characters for g++ and 0 for the rest of
1430 the front-ends supported by \s-1GCC\s0. If \fIn\fR is zero, then no
1431 line-wrapping will be done; each error message will appear on a single
1433 .Ip "\fB\-fdiagnostics-show-location=once\fR" 4
1434 .IX Item "-fdiagnostics-show-location=once"
1435 Only meaningful in line-wrapping mode. Instructs the diagnostic messages
1436 reporter to emit \fIonce\fR source location information; that is, in
1437 case the message is too long to fit on a single physical line and has to
1438 be wrapped, the source location won't be emitted (as prefix) again,
1439 over and over, in subsequent continuation lines. This is the default
1441 .Ip "\fB\-fdiagnostics-show-location=every-line\fR" 4
1442 .IX Item "-fdiagnostics-show-location=every-line"
1443 Only meaningful in line-wrapping mode. Instructs the diagnostic
1444 messages reporter to emit the same source location information (as
1445 prefix) for physical lines that result from the process of breaking a
1446 a message which is too long to fit on a single line.
1447 .Sh "Options to Request or Suppress Warnings"
1448 .IX Subsection "Options to Request or Suppress Warnings"
1449 Warnings are diagnostic messages that report constructions which
1450 are not inherently erroneous but which are risky or suggest there
1451 may have been an error.
1453 You can request many specific warnings with options beginning \fB\-W\fR,
1454 for example \fB\-Wimplicit\fR to request warnings on implicit
1455 declarations. Each of these specific warning options also has a
1456 negative form beginning \fB\-Wno-\fR to turn off warnings;
1457 for example, \fB\-Wno-implicit\fR. This manual lists only one of the
1458 two forms, whichever is not the default.
1460 These options control the amount and kinds of warnings produced by \s-1GCC:\s0
1461 .Ip "\fB\-fsyntax-only\fR" 4
1462 .IX Item "-fsyntax-only"
1463 Check the code for syntax errors, but don't do anything beyond that.
1464 .Ip "\fB\-pedantic\fR" 4
1465 .IX Item "-pedantic"
1466 Issue all the warnings demanded by strict \s-1ISO\s0 C and \s-1ISO\s0 \*(C+;
1467 reject all programs that use forbidden extensions, and some other
1468 programs that do not follow \s-1ISO\s0 C and \s-1ISO\s0 \*(C+. For \s-1ISO\s0 C, follows the
1469 version of the \s-1ISO\s0 C standard specified by any \fB\-std\fR option used.
1471 Valid \s-1ISO\s0 C and \s-1ISO\s0 \*(C+ programs should compile properly with or without
1472 this option (though a rare few will require \fB\-ansi\fR or a
1473 \&\fB\-std\fR option specifying the required version of \s-1ISO\s0 C). However,
1474 without this option, certain \s-1GNU\s0 extensions and traditional C and \*(C+
1475 features are supported as well. With this option, they are rejected.
1477 \&\fB\-pedantic\fR does not cause warning messages for use of the
1478 alternate keywords whose names begin and end with \fB_\|_\fR. Pedantic
1479 warnings are also disabled in the expression that follows
1480 \&\f(CW\*(C`_\|_extension_\|_\*(C'\fR. However, only system header files should use
1481 these escape routes; application programs should avoid them.
1483 Some users try to use \fB\-pedantic\fR to check programs for strict \s-1ISO\s0
1484 C conformance. They soon find that it does not do quite what they want:
1485 it finds some non-ISO practices, but not all\-\-\-only those for which
1486 \&\s-1ISO\s0 C \fIrequires\fR a diagnostic, and some others for which
1487 diagnostics have been added.
1489 A feature to report any failure to conform to \s-1ISO\s0 C might be useful in
1490 some instances, but would require considerable additional work and would
1491 be quite different from \fB\-pedantic\fR. We don't have plans to
1492 support such a feature in the near future.
1493 .Ip "\fB\-pedantic-errors\fR" 4
1494 .IX Item "-pedantic-errors"
1495 Like \fB\-pedantic\fR, except that errors are produced rather than
1499 Inhibit all warning messages.
1500 .Ip "\fB\-Wno-import\fR" 4
1501 .IX Item "-Wno-import"
1502 Inhibit warning messages about the use of \fB#import\fR.
1503 .Ip "\fB\-Wchar-subscripts\fR" 4
1504 .IX Item "-Wchar-subscripts"
1505 Warn if an array subscript has type \f(CW\*(C`char\*(C'\fR. This is a common cause
1506 of error, as programmers often forget that this type is signed on some
1508 .Ip "\fB\-Wcomment\fR" 4
1509 .IX Item "-Wcomment"
1510 Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR
1511 comment, or whenever a Backslash-Newline appears in a \fB//\fR comment.
1512 .Ip "\fB\-Wformat\fR" 4
1514 Check calls to \f(CW\*(C`printf\*(C'\fR and \f(CW\*(C`scanf\*(C'\fR, etc., to make sure that
1515 the arguments supplied have types appropriate to the format string
1516 specified, and that the conversions specified in the format string make
1517 sense. This includes standard functions, and others specified by format
1518 attributes, in the \f(CW\*(C`printf\*(C'\fR,
1519 \&\f(CW\*(C`scanf\*(C'\fR, \f(CW\*(C`strftime\*(C'\fR and \f(CW\*(C`strfmon\*(C'\fR (an X/Open extension,
1520 not in the C standard) families.
1522 The formats are checked against the format features supported by \s-1GNU\s0
1523 libc version 2.2. These include all \s-1ISO\s0 C89 and C99 features, as well
1524 as features from the Single Unix Specification and some \s-1BSD\s0 and \s-1GNU\s0
1525 extensions. Other library implementations may not support all these
1526 features; \s-1GCC\s0 does not support warning about features that go beyond a
1527 particular library's limitations. However, if \fB\-pedantic\fR is used
1528 with \fB\-Wformat\fR, warnings will be given about format features not
1529 in the selected standard version (but not for \f(CW\*(C`strfmon\*(C'\fR formats,
1530 since those are not in any version of the C standard).
1532 \&\fB\-Wformat\fR is included in \fB\-Wall\fR. For more control over some
1533 aspects of format checking, the options \fB\-Wno-format-y2k\fR,
1534 \&\fB\-Wno-format-extra-args\fR, \fB\-Wformat-nonliteral\fR,
1535 \&\fB\-Wformat-security\fR and \fB\-Wformat=2\fR are available, but are
1536 not included in \fB\-Wall\fR.
1537 .Ip "\fB\-Wno-format-y2k\fR" 4
1538 .IX Item "-Wno-format-y2k"
1539 If \fB\-Wformat\fR is specified, do not warn about \f(CW\*(C`strftime\*(C'\fR
1540 formats which may yield only a two-digit year.
1541 .Ip "\fB\-Wno-format-extra-args\fR" 4
1542 .IX Item "-Wno-format-extra-args"
1543 If \fB\-Wformat\fR is specified, do not warn about excess arguments to a
1544 \&\f(CW\*(C`printf\*(C'\fR or \f(CW\*(C`scanf\*(C'\fR format function. The C standard specifies
1545 that such arguments are ignored.
1546 .Ip "\fB\-Wformat-nonliteral\fR" 4
1547 .IX Item "-Wformat-nonliteral"
1548 If \fB\-Wformat\fR is specified, also warn if the format string is not a
1549 string literal and so cannot be checked, unless the format function
1550 takes its format arguments as a \f(CW\*(C`va_list\*(C'\fR.
1551 .Ip "\fB\-Wformat-security\fR" 4
1552 .IX Item "-Wformat-security"
1553 If \fB\-Wformat\fR is specified, also warn about uses of format
1554 functions that represent possible security problems. At present, this
1555 warns about calls to \f(CW\*(C`printf\*(C'\fR and \f(CW\*(C`scanf\*(C'\fR functions where the
1556 format string is not a string literal and there are no format arguments,
1557 as in \f(CW\*(C`printf (foo);\*(C'\fR. This may be a security hole if the format
1558 string came from untrusted input and contains \fB%n\fR. (This is
1559 currently a subset of what \fB\-Wformat-nonliteral\fR warns about, but
1560 in future warnings may be added to \fB\-Wformat-security\fR that are not
1561 included in \fB\-Wformat-nonliteral\fR.)
1562 .Ip "\fB\-Wformat=2\fR" 4
1563 .IX Item "-Wformat=2"
1564 Enable \fB\-Wformat\fR plus format checks not included in
1565 \&\fB\-Wformat\fR. Currently equivalent to \fB\-Wformat
1566 \&\-Wformat-nonliteral \-Wformat-security\fR.
1567 .Ip "\fB\-Wimplicit-int\fR" 4
1568 .IX Item "-Wimplicit-int"
1569 Warn when a declaration does not specify a type.
1570 .Ip "\fB\-Wimplicit-function-declaration\fR" 4
1571 .IX Item "-Wimplicit-function-declaration"
1573 .Ip "\fB\-Werror-implicit-function-declaration\fR" 4
1574 .IX Item "-Werror-implicit-function-declaration"
1576 Give a warning (or error) whenever a function is used before being
1578 .Ip "\fB\-Wimplicit\fR" 4
1579 .IX Item "-Wimplicit"
1580 Same as \fB\-Wimplicit-int\fR and \fB\-Wimplicit-function-\fR\fBdeclaration\fR.
1581 .Ip "\fB\-Wmain\fR" 4
1583 Warn if the type of \fBmain\fR is suspicious. \fBmain\fR should be a
1584 function with external linkage, returning int, taking either zero
1585 arguments, two, or three arguments of appropriate types.
1586 .Ip "\fB\-Wmissing-braces\fR" 4
1587 .IX Item "-Wmissing-braces"
1588 Warn if an aggregate or union initializer is not fully bracketed. In
1589 the following example, the initializer for \fBa\fR is not fully
1590 bracketed, but that for \fBb\fR is fully bracketed.
1593 \& int a[2][2] = { 0, 1, 2, 3 };
1594 \& int b[2][2] = { { 0, 1 }, { 2, 3 } };
1596 .Ip "\fB\-Wmultichar\fR" 4
1597 .IX Item "-Wmultichar"
1598 Warn if a multicharacter constant (\fB'\s-1FOOF\s0'\fR) is used. Usually they
1599 indicate a typo in the user's code, as they have implementation-defined
1600 values, and should not be used in portable code.
1601 .Ip "\fB\-Wparentheses\fR" 4
1602 .IX Item "-Wparentheses"
1603 Warn if parentheses are omitted in certain contexts, such
1604 as when there is an assignment in a context where a truth value
1605 is expected, or when operators are nested whose precedence people
1606 often get confused about.
1608 Also warn about constructions where there may be confusion to which
1609 \&\f(CW\*(C`if\*(C'\fR statement an \f(CW\*(C`else\*(C'\fR branch belongs. Here is an example of
1621 In C, every \f(CW\*(C`else\*(C'\fR branch belongs to the innermost possible \f(CW\*(C`if\*(C'\fR
1622 statement, which in this example is \f(CW\*(C`if (b)\*(C'\fR. This is often not
1623 what the programmer expected, as illustrated in the above example by
1624 indentation the programmer chose. When there is the potential for this
1625 confusion, \s-1GNU\s0 C will issue a warning when this flag is specified.
1626 To eliminate the warning, add explicit braces around the innermost
1627 \&\f(CW\*(C`if\*(C'\fR statement so there is no way the \f(CW\*(C`else\*(C'\fR could belong to
1628 the enclosing \f(CW\*(C`if\*(C'\fR. The resulting code would look like this:
1641 .Ip "\fB\-Wsequence-point\fR" 4
1642 .IX Item "-Wsequence-point"
1643 Warn about code that may have undefined semantics because of violations
1644 of sequence point rules in the C standard.
1646 The C standard defines the order in which expressions in a C program are
1647 evaluated in terms of \fIsequence points\fR, which represent a partial
1648 ordering between the execution of parts of the program: those executed
1649 before the sequence point, and those executed after it. These occur
1650 after the evaluation of a full expression (one which is not part of a
1651 larger expression), after the evaluation of the first operand of a
1652 \&\f(CW\*(C`&&\*(C'\fR, \f(CW\*(C`||\*(C'\fR, \f(CW\*(C`? :\*(C'\fR or \f(CW\*(C`,\*(C'\fR (comma) operator, before a
1653 function is called (but after the evaluation of its arguments and the
1654 expression denoting the called function), and in certain other places.
1655 Other than as expressed by the sequence point rules, the order of
1656 evaluation of subexpressions of an expression is not specified. All
1657 these rules describe only a partial order rather than a total order,
1658 since, for example, if two functions are called within one expression
1659 with no sequence point between them, the order in which the functions
1660 are called is not specified. However, the standards committee have
1661 ruled that function calls do not overlap.
1663 It is not specified when between sequence points modifications to the
1664 values of objects take effect. Programs whose behavior depends on this
1665 have undefined behavior; the C standard specifies that ``Between the
1666 previous and next sequence point an object shall have its stored value
1667 modified at most once by the evaluation of an expression. Furthermore,
1668 the prior value shall be read only to determine the value to be
1669 stored.''. If a program breaks these rules, the results on any
1670 particular implementation are entirely unpredictable.
1672 Examples of code with undefined behavior are \f(CW\*(C`a = a++;\*(C'\fR, \f(CW\*(C`a[n]
1673 = b[n++]\*(C'\fR and \f(CW\*(C`a[i++] = i;\*(C'\fR. Some more complicated cases are not
1674 diagnosed by this option, and it may give an occasional false positive
1675 result, but in general it has been found fairly effective at detecting
1676 this sort of problem in programs.
1678 The present implementation of this option only works for C programs. A
1679 future implementation may also work for \*(C+ programs.
1681 There is some controversy over the precise meaning of the sequence point
1682 rules in subtle cases. Alternative formal definitions may be found in
1683 Clive Feather's ``Annex S''
1684 <\fBhttp://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/n925.htm\fR> and in
1685 Michael Norrish's thesis
1686 <\fBhttp://www.cl.cam.ac.uk/users/mn200/PhD/thesis-report.ps.gz\fR>.
1687 Other discussions are by Raymond Mak
1688 <\fBhttp://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/n926.htm\fR> and
1690 <\fBhttp://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/n927.htm\fR>.
1691 .Ip "\fB\-Wreturn-type\fR" 4
1692 .IX Item "-Wreturn-type"
1693 Warn whenever a function is defined with a return-type that defaults to
1694 \&\f(CW\*(C`int\*(C'\fR. Also warn about any \f(CW\*(C`return\*(C'\fR statement with no
1695 return-value in a function whose return-type is not \f(CW\*(C`void\*(C'\fR.
1697 For \*(C+, a function without return type always produces a diagnostic
1698 message, even when \fB\-Wno-return-type\fR is specified. The only
1699 exceptions are \fBmain\fR and functions defined in system headers.
1700 .Ip "\fB\-Wswitch\fR" 4
1702 Warn whenever a \f(CW\*(C`switch\*(C'\fR statement has an index of enumeral type
1703 and lacks a \f(CW\*(C`case\*(C'\fR for one or more of the named codes of that
1704 enumeration. (The presence of a \f(CW\*(C`default\*(C'\fR label prevents this
1705 warning.) \f(CW\*(C`case\*(C'\fR labels outside the enumeration range also
1706 provoke warnings when this option is used.
1707 .Ip "\fB\-Wtrigraphs\fR" 4
1708 .IX Item "-Wtrigraphs"
1709 Warn if any trigraphs are encountered that might change the meaning of
1710 the program (trigraphs within comments are not warned about).
1711 .Ip "\fB\-Wunused-function\fR" 4
1712 .IX Item "-Wunused-function"
1713 Warn whenever a static function is declared but not defined or a
1714 non\e-inline static function is unused.
1715 .Ip "\fB\-Wunused-label\fR" 4
1716 .IX Item "-Wunused-label"
1717 Warn whenever a label is declared but not used.
1719 To suppress this warning use the \fBunused\fR attribute.
1720 .Ip "\fB\-Wunused-parameter\fR" 4
1721 .IX Item "-Wunused-parameter"
1722 Warn whenever a function parameter is unused aside from its declaration.
1724 To suppress this warning use the \fBunused\fR attribute.
1725 .Ip "\fB\-Wunused-variable\fR" 4
1726 .IX Item "-Wunused-variable"
1727 Warn whenever a local variable or non-constant static variable is unused
1728 aside from its declaration
1730 To suppress this warning use the \fBunused\fR attribute.
1731 .Ip "\fB\-Wunused-value\fR" 4
1732 .IX Item "-Wunused-value"
1733 Warn whenever a statement computes a result that is explicitly not used.
1735 To suppress this warning cast the expression to \fBvoid\fR.
1736 .Ip "\fB\-Wunused\fR" 4
1738 All all the above \fB\-Wunused\fR options combined.
1740 In order to get a warning about an unused function parameter, you must
1741 either specify \fB\-W \-Wunused\fR or separately specify
1742 \&\fB\-Wunused-parameter\fR.
1743 .Ip "\fB\-Wuninitialized\fR" 4
1744 .IX Item "-Wuninitialized"
1745 Warn if an automatic variable is used without first being initialized or
1746 if a variable may be clobbered by a \f(CW\*(C`setjmp\*(C'\fR call.
1748 These warnings are possible only in optimizing compilation,
1749 because they require data flow information that is computed only
1750 when optimizing. If you don't specify \fB\-O\fR, you simply won't
1753 These warnings occur only for variables that are candidates for
1754 register allocation. Therefore, they do not occur for a variable that
1755 is declared \f(CW\*(C`volatile\*(C'\fR, or whose address is taken, or whose size
1756 is other than 1, 2, 4 or 8 bytes. Also, they do not occur for
1757 structures, unions or arrays, even when they are in registers.
1759 Note that there may be no warning about a variable that is used only
1760 to compute a value that itself is never used, because such
1761 computations may be deleted by data flow analysis before the warnings
1764 These warnings are made optional because \s-1GCC\s0 is not smart
1765 enough to see all the reasons why the code might be correct
1766 despite appearing to have an error. Here is one example of how
1783 If the value of \f(CW\*(C`y\*(C'\fR is always 1, 2 or 3, then \f(CW\*(C`x\*(C'\fR is
1784 always initialized, but \s-1GCC\s0 doesn't know this. Here is
1785 another common case:
1790 \& if (change_y) save_y = y, y = new_y;
1792 \& if (change_y) y = save_y;
1795 This has no bug because \f(CW\*(C`save_y\*(C'\fR is used only if it is set.
1797 This option also warns when a non-volatile automatic variable might be
1798 changed by a call to \f(CW\*(C`longjmp\*(C'\fR. These warnings as well are possible
1799 only in optimizing compilation.
1801 The compiler sees only the calls to \f(CW\*(C`setjmp\*(C'\fR. It cannot know
1802 where \f(CW\*(C`longjmp\*(C'\fR will be called; in fact, a signal handler could
1803 call it at any point in the code. As a result, you may get a warning
1804 even when there is in fact no problem because \f(CW\*(C`longjmp\*(C'\fR cannot
1805 in fact be called at the place which would cause a problem.
1807 Some spurious warnings can be avoided if you declare all the functions
1808 you use that never return as \f(CW\*(C`noreturn\*(C'\fR.
1809 .Ip "\fB\-Wreorder (\*(C+ only)\fR" 4
1810 .IX Item "-Wreorder ( only)"
1811 Warn when the order of member initializers given in the code does not
1812 match the order in which they must be executed. For instance:
1813 .Ip "\fB\-Wunknown-pragmas\fR" 4
1814 .IX Item "-Wunknown-pragmas"
1815 Warn when a #pragma directive is encountered which is not understood by
1816 \&\s-1GCC\s0. If this command line option is used, warnings will even be issued
1817 for unknown pragmas in system header files. This is not the case if
1818 the warnings were only enabled by the \fB\-Wall\fR command line option.
1819 .Ip "\fB\-Wall\fR" 4
1821 All of the above \fB\-W\fR options combined. This enables all the
1822 warnings about constructions that some users consider questionable, and
1823 that are easy to avoid (or modify to prevent the warning), even in
1824 conjunction with macros.
1825 .Ip "\fB\-Wsystem-headers\fR" 4
1826 .IX Item "-Wsystem-headers"
1827 Print warning messages for constructs found in system header files.
1828 Warnings from system headers are normally suppressed, on the assumption
1829 that they usually do not indicate real problems and would only make the
1830 compiler output harder to read. Using this command line option tells
1831 \&\s-1GCC\s0 to emit warnings from system headers as if they occurred in user
1832 code. However, note that using \fB\-Wall\fR in conjunction with this
1833 option will \fInot\fR warn about unknown pragmas in system
1834 headers\-\-\-for that, \fB\-Wunknown-pragmas\fR must also be used.
1836 The following \fB\-W...\fR options are not implied by \fB\-Wall\fR.
1837 Some of them warn about constructions that users generally do not
1838 consider questionable, but which occasionally you might wish to check
1839 for; others warn about constructions that are necessary or hard to avoid
1840 in some cases, and there is no simple way to modify the code to suppress
1844 Print extra warning messages for these events:
1847 A function can return either with or without a value. (Falling
1848 off the end of the function body is considered returning without
1849 a value.) For example, this function would evoke such a
1860 An expression-statement or the left-hand side of a comma expression
1861 contains no side effects.
1862 To suppress the warning, cast the unused expression to void.
1863 For example, an expression such as \fBx[i,j]\fR will cause a warning,
1864 but \fBx[(void)i,j]\fR will not.
1866 An unsigned value is compared against zero with \fB<\fR or \fB<=\fR.
1868 A comparison like \fBx<=y<=z\fR appears; this is equivalent to
1869 \&\fB(x<=y ? 1 : 0) <= z\fR, which is a different interpretation from
1870 that of ordinary mathematical notation.
1872 Storage-class specifiers like \f(CW\*(C`static\*(C'\fR are not the first things in
1873 a declaration. According to the C Standard, this usage is obsolescent.
1875 The return type of a function has a type qualifier such as \f(CW\*(C`const\*(C'\fR.
1876 Such a type qualifier has no effect, since the value returned by a
1877 function is not an lvalue. (But don't warn about the \s-1GNU\s0 extension of
1878 \&\f(CW\*(C`volatile void\*(C'\fR return types. That extension will be warned about
1879 if \fB\-pedantic\fR is specified.)
1881 If \fB\-Wall\fR or \fB\-Wunused\fR is also specified, warn about unused
1884 A comparison between signed and unsigned values could produce an
1885 incorrect result when the signed value is converted to unsigned.
1886 (But don't warn if \fB\-Wno-sign-compare\fR is also specified.)
1888 An aggregate has a partly bracketed initializer.
1889 For example, the following code would evoke such a warning,
1890 because braces are missing around the initializer for \f(CW\*(C`x.h\*(C'\fR:
1893 \& struct s { int f, g; };
1894 \& struct t { struct s h; int i; };
1895 \& struct t x = { 1, 2, 3 };
1898 An aggregate has an initializer which does not initialize all members.
1899 For example, the following code would cause such a warning, because
1900 \&\f(CW\*(C`x.h\*(C'\fR would be implicitly initialized to zero:
1903 \& struct s { int f, g, h; };
1904 \& struct s x = { 3, 4 };
1909 .Ip "\fB\-Wfloat-equal\fR" 4
1910 .IX Item "-Wfloat-equal"
1911 Warn if floating point values are used in equality comparisons.
1913 The idea behind this is that sometimes it is convenient (for the
1914 programmer) to consider floating-point values as approximations to
1915 infinitely precise real numbers. If you are doing this, then you need
1916 to compute (by analysing the code, or in some other way) the maximum or
1917 likely maximum error that the computation introduces, and allow for it
1918 when performing comparisons (and when producing output, but that's a
1919 different problem). In particular, instead of testing for equality, you
1920 would check to see whether the two values have ranges that overlap; and
1921 this is done with the relational operators, so equality comparisons are
1923 .Ip "\fB\-Wtraditional (C only)\fR" 4
1924 .IX Item "-Wtraditional (C only)"
1925 Warn about certain constructs that behave differently in traditional and
1926 \&\s-1ISO\s0 C. Also warn about \s-1ISO\s0 C constructs that have no traditional C
1927 equivalent, and/or problematic constructs which should be avoided.
1930 Macro parameters that appear within string literals in the macro body.
1931 In traditional C macro replacement takes place within string literals,
1932 but does not in \s-1ISO\s0 C.
1934 In traditional C, some preprocessor directives did not exist.
1935 Traditional preprocessors would only consider a line to be a directive
1936 if the \fB#\fR appeared in column 1 on the line. Therefore
1937 \&\fB\-Wtraditional\fR warns about directives that traditional C
1938 understands but would ignore because the \fB#\fR does not appear as the
1939 first character on the line. It also suggests you hide directives like
1940 \&\fB#pragma\fR not understood by traditional C by indenting them. Some
1941 traditional implementations would not recognise \fB#elif\fR, so it
1942 suggests avoiding it altogether.
1944 A function-like macro that appears without arguments.
1946 The unary plus operator.
1948 The `U' integer constant suffix, or the `F' or `L' floating point
1949 constant suffixes. (Traditonal C does support the `L' suffix on integer
1950 constants.) Note, these suffixes appear in macros defined in the system
1951 headers of most modern systems, e.g. the _MIN/_MAX macros in limits.h.
1952 Use of these macros in user code might normally lead to spurious
1953 warnings, however gcc's integrated preprocessor has enough context to
1954 avoid warning in these cases.
1956 A function declared external in one block and then used after the end of
1959 A \f(CW\*(C`switch\*(C'\fR statement has an operand of type \f(CW\*(C`long\*(C'\fR.
1961 A non-\f(CW\*(C`static\*(C'\fR function declaration follows a \f(CW\*(C`static\*(C'\fR one.
1962 This construct is not accepted by some traditional C compilers.
1964 The \s-1ISO\s0 type of an integer constant has a different width or
1965 signedness from its traditional type. This warning is only issued if
1966 the base of the constant is ten. I.e. hexadecimal or octal values, which
1967 typically represent bit patterns, are not warned about.
1969 Usage of \s-1ISO\s0 string concatenation is detected.
1971 Initialization of automatic aggregates.
1973 Identifier conflicts with labels. Traditional C lacks a separate
1974 namespace for labels.
1976 Initialization of unions. If the initializer is zero, the warning is
1977 omitted. This is done under the assumption that the zero initializer in
1978 user code appears conditioned on e.g. \f(CW\*(C`_\|_STDC_\|_\*(C'\fR to avoid missing
1979 initializer warnings and relies on default initialization to zero in the
1982 Conversions by prototypes between fixed/floating point values and vice
1983 versa. The absence of these prototypes when compiling with traditional
1984 C would cause serious problems. This is a subset of the possible
1985 conversion warnings, for the full set use \fB\-Wconversion\fR.
1989 .Ip "\fB\-Wundef\fR" 4
1991 Warn if an undefined identifier is evaluated in an \fB#if\fR directive.
1992 .Ip "\fB\-Wshadow\fR" 4
1994 Warn whenever a local variable shadows another local variable, parameter or
1995 global variable or whenever a built-in function is shadowed.
1996 .Ip "\fB\-Wid-clash-\fR\fIlen\fR" 4
1997 .IX Item "-Wid-clash-len"
1998 Warn whenever two distinct identifiers match in the first \fIlen\fR
1999 characters. This may help you prepare a program that will compile
2000 with certain obsolete, brain-damaged compilers.
2001 .Ip "\fB\-Wlarger-than-\fR\fIlen\fR" 4
2002 .IX Item "-Wlarger-than-len"
2003 Warn whenever an object of larger than \fIlen\fR bytes is defined.
2004 .Ip "\fB\-Wpointer-arith\fR" 4
2005 .IX Item "-Wpointer-arith"
2006 Warn about anything that depends on the ``size of'' a function type or
2007 of \f(CW\*(C`void\*(C'\fR. \s-1GNU\s0 C assigns these types a size of 1, for
2008 convenience in calculations with \f(CW\*(C`void *\*(C'\fR pointers and pointers
2010 .Ip "\fB\-Wbad-function-cast (C only)\fR" 4
2011 .IX Item "-Wbad-function-cast (C only)"
2012 Warn whenever a function call is cast to a non-matching type.
2013 For example, warn if \f(CW\*(C`int malloc()\*(C'\fR is cast to \f(CW\*(C`anything *\*(C'\fR.
2014 .Ip "\fB\-Wcast-qual\fR" 4
2015 .IX Item "-Wcast-qual"
2016 Warn whenever a pointer is cast so as to remove a type qualifier from
2017 the target type. For example, warn if a \f(CW\*(C`const char *\*(C'\fR is cast
2018 to an ordinary \f(CW\*(C`char *\*(C'\fR.
2019 .Ip "\fB\-Wcast-align\fR" 4
2020 .IX Item "-Wcast-align"
2021 Warn whenever a pointer is cast such that the required alignment of the
2022 target is increased. For example, warn if a \f(CW\*(C`char *\*(C'\fR is cast to
2023 an \f(CW\*(C`int *\*(C'\fR on machines where integers can only be accessed at
2024 two- or four-byte boundaries.
2025 .Ip "\fB\-Wwrite-strings\fR" 4
2026 .IX Item "-Wwrite-strings"
2027 Give string constants the type \f(CW\*(C`const char[\f(CIlength\f(CW]\*(C'\fR so that
2028 copying the address of one into a non-\f(CW\*(C`const\*(C'\fR \f(CW\*(C`char *\*(C'\fR
2029 pointer will get a warning. These warnings will help you find at
2030 compile time code that can try to write into a string constant, but
2031 only if you have been very careful about using \f(CW\*(C`const\*(C'\fR in
2032 declarations and prototypes. Otherwise, it will just be a nuisance;
2033 this is why we did not make \fB\-Wall\fR request these warnings.
2034 .Ip "\fB\-Wconversion\fR" 4
2035 .IX Item "-Wconversion"
2036 Warn if a prototype causes a type conversion that is different from what
2037 would happen to the same argument in the absence of a prototype. This
2038 includes conversions of fixed point to floating and vice versa, and
2039 conversions changing the width or signedness of a fixed point argument
2040 except when the same as the default promotion.
2042 Also, warn if a negative integer constant expression is implicitly
2043 converted to an unsigned type. For example, warn about the assignment
2044 \&\f(CW\*(C`x = \-1\*(C'\fR if \f(CW\*(C`x\*(C'\fR is unsigned. But do not warn about explicit
2045 casts like \f(CW\*(C`(unsigned) \-1\*(C'\fR.
2046 .Ip "\fB\-Wsign-compare\fR" 4
2047 .IX Item "-Wsign-compare"
2048 Warn when a comparison between signed and unsigned values could produce
2049 an incorrect result when the signed value is converted to unsigned.
2050 This warning is also enabled by \fB\-W\fR; to get the other warnings
2051 of \fB\-W\fR without this warning, use \fB\-W \-Wno-sign-compare\fR.
2052 .Ip "\fB\-Waggregate-return\fR" 4
2053 .IX Item "-Waggregate-return"
2054 Warn if any functions that return structures or unions are defined or
2055 called. (In languages where you can return an array, this also elicits
2057 .Ip "\fB\-Wstrict-prototypes (C only)\fR" 4
2058 .IX Item "-Wstrict-prototypes (C only)"
2059 Warn if a function is declared or defined without specifying the
2060 argument types. (An old-style function definition is permitted without
2061 a warning if preceded by a declaration which specifies the argument
2063 .Ip "\fB\-Wmissing-prototypes (C only)\fR" 4
2064 .IX Item "-Wmissing-prototypes (C only)"
2065 Warn if a global function is defined without a previous prototype
2066 declaration. This warning is issued even if the definition itself
2067 provides a prototype. The aim is to detect global functions that fail
2068 to be declared in header files.
2069 .Ip "\fB\-Wmissing-declarations\fR" 4
2070 .IX Item "-Wmissing-declarations"
2071 Warn if a global function is defined without a previous declaration.
2072 Do so even if the definition itself provides a prototype.
2073 Use this option to detect global functions that are not declared in
2075 .Ip "\fB\-Wmissing-noreturn\fR" 4
2076 .IX Item "-Wmissing-noreturn"
2077 Warn about functions which might be candidates for attribute \f(CW\*(C`noreturn\*(C'\fR.
2078 Note these are only possible candidates, not absolute ones. Care should
2079 be taken to manually verify functions actually do not ever return before
2080 adding the \f(CW\*(C`noreturn\*(C'\fR attribute, otherwise subtle code generation
2081 bugs could be introduced. You will not get a warning for \f(CW\*(C`main\*(C'\fR in
2082 hosted C environments.
2083 .Ip "\fB\-Wmissing-format-attribute\fR" 4
2084 .IX Item "-Wmissing-format-attribute"
2085 If \fB\-Wformat\fR is enabled, also warn about functions which might be
2086 candidates for \f(CW\*(C`format\*(C'\fR attributes. Note these are only possible
2087 candidates, not absolute ones. \s-1GCC\s0 will guess that \f(CW\*(C`format\*(C'\fR
2088 attributes might be appropriate for any function that calls a function
2089 like \f(CW\*(C`vprintf\*(C'\fR or \f(CW\*(C`vscanf\*(C'\fR, but this might not always be the
2090 case, and some functions for which \f(CW\*(C`format\*(C'\fR attributes are
2091 appropriate may not be detected. This option has no effect unless
2092 \&\fB\-Wformat\fR is enabled (possibly by \fB\-Wall\fR).
2093 .Ip "\fB\-Wpacked\fR" 4
2095 Warn if a structure is given the packed attribute, but the packed
2096 attribute has no effect on the layout or size of the structure.
2097 Such structures may be mis-aligned for little benefit. For
2098 instance, in this code, the variable \f(CW\*(C`f.x\*(C'\fR in \f(CW\*(C`struct bar\*(C'\fR
2099 will be misaligned even though \f(CW\*(C`struct bar\*(C'\fR does not itself
2100 have the packed attribute:
2106 \& } __attribute__((packed));
2112 .Ip "\fB\-Wpadded\fR" 4
2114 Warn if padding is included in a structure, either to align an element
2115 of the structure or to align the whole structure. Sometimes when this
2116 happens it is possible to rearrange the fields of the structure to
2117 reduce the padding and so make the structure smaller.
2118 .Ip "\fB\-Wredundant-decls\fR" 4
2119 .IX Item "-Wredundant-decls"
2120 Warn if anything is declared more than once in the same scope, even in
2121 cases where multiple declaration is valid and changes nothing.
2122 .Ip "\fB\-Wnested-externs (C only)\fR" 4
2123 .IX Item "-Wnested-externs (C only)"
2124 Warn if an \f(CW\*(C`extern\*(C'\fR declaration is encountered within a function.
2125 .Ip "\fB\-Wunreachable-code\fR" 4
2126 .IX Item "-Wunreachable-code"
2127 Warn if the compiler detects that code will never be executed.
2129 This option is intended to warn when the compiler detects that at
2130 least a whole line of source code will never be executed, because
2131 some condition is never satisfied or because it is after a
2132 procedure that never returns.
2134 It is possible for this option to produce a warning even though there
2135 are circumstances under which part of the affected line can be executed,
2136 so care should be taken when removing apparently-unreachable code.
2138 For instance, when a function is inlined, a warning may mean that the
2139 line is unreachable in only one inlined copy of the function.
2141 This option is not made part of \fB\-Wall\fR because in a debugging
2142 version of a program there is often substantial code which checks
2143 correct functioning of the program and is, hopefully, unreachable
2144 because the program does work. Another common use of unreachable
2145 code is to provide behaviour which is selectable at compile-time.
2146 .Ip "\fB\-Winline\fR" 4
2148 Warn if a function can not be inlined and it was declared as inline.
2149 .Ip "\fB\-Wlong-long\fR" 4
2150 .IX Item "-Wlong-long"
2151 Warn if \fBlong long\fR type is used. This is default. To inhibit
2152 the warning messages, use \fB\-Wno-long-long\fR. Flags
2153 \&\fB\-Wlong-long\fR and \fB\-Wno-long-long\fR are taken into account
2154 only when \fB\-pedantic\fR flag is used.
2155 .Ip "\fB\-Wdisabled-optimization\fR" 4
2156 .IX Item "-Wdisabled-optimization"
2157 Warn if a requested optimization pass is disabled. This warning does
2158 not generally indicate that there is anything wrong with your code; it
2159 merely indicates that \s-1GCC\s0's optimizers were unable to handle the code
2160 effectively. Often, the problem is that your code is too big or too
2161 complex; \s-1GCC\s0 will refuse to optimize programs when the optimization
2162 itself is likely to take inordinate amounts of time.
2163 .Ip "\fB\-Werror\fR" 4
2165 Make all warnings into errors.
2166 .Sh "Options for Debugging Your Program or \s-1GCC\s0"
2167 .IX Subsection "Options for Debugging Your Program or GCC"
2168 \&\s-1GCC\s0 has various special options that are used for debugging
2169 either your program or \s-1GCC:\s0
2172 Produce debugging information in the operating system's native format
2173 (stabs, \s-1COFF\s0, \s-1XCOFF\s0, or \s-1DWARF\s0). \s-1GDB\s0 can work with this debugging
2176 On most systems that use stabs format, \fB\-g\fR enables use of extra
2177 debugging information that only \s-1GDB\s0 can use; this extra information
2178 makes debugging work better in \s-1GDB\s0 but will probably make other debuggers
2180 refuse to read the program. If you want to control for certain whether
2181 to generate the extra information, use \fB\-gstabs+\fR, \fB\-gstabs\fR,
2182 \&\fB\-gxcoff+\fR, \fB\-gxcoff\fR, \fB\-gdwarf-1+\fR, or \fB\-gdwarf-1\fR
2185 Unlike most other C compilers, \s-1GCC\s0 allows you to use \fB\-g\fR with
2186 \&\fB\-O\fR. The shortcuts taken by optimized code may occasionally
2187 produce surprising results: some variables you declared may not exist
2188 at all; flow of control may briefly move where you did not expect it;
2189 some statements may not be executed because they compute constant
2190 results or their values were already at hand; some statements may
2191 execute in different places because they were moved out of loops.
2193 Nevertheless it proves possible to debug optimized output. This makes
2194 it reasonable to use the optimizer for programs that might have bugs.
2196 The following options are useful when \s-1GCC\s0 is generated with the
2197 capability for more than one debugging format.
2198 .Ip "\fB\-ggdb\fR" 4
2200 Produce debugging information for use by \s-1GDB\s0. This means to use the
2201 most expressive format available (\s-1DWARF\s0 2, stabs, or the native format
2202 if neither of those are supported), including \s-1GDB\s0 extensions if at all
2204 .Ip "\fB\-gstabs\fR" 4
2206 Produce debugging information in stabs format (if that is supported),
2207 without \s-1GDB\s0 extensions. This is the format used by \s-1DBX\s0 on most \s-1BSD\s0
2208 systems. On \s-1MIPS\s0, Alpha and System V Release 4 systems this option
2209 produces stabs debugging output which is not understood by \s-1DBX\s0 or \s-1SDB\s0.
2210 On System V Release 4 systems this option requires the \s-1GNU\s0 assembler.
2211 .Ip "\fB\-gstabs+\fR" 4
2213 Produce debugging information in stabs format (if that is supported),
2214 using \s-1GNU\s0 extensions understood only by the \s-1GNU\s0 debugger (\s-1GDB\s0). The
2215 use of these extensions is likely to make other debuggers crash or
2216 refuse to read the program.
2217 .Ip "\fB\-gcoff\fR" 4
2219 Produce debugging information in \s-1COFF\s0 format (if that is supported).
2220 This is the format used by \s-1SDB\s0 on most System V systems prior to
2222 .Ip "\fB\-gxcoff\fR" 4
2224 Produce debugging information in \s-1XCOFF\s0 format (if that is supported).
2225 This is the format used by the \s-1DBX\s0 debugger on \s-1IBM\s0 \s-1RS/6000\s0 systems.
2226 .Ip "\fB\-gxcoff+\fR" 4
2228 Produce debugging information in \s-1XCOFF\s0 format (if that is supported),
2229 using \s-1GNU\s0 extensions understood only by the \s-1GNU\s0 debugger (\s-1GDB\s0). The
2230 use of these extensions is likely to make other debuggers crash or
2231 refuse to read the program, and may cause assemblers other than the \s-1GNU\s0
2232 assembler (\s-1GAS\s0) to fail with an error.
2233 .Ip "\fB\-gdwarf\fR" 4
2235 Produce debugging information in \s-1DWARF\s0 version 1 format (if that is
2236 supported). This is the format used by \s-1SDB\s0 on most System V Release 4
2238 .Ip "\fB\-gdwarf+\fR" 4
2240 Produce debugging information in \s-1DWARF\s0 version 1 format (if that is
2241 supported), using \s-1GNU\s0 extensions understood only by the \s-1GNU\s0 debugger
2242 (\s-1GDB\s0). The use of these extensions is likely to make other debuggers
2243 crash or refuse to read the program.
2244 .Ip "\fB\-gdwarf-2\fR" 4
2245 .IX Item "-gdwarf-2"
2246 Produce debugging information in \s-1DWARF\s0 version 2 format (if that is
2247 supported). This is the format used by \s-1DBX\s0 on \s-1IRIX\s0 6.
2248 .Ip "\fB\-g\fR\fIlevel\fR" 4
2251 .Ip "\fB\-ggdb\fR\fIlevel\fR" 4
2252 .IX Item "-ggdblevel"
2253 .Ip "\fB\-gstabs\fR\fIlevel\fR" 4
2254 .IX Item "-gstabslevel"
2255 .Ip "\fB\-gcoff\fR\fIlevel\fR" 4
2256 .IX Item "-gcofflevel"
2257 .Ip "\fB\-gxcoff\fR\fIlevel\fR" 4
2258 .IX Item "-gxcofflevel"
2259 .Ip "\fB\-gdwarf\fR\fIlevel\fR" 4
2260 .IX Item "-gdwarflevel"
2261 .Ip "\fB\-gdwarf-2\fR\fIlevel\fR" 4
2262 .IX Item "-gdwarf-2level"
2264 Request debugging information and also use \fIlevel\fR to specify how
2265 much information. The default level is 2.
2267 Level 1 produces minimal information, enough for making backtraces in
2268 parts of the program that you don't plan to debug. This includes
2269 descriptions of functions and external variables, but no information
2270 about local variables and no line numbers.
2272 Level 3 includes extra information, such as all the macro definitions
2273 present in the program. Some debuggers support macro expansion when
2277 Generate extra code to write profile information suitable for the
2278 analysis program \f(CW\*(C`prof\*(C'\fR. You must use this option when compiling
2279 the source files you want data about, and you must also use it when
2283 Generate extra code to write profile information suitable for the
2284 analysis program \f(CW\*(C`gprof\*(C'\fR. You must use this option when compiling
2285 the source files you want data about, and you must also use it when
2289 Generate extra code to write profile information for basic blocks, which will
2290 record the number of times each basic block is executed, the basic block start
2291 address, and the function name containing the basic block. If \fB\-g\fR is
2292 used, the line number and filename of the start of the basic block will also be
2293 recorded. If not overridden by the machine description, the default action is
2294 to append to the text file \fIbb.out\fR.
2296 This data could be analyzed by a program like \f(CW\*(C`tcov\*(C'\fR. Note,
2297 however, that the format of the data is not what \f(CW\*(C`tcov\*(C'\fR expects.
2298 Eventually \s-1GNU\s0 \f(CW\*(C`gprof\*(C'\fR should be extended to process this data.
2301 Makes the compiler print out each function name as it is compiled, and
2302 print some statistics about each pass when it finishes.
2303 .Ip "\fB\-ftime-report\fR" 4
2304 .IX Item "-ftime-report"
2305 Makes the compiler print some statistics about the time consumed by each
2306 pass when it finishes.
2307 .Ip "\fB\-fmem-report\fR" 4
2308 .IX Item "-fmem-report"
2309 Makes the compiler print some statistics about permanent memory
2310 allocation when it finishes.
2313 Generate extra code to profile basic blocks. Your executable will
2314 produce output that is a superset of that produced when \fB\-a\fR is
2315 used. Additional output is the source and target address of the basic
2316 blocks where a jump takes place, the number of times a jump is executed,
2317 and (optionally) the complete sequence of basic blocks being executed.
2318 The output is appended to file \fIbb.out\fR.
2320 You can examine different profiling aspects without recompilation. Your
2321 executable will read a list of function names from file \fIbb.in\fR.
2322 Profiling starts when a function on the list is entered and stops when
2323 that invocation is exited. To exclude a function from profiling, prefix
2324 its name with `\-'. If a function name is not unique, you can
2325 disambiguate it by writing it in the form
2326 \&\fB/path/filename.d:functionname\fR. Your executable will write the
2327 available paths and filenames in file \fIbb.out\fR.
2329 Several function names have a special meaning:
2331 .if n .Ip "\f(CW""""_\|_bb_jumps_\|_""""\fR" 4
2332 .el .Ip "\f(CW_\|_bb_jumps_\|_\fR" 4
2333 .IX Item "__bb_jumps__"
2334 Write source, target and frequency of jumps to file \fIbb.out\fR.
2335 .if n .Ip "\f(CW""""_\|_bb_hidecall_\|_""""\fR" 4
2336 .el .Ip "\f(CW_\|_bb_hidecall_\|_\fR" 4
2337 .IX Item "__bb_hidecall__"
2338 Exclude function calls from frequency count.
2339 .if n .Ip "\f(CW""""_\|_bb_showret_\|_""""\fR" 4
2340 .el .Ip "\f(CW_\|_bb_showret_\|_\fR" 4
2341 .IX Item "__bb_showret__"
2342 Include function returns in frequency count.
2343 .if n .Ip "\f(CW""""_\|_bb_trace_\|_""""\fR" 4
2344 .el .Ip "\f(CW_\|_bb_trace_\|_\fR" 4
2345 .IX Item "__bb_trace__"
2346 Write the sequence of basic blocks executed to file \fIbbtrace.gz\fR.
2347 The file will be compressed using the program \fBgzip\fR, which must
2348 exist in your \fB\s-1PATH\s0\fR. On systems without the \fBpopen\fR
2349 function, the file will be named \fIbbtrace\fR and will not be
2350 compressed. \fBProfiling for even a few seconds on these systems
2351 will produce a very large file.\fR Note: \f(CW\*(C`_\|_bb_hidecall_\|_\*(C'\fR and
2352 \&\f(CW\*(C`_\|_bb_showret_\|_\*(C'\fR will not affect the sequence written to
2357 Here's a short example using different profiling parameters
2358 in file \fIbb.in\fR. Assume function \f(CW\*(C`foo\*(C'\fR consists of basic blocks
2359 1 and 2 and is called twice from block 3 of function \f(CW\*(C`main\*(C'\fR. After
2360 the calls, block 3 transfers control to block 4 of \f(CW\*(C`main\*(C'\fR.
2362 With \f(CW\*(C`_\|_bb_trace_\|_\*(C'\fR and \f(CW\*(C`main\*(C'\fR contained in file \fIbb.in\fR,
2363 the following sequence of blocks is written to file \fIbbtrace.gz\fR:
2364 0 3 1 2 1 2 4. The return from block 2 to block 3 is not shown, because
2365 the return is to a point inside the block and not to the top. The
2366 block address 0 always indicates, that control is transferred
2367 to the trace from somewhere outside the observed functions. With
2368 \&\fB\-foo\fR added to \fIbb.in\fR, the blocks of function
2369 \&\f(CW\*(C`foo\*(C'\fR are removed from the trace, so only 0 3 4 remains.
2371 With \f(CW\*(C`_\|_bb_jumps_\|_\*(C'\fR and \f(CW\*(C`main\*(C'\fR contained in file \fIbb.in\fR,
2372 jump frequencies will be written to file \fIbb.out\fR. The
2373 frequencies are obtained by constructing a trace of blocks
2374 and incrementing a counter for every neighbouring pair of blocks
2375 in the trace. The trace 0 3 1 2 1 2 4 displays the following
2379 \& Jump from block 0x0 to block 0x3 executed 1 time(s)
2380 \& Jump from block 0x3 to block 0x1 executed 1 time(s)
2381 \& Jump from block 0x1 to block 0x2 executed 2 time(s)
2382 \& Jump from block 0x2 to block 0x1 executed 1 time(s)
2383 \& Jump from block 0x2 to block 0x4 executed 1 time(s)
2385 With \f(CW\*(C`_\|_bb_hidecall_\|_\*(C'\fR, control transfer due to call instructions
2386 is removed from the trace, that is the trace is cut into three parts: 0
2387 3 4, 0 1 2 and 0 1 2. With \f(CW\*(C`_\|_bb_showret_\|_\*(C'\fR, control transfer due
2388 to return instructions is added to the trace. The trace becomes: 0 3 1
2389 2 3 1 2 3 4. Note, that this trace is not the same, as the sequence
2390 written to \fIbbtrace.gz\fR. It is solely used for counting jump
2393 .Ip "\fB\-fprofile-arcs\fR" 4
2394 .IX Item "-fprofile-arcs"
2395 Instrument \fIarcs\fR during compilation. For each function of your
2396 program, \s-1GCC\s0 creates a program flow graph, then finds a spanning tree
2397 for the graph. Only arcs that are not on the spanning tree have to be
2398 instrumented: the compiler adds code to count the number of times that these
2399 arcs are executed. When an arc is the only exit or only entrance to a
2400 block, the instrumentation code can be added to the block; otherwise, a
2401 new basic block must be created to hold the instrumentation code.
2403 Since not every arc in the program must be instrumented, programs
2404 compiled with this option run faster than programs compiled with
2405 \&\fB\-a\fR, which adds instrumentation code to every basic block in the
2406 program. The tradeoff: since \f(CW\*(C`gcov\*(C'\fR does not have
2407 execution counts for all branches, it must start with the execution
2408 counts for the instrumented branches, and then iterate over the program
2409 flow graph until the entire graph has been solved. Hence, \f(CW\*(C`gcov\*(C'\fR
2410 runs a little more slowly than a program which uses information from
2413 \&\fB\-fprofile-arcs\fR also makes it possible to estimate branch
2414 probabilities, and to calculate basic block execution counts. In
2415 general, basic block execution counts do not give enough information to
2416 estimate all branch probabilities. When the compiled program exits, it
2417 saves the arc execution counts to a file called
2418 \&\fI\fIsourcename\fI.da\fR. Use the compiler option
2419 \&\fB\-fbranch-probabilities\fR when recompiling, to optimize using estimated
2420 branch probabilities.
2421 .Ip "\fB\-ftest-coverage\fR" 4
2422 .IX Item "-ftest-coverage"
2423 Create data files for the \f(CW\*(C`gcov\*(C'\fR code-coverage utility.
2424 The data file names begin with the name of your source file:
2426 .Ip "\fIsourcename\fR\fB.bb\fR" 4
2427 .IX Item "sourcename.bb"
2428 A mapping from basic blocks to line numbers, which \f(CW\*(C`gcov\*(C'\fR uses to
2429 associate basic block execution counts with line numbers.
2430 .Ip "\fIsourcename\fR\fB.bbg\fR" 4
2431 .IX Item "sourcename.bbg"
2432 A list of all arcs in the program flow graph. This allows \f(CW\*(C`gcov\*(C'\fR
2433 to reconstruct the program flow graph, so that it can compute all basic
2434 block and arc execution counts from the information in the
2435 \&\f(CW\*(C`\f(CIsourcename\f(CW.da\*(C'\fR file (this last file is the output from
2436 \&\fB\-fprofile-arcs\fR).
2440 .Ip "\fB\-d\fR\fIletters\fR" 4
2441 .IX Item "-dletters"
2442 Says to make debugging dumps during compilation at times specified by
2443 \&\fIletters\fR. This is used for debugging the compiler. The file names
2444 for most of the dumps are made by appending a pass number and a word to
2445 the source file name (e.g. \fIfoo.c.00.rtl\fR or \fIfoo.c.01.sibling\fR).
2446 Here are the possible letters for use in \fIletters\fR, and their meanings:
2450 Annotate the assembler output with miscellaneous debugging information.
2453 Dump after computing branch probabilities, to \fI\fIfile\fI.11.bp\fR.
2456 Dump after block reordering, to \fI\fIfile\fI.26.bbro\fR.
2459 Dump after instruction combination, to the file \fI\fIfile\fI.14.combine\fR.
2462 Dump after the first if conversion, to the file \fI\fIfile\fI.15.ce\fR.
2465 Dump after delayed branch scheduling, to \fI\fIfile\fI.29.dbr\fR.
2468 Dump all macro definitions, at the end of preprocessing, in addition to
2472 Dump after \s-1SSA\s0 optimizations, to \fI\fIfile\fI.05.ssa\fR and
2473 \&\fI\fIfile\fI.06.ussa\fR.
2476 Dump after the second if conversion, to \fI\fIfile\fI.24.ce2\fR.
2479 Dump after life analysis, to \fI\fIfile\fI.13.life\fR.
2482 Dump after purging \f(CW\*(C`ADDRESSOF\*(C'\fR codes, to \fI\fIfile\fI.04.addressof\fR.
2485 Dump after global register allocation, to \fI\fIfile\fI.19.greg\fR.
2488 Dump after post-reload \s-1CSE\s0 and other optimizations, to \fI\fIfile\fI.20.postreload\fR.
2491 Dump after \s-1GCSE\s0, to \fI\fIfile\fI.08.gcse\fR.
2494 Dump after sibling call optimizations, to \fI\fIfile\fI.01.sibling\fR.
2497 Dump after the first jump optimization, to \fI\fIfile\fI.02.jump\fR.
2500 Dump after the last jump optimization, to \fI\fIfile\fI.27.jump2\fR.
2503 Dump after conversion from registers to stack, to \fI\fIfile\fI.29.stack\fR.
2506 Dump after local register allocation, to \fI\fIfile\fI.18.lreg\fR.
2509 Dump after loop optimization, to \fI\fIfile\fI.09.loop\fR.
2512 Dump after performing the machine dependent reorganisation pass, to
2513 \&\fI\fIfile\fI.28.mach\fR.
2516 Dump after register renumbering, to \fI\fIfile\fI.23.rnreg\fR.
2519 Dump after the register move pass, to \fI\fIfile\fI.16.regmove\fR.
2522 Dump after \s-1RTL\s0 generation, to \fI\fIfile\fI.00.rtl\fR.
2525 Dump after the second instruction scheduling pass, to
2526 \&\fI\fIfile\fI.25.sched2\fR.
2529 Dump after \s-1CSE\s0 (including the jump optimization that sometimes follows
2530 \&\s-1CSE\s0), to \fI\fIfile\fI.03.cse\fR.
2533 Dump after the first instruction scheduling pass, to
2534 \&\fI\fIfile\fI.17.sched\fR.
2537 Dump after the second \s-1CSE\s0 pass (including the jump optimization that
2538 sometimes follows \s-1CSE\s0), to \fI\fIfile\fI.10.cse2\fR.
2541 Dump after the second flow pass, to \fI\fIfile\fI.21.flow2\fR.
2544 Dump after dead code elimination, to \fI\fIfile\fI.06.dce\fR.
2547 Dump after the peephole pass, to \fI\fIfile\fI.22.peephole2\fR.
2550 Produce all the dumps listed above.
2553 Print statistics on memory usage, at the end of the run, to
2557 Annotate the assembler output with a comment indicating which
2558 pattern and alternative was used. The length of each instruction is
2562 Dump the \s-1RTL\s0 in the assembler output as a comment before each instruction.
2563 Also turns on \fB\-dp\fR annotation.
2566 For each of the other indicated dump files (except for
2567 \&\fI\fIfile\fI.00.rtl\fR), dump a representation of the control flow graph
2568 suitable for viewing with \s-1VCG\s0 to \fI\fIfile\fI.\fIpass\fI.vcg\fR.
2571 Just generate \s-1RTL\s0 for a function instead of compiling it. Usually used
2575 Dump debugging information during parsing, to standard error.
2579 .Ip "\fB\-fdump-unnumbered\fR" 4
2580 .IX Item "-fdump-unnumbered"
2581 When doing debugging dumps (see \-d option above), suppress instruction
2582 numbers and line number note output. This makes it more feasible to
2583 use diff on debugging dumps for compiler invocations with different
2584 options, in particular with and without \-g.
2585 .Ip "\fB\-fdump-translation-unit=\fR\fIfile\fR \fB(C and \*(C+ only)\fR" 4
2586 .IX Item "-fdump-translation-unit=file (C and only)"
2587 Dump a representation of the tree structure for the entire translation
2589 .Ip "\fB\-fdump-class_layout=\fR\fIfile\fR \fB(\*(C+ only)\fR" 4
2590 .IX Item "-fdump-class_layout=file ( only)"
2592 .Ip "\fB\-fdump-class_layout (\*(C+ only)\fR" 4
2593 .IX Item "-fdump-class_layout ( only)"
2595 Dump a representation of each class's heirarchy to \fIfile\fR, or
2596 \&\f(CW\*(C`stderr\*(C'\fR if not specified.
2597 .Ip "\fB\-fpretend-float\fR" 4
2598 .IX Item "-fpretend-float"
2599 When running a cross-compiler, pretend that the target machine uses the
2600 same floating point format as the host machine. This causes incorrect
2601 output of the actual floating constants, but the actual instruction
2602 sequence will probably be the same as \s-1GCC\s0 would make when running on
2604 .Ip "\fB\-save-temps\fR" 4
2605 .IX Item "-save-temps"
2606 Store the usual ``temporary'' intermediate files permanently; place them
2607 in the current directory and name them based on the source file. Thus,
2608 compiling \fIfoo.c\fR with \fB\-c \-save-temps\fR would produce files
2609 \&\fIfoo.i\fR and \fIfoo.s\fR, as well as \fIfoo.o\fR. This creates a
2610 preprocessed \fIfoo.i\fR output file even though the compiler now
2611 normally uses an integrated preprocessor.
2612 .Ip "\fB\-time\fR" 4
2614 Report the \s-1CPU\s0 time taken by each subprocess in the compilation
2615 sequence. For C source files, this is the compiler proper and assembler
2616 (plus the linker if linking is done). The output looks like this:
2622 The first number on each line is the ``user time,'' that is time spent
2623 executing the program itself. The second number is ``system time,''
2624 time spent executing operating system routines on behalf of the program.
2625 Both numbers are in seconds.
2626 .Ip "\fB\-print-file-name=\fR\fIlibrary\fR" 4
2627 .IX Item "-print-file-name=library"
2628 Print the full absolute name of the library file \fIlibrary\fR that
2629 would be used when linking\-\-\-and don't do anything else. With this
2630 option, \s-1GCC\s0 does not compile or link anything; it just prints the
2632 .Ip "\fB\-print-prog-name=\fR\fIprogram\fR" 4
2633 .IX Item "-print-prog-name=program"
2634 Like \fB\-print-file-name\fR, but searches for a program such as \fBcpp\fR.
2635 .Ip "\fB\-print-libgcc-file-name\fR" 4
2636 .IX Item "-print-libgcc-file-name"
2637 Same as \fB\-print-file-name=libgcc.a\fR.
2639 This is useful when you use \fB\-nostdlib\fR or \fB\-nodefaultlibs\fR
2640 but you do want to link with \fIlibgcc.a\fR. You can do
2643 \& gcc -nostdlib I<files>... `gcc -print-libgcc-file-name`
2645 .Ip "\fB\-print-search-dirs\fR" 4
2646 .IX Item "-print-search-dirs"
2647 Print the name of the configured installation directory and a list of
2648 program and library directories gcc will search\-\-\-and don't do anything else.
2650 This is useful when gcc prints the error message
2651 \&\fBinstallation problem, cannot exec cpp0: No such file or directory\fR.
2652 To resolve this you either need to put \fIcpp0\fR and the other compiler
2653 components where gcc expects to find them, or you can set the environment
2654 variable \fB\s-1GCC_EXEC_PREFIX\s0\fR to the directory where you installed them.
2655 Don't forget the trailing '/'.
2656 .Ip "\fB\-dumpmachine\fR" 4
2657 .IX Item "-dumpmachine"
2658 Print the compiler's target machine (for example,
2659 \&\fBi686\-pc-linux-gnu\fR)\-\-\-and don't do anything else.
2660 .Ip "\fB\-dumpversion\fR" 4
2661 .IX Item "-dumpversion"
2662 Print the compiler version (for example, \fB3.0\fR)\-\-\-and don't do
2664 .Ip "\fB\-dumpspecs\fR" 4
2665 .IX Item "-dumpspecs"
2666 Print the compiler's built-in specs\-\-\-and don't do anything else. (This
2667 is used when \s-1GCC\s0 itself is being built.)
2668 .Sh "Options That Control Optimization"
2669 .IX Subsection "Options That Control Optimization"
2670 These options control various sorts of optimizations:
2677 Optimize. Optimizing compilation takes somewhat more time, and a lot
2678 more memory for a large function.
2680 Without \fB\-O\fR, the compiler's goal is to reduce the cost of
2681 compilation and to make debugging produce the expected results.
2682 Statements are independent: if you stop the program with a breakpoint
2683 between statements, you can then assign a new value to any variable or
2684 change the program counter to any other statement in the function and
2685 get exactly the results you would expect from the source code.
2687 Without \fB\-O\fR, the compiler only allocates variables declared
2688 \&\f(CW\*(C`register\*(C'\fR in registers. The resulting compiled code is a little
2689 worse than produced by \s-1PCC\s0 without \fB\-O\fR.
2691 With \fB\-O\fR, the compiler tries to reduce code size and execution
2694 When you specify \fB\-O\fR, the compiler turns on \fB\-fthread-jumps\fR
2695 and \fB\-fdefer-pop\fR on all machines. The compiler turns on
2696 \&\fB\-fdelayed-branch\fR on machines that have delay slots, and
2697 \&\fB\-fomit-frame-pointer\fR on machines that can support debugging even
2698 without a frame pointer. On some machines the compiler also turns
2702 Optimize even more. \s-1GCC\s0 performs nearly all supported optimizations
2703 that do not involve a space-speed tradeoff. The compiler does not
2704 perform loop unrolling or function inlining when you specify \fB\-O2\fR.
2705 As compared to \fB\-O\fR, this option increases both compilation time
2706 and the performance of the generated code.
2708 \&\fB\-O2\fR turns on all optional optimizations except for loop unrolling,
2709 function inlining, and register renaming. It also turns on the
2710 \&\fB\-fforce-mem\fR option on all machines and frame pointer elimination
2711 on machines where doing so does not interfere with debugging.
2714 Optimize yet more. \fB\-O3\fR turns on all optimizations specified by
2715 \&\fB\-O2\fR and also turns on the \fB\-finline-functions\fR and
2716 \&\fB\-frename-registers\fR options.
2722 Optimize for size. \fB\-Os\fR enables all \fB\-O2\fR optimizations that
2723 do not typically increase code size. It also performs further
2724 optimizations designed to reduce code size.
2726 If you use multiple \fB\-O\fR options, with or without level numbers,
2727 the last such option is the one that is effective.
2729 Options of the form \fB\-f\fR\fIflag\fR specify machine-independent
2730 flags. Most flags have both positive and negative forms; the negative
2731 form of \fB\-ffoo\fR would be \fB\-fno-foo\fR. In the table below,
2732 only one of the forms is listed\-\-\-the one which is not the default.
2733 You can figure out the other form by either removing \fBno-\fR or
2735 .Ip "\fB\-ffloat-store\fR" 4
2736 .IX Item "-ffloat-store"
2737 Do not store floating point variables in registers, and inhibit other
2738 options that might change whether a floating point value is taken from a
2741 This option prevents undesirable excess precision on machines such as
2742 the 68000 where the floating registers (of the 68881) keep more
2743 precision than a \f(CW\*(C`double\*(C'\fR is supposed to have. Similarly for the
2744 x86 architecture. For most programs, the excess precision does only
2745 good, but a few programs rely on the precise definition of \s-1IEEE\s0 floating
2746 point. Use \fB\-ffloat-store\fR for such programs, after modifying
2747 them to store all pertinent intermediate computations into variables.
2748 .Ip "\fB\-fno-default-inline\fR" 4
2749 .IX Item "-fno-default-inline"
2750 Do not make member functions inline by default merely because they are
2751 defined inside the class scope (\*(C+ only). Otherwise, when you specify
2752 \&\fB\-O\fR, member functions defined inside class scope are compiled
2753 inline by default; i.e., you don't need to add \fBinline\fR in front of
2754 the member function name.
2755 .Ip "\fB\-fno-defer-pop\fR" 4
2756 .IX Item "-fno-defer-pop"
2757 Always pop the arguments to each function call as soon as that function
2758 returns. For machines which must pop arguments after a function call,
2759 the compiler normally lets arguments accumulate on the stack for several
2760 function calls and pops them all at once.
2761 .Ip "\fB\-fforce-mem\fR" 4
2762 .IX Item "-fforce-mem"
2763 Force memory operands to be copied into registers before doing
2764 arithmetic on them. This produces better code by making all memory
2765 references potential common subexpressions. When they are not common
2766 subexpressions, instruction combination should eliminate the separate
2767 register-load. The \fB\-O2\fR option turns on this option.
2768 .Ip "\fB\-fforce-addr\fR" 4
2769 .IX Item "-fforce-addr"
2770 Force memory address constants to be copied into registers before
2771 doing arithmetic on them. This may produce better code just as
2772 \&\fB\-fforce-mem\fR may.
2773 .Ip "\fB\-fomit-frame-pointer\fR" 4
2774 .IX Item "-fomit-frame-pointer"
2775 Don't keep the frame pointer in a register for functions that
2776 don't need one. This avoids the instructions to save, set up and
2777 restore frame pointers; it also makes an extra register available
2778 in many functions. \fBIt also makes debugging impossible on
2781 On some machines, such as the Vax, this flag has no effect, because
2782 the standard calling sequence automatically handles the frame pointer
2783 and nothing is saved by pretending it doesn't exist. The
2784 machine-description macro \f(CW\*(C`FRAME_POINTER_REQUIRED\*(C'\fR controls
2785 whether a target machine supports this flag.
2786 .Ip "\fB\-foptimize-sibling-calls\fR" 4
2787 .IX Item "-foptimize-sibling-calls"
2788 Optimize sibling and tail recursive calls.
2789 .Ip "\fB\-ftrapv\fR" 4
2791 This option generates traps for signed overflow on addition, subtraction,
2792 multiplication operations.
2793 .Ip "\fB\-fno-inline\fR" 4
2794 .IX Item "-fno-inline"
2795 Don't pay attention to the \f(CW\*(C`inline\*(C'\fR keyword. Normally this option
2796 is used to keep the compiler from expanding any functions inline.
2797 Note that if you are not optimizing, no functions can be expanded inline.
2798 .Ip "\fB\-finline-functions\fR" 4
2799 .IX Item "-finline-functions"
2800 Integrate all simple functions into their callers. The compiler
2801 heuristically decides which functions are simple enough to be worth
2802 integrating in this way.
2804 If all calls to a given function are integrated, and the function is
2805 declared \f(CW\*(C`static\*(C'\fR, then the function is normally not output as
2806 assembler code in its own right.
2807 .Ip "\fB\-finline-limit=\fR\fIn\fR" 4
2808 .IX Item "-finline-limit=n"
2809 By default, gcc limits the size of functions that can be inlined. This flag
2810 allows the control of this limit for functions that are explicitly marked as
2811 inline (ie marked with the inline keyword or defined within the class
2812 definition in c++). \fIn\fR is the size of functions that can be inlined in
2813 number of pseudo instructions (not counting parameter handling). The default
2814 value of n is 10000. Increasing this value can result in more inlined code at
2815 the cost of compilation time and memory consumption. Decreasing usually makes
2816 the compilation faster and less code will be inlined (which presumably
2817 means slower programs). This option is particularly useful for programs that
2818 use inlining heavily such as those based on recursive templates with c++.
2820 \&\fINote:\fR pseudo instruction represents, in this particular context, an
2821 abstract measurement of function's size. In no way, it represents a count
2822 of assembly instructions and as such its exact meaning might change from one
2823 release to an another.
2824 .Ip "\fB\-fkeep-inline-functions\fR" 4
2825 .IX Item "-fkeep-inline-functions"
2826 Even if all calls to a given function are integrated, and the function
2827 is declared \f(CW\*(C`static\*(C'\fR, nevertheless output a separate run-time
2828 callable version of the function. This switch does not affect
2829 \&\f(CW\*(C`extern inline\*(C'\fR functions.
2830 .Ip "\fB\-fkeep-static-consts\fR" 4
2831 .IX Item "-fkeep-static-consts"
2832 Emit variables declared \f(CW\*(C`static const\*(C'\fR when optimization isn't turned
2833 on, even if the variables aren't referenced.
2835 \&\s-1GCC\s0 enables this option by default. If you want to force the compiler to
2836 check if the variable was referenced, regardless of whether or not
2837 optimization is turned on, use the \fB\-fno-keep-static-consts\fR option.
2838 .Ip "\fB\-fno-function-cse\fR" 4
2839 .IX Item "-fno-function-cse"
2840 Do not put function addresses in registers; make each instruction that
2841 calls a constant function contain the function's address explicitly.
2843 This option results in less efficient code, but some strange hacks
2844 that alter the assembler output may be confused by the optimizations
2845 performed when this option is not used.
2846 .Ip "\fB\-ffast-math\fR" 4
2847 .IX Item "-ffast-math"
2848 This option allows \s-1GCC\s0 to violate some \s-1ISO\s0 or \s-1IEEE\s0 rules and/or
2849 specifications in the interest of optimizing code for speed. For
2850 example, it allows the compiler to assume arguments to the \f(CW\*(C`sqrt\*(C'\fR
2851 function are non-negative numbers and that no floating-point values
2854 This option causes the preprocessor macro _\|_FAST_MATH_\|_ to be defined.
2856 This option should never be turned on by any \fB\-O\fR option since
2857 it can result in incorrect output for programs which depend on
2858 an exact implementation of \s-1IEEE\s0 or \s-1ISO\s0 rules/specifications for
2860 .Ip "\fB\-fno-math-errno\fR" 4
2861 .IX Item "-fno-math-errno"
2862 Do not set \s-1ERRNO\s0 after calling math functions that are executed
2863 with a single instruction, e.g., sqrt. A program that relies on
2864 \&\s-1IEEE\s0 exceptions for math error handling may want to use this flag
2865 for speed while maintaining \s-1IEEE\s0 arithmetic compatibility.
2867 The default is \fB\-fmath-errno\fR. The \fB\-ffast-math\fR option
2868 sets \fB\-fno-math-errno\fR.
2870 The following options control specific optimizations. The \fB\-O2\fR
2871 option turns on all of these optimizations except \fB\-funroll-loops\fR
2872 and \fB\-funroll-all-loops\fR. On most machines, the \fB\-O\fR option
2873 turns on the \fB\-fthread-jumps\fR and \fB\-fdelayed-branch\fR options,
2874 but specific machines may handle it differently.
2876 You can use the following flags in the rare cases when ``fine-tuning''
2877 of optimizations to be performed is desired.
2878 .Ip "\fB\-fstrength-reduce\fR" 4
2879 .IX Item "-fstrength-reduce"
2880 Perform the optimizations of loop strength reduction and
2881 elimination of iteration variables.
2882 .Ip "\fB\-fthread-jumps\fR" 4
2883 .IX Item "-fthread-jumps"
2884 Perform optimizations where we check to see if a jump branches to a
2885 location where another comparison subsumed by the first is found. If
2886 so, the first branch is redirected to either the destination of the
2887 second branch or a point immediately following it, depending on whether
2888 the condition is known to be true or false.
2889 .Ip "\fB\-fcse-follow-jumps\fR" 4
2890 .IX Item "-fcse-follow-jumps"
2891 In common subexpression elimination, scan through jump instructions
2892 when the target of the jump is not reached by any other path. For
2893 example, when \s-1CSE\s0 encounters an \f(CW\*(C`if\*(C'\fR statement with an
2894 \&\f(CW\*(C`else\*(C'\fR clause, \s-1CSE\s0 will follow the jump when the condition
2896 .Ip "\fB\-fcse-skip-blocks\fR" 4
2897 .IX Item "-fcse-skip-blocks"
2898 This is similar to \fB\-fcse-follow-jumps\fR, but causes \s-1CSE\s0 to
2899 follow jumps which conditionally skip over blocks. When \s-1CSE\s0
2900 encounters a simple \f(CW\*(C`if\*(C'\fR statement with no else clause,
2901 \&\fB\-fcse-skip-blocks\fR causes \s-1CSE\s0 to follow the jump around the
2902 body of the \f(CW\*(C`if\*(C'\fR.
2903 .Ip "\fB\-frerun-cse-after-loop\fR" 4
2904 .IX Item "-frerun-cse-after-loop"
2905 Re-run common subexpression elimination after loop optimizations has been
2907 .Ip "\fB\-frerun-loop-opt\fR" 4
2908 .IX Item "-frerun-loop-opt"
2909 Run the loop optimizer twice.
2910 .Ip "\fB\-fgcse\fR" 4
2912 Perform a global common subexpression elimination pass.
2913 This pass also performs global constant and copy propagation.
2914 .Ip "\fB\-fdelete-null-pointer-checks\fR" 4
2915 .IX Item "-fdelete-null-pointer-checks"
2916 Use global dataflow analysis to identify and eliminate useless null
2917 pointer checks. Programs which rely on \s-1NULL\s0 pointer dereferences \fInot\fR
2918 halting the program may not work properly with this option. Use
2919 \&\-fno-delete-null-pointer-checks to disable this optimizing for programs
2920 which depend on that behavior.
2921 .Ip "\fB\-fexpensive-optimizations\fR" 4
2922 .IX Item "-fexpensive-optimizations"
2923 Perform a number of minor optimizations that are relatively expensive.
2924 .Ip "\fB\-foptimize-register-move\fR" 4
2925 .IX Item "-foptimize-register-move"
2927 .Ip "\fB\-fregmove\fR" 4
2928 .IX Item "-fregmove"
2930 Attempt to reassign register numbers in move instructions and as
2931 operands of other simple instructions in order to maximize the amount of
2932 register tying. This is especially helpful on machines with two-operand
2933 instructions. \s-1GCC\s0 enables this optimization by default with \fB\-O2\fR
2936 Note \fB\-fregmove\fR and \fB\-foptimize-register-move\fR are the same
2938 .Ip "\fB\-fdelayed-branch\fR" 4
2939 .IX Item "-fdelayed-branch"
2940 If supported for the target machine, attempt to reorder instructions
2941 to exploit instruction slots available after delayed branch
2943 .Ip "\fB\-fschedule-insns\fR" 4
2944 .IX Item "-fschedule-insns"
2945 If supported for the target machine, attempt to reorder instructions to
2946 eliminate execution stalls due to required data being unavailable. This
2947 helps machines that have slow floating point or memory load instructions
2948 by allowing other instructions to be issued until the result of the load
2949 or floating point instruction is required.
2950 .Ip "\fB\-fschedule-insns2\fR" 4
2951 .IX Item "-fschedule-insns2"
2952 Similar to \fB\-fschedule-insns\fR, but requests an additional pass of
2953 instruction scheduling after register allocation has been done. This is
2954 especially useful on machines with a relatively small number of
2955 registers and where memory load instructions take more than one cycle.
2956 .Ip "\fB\-ffunction-sections\fR" 4
2957 .IX Item "-ffunction-sections"
2959 .Ip "\fB\-fdata-sections\fR" 4
2960 .IX Item "-fdata-sections"
2962 Place each function or data item into its own section in the output
2963 file if the target supports arbitrary sections. The name of the
2964 function or the name of the data item determines the section's name
2967 Use these options on systems where the linker can perform optimizations
2968 to improve locality of reference in the instruction space. \s-1HPPA\s0
2969 processors running \s-1HP-UX\s0 and Sparc processors running Solaris 2 have
2970 linkers with such optimizations. Other systems using the \s-1ELF\s0 object format
2971 as well as \s-1AIX\s0 may have these optimizations in the future.
2973 Only use these options when there are significant benefits from doing
2974 so. When you specify these options, the assembler and linker will
2975 create larger object and executable files and will also be slower.
2976 You will not be able to use \f(CW\*(C`gprof\*(C'\fR on all systems if you
2977 specify this option and you may have problems with debugging if
2978 you specify both this option and \fB\-g\fR.
2979 .Ip "\fB\-fcaller-saves\fR" 4
2980 .IX Item "-fcaller-saves"
2981 Enable values to be allocated in registers that will be clobbered by
2982 function calls, by emitting extra instructions to save and restore the
2983 registers around such calls. Such allocation is done only when it
2984 seems to result in better code than would otherwise be produced.
2986 This option is always enabled by default on certain machines, usually
2987 those which have no call-preserved registers to use instead.
2989 For all machines, optimization level 2 and higher enables this flag by
2991 .Ip "\fB\-funroll-loops\fR" 4
2992 .IX Item "-funroll-loops"
2993 Perform the optimization of loop unrolling. This is only done for loops
2994 whose number of iterations can be determined at compile time or run time.
2995 \&\fB\-funroll-loops\fR implies both \fB\-fstrength-reduce\fR and
2996 \&\fB\-frerun-cse-after-loop\fR.
2997 .Ip "\fB\-funroll-all-loops\fR" 4
2998 .IX Item "-funroll-all-loops"
2999 Perform the optimization of loop unrolling. This is done for all loops
3000 and usually makes programs run more slowly. \fB\-funroll-all-loops\fR
3001 implies \fB\-fstrength-reduce\fR as well as \fB\-frerun-cse-after-loop\fR.
3002 .Ip "\fB\-fmove-all-movables\fR" 4
3003 .IX Item "-fmove-all-movables"
3004 Forces all invariant computations in loops to be moved
3006 .Ip "\fB\-freduce-all-givs\fR" 4
3007 .IX Item "-freduce-all-givs"
3008 Forces all general-induction variables in loops to be
3011 \&\fINote:\fR When compiling programs written in Fortran,
3012 \&\fB\-fmove-all-movables\fR and \fB\-freduce-all-givs\fR are enabled
3013 by default when you use the optimizer.
3015 These options may generate better or worse code; results are highly
3016 dependent on the structure of loops within the source code.
3018 These two options are intended to be removed someday, once
3019 they have helped determine the efficacy of various
3020 approaches to improving loop optimizations.
3022 Please let us (<\fBgcc@gcc.gnu.org\fR> and <\fBfortran@gnu.org\fR>)
3023 know how use of these options affects
3024 the performance of your production code.
3025 We're very interested in code that runs \fIslower\fR
3026 when these options are \fIenabled\fR.
3027 .Ip "\fB\-fno-peephole\fR" 4
3028 .IX Item "-fno-peephole"
3029 Disable any machine-specific peephole optimizations.
3030 .Ip "\fB\-fbranch-probabilities\fR" 4
3031 .IX Item "-fbranch-probabilities"
3032 After running a program compiled with \fB\-fprofile-arcs\fR, you can compile it a second time using
3033 \&\fB\-fbranch-probabilities\fR, to improve optimizations based on
3034 guessing the path a branch might take.
3035 .Ip "\fB\-fno-guess-branch-probability\fR" 4
3036 .IX Item "-fno-guess-branch-probability"
3037 Sometimes gcc will opt to guess branch probabilities when none are
3038 available from either profile directed feedback (\fB\-fprofile-arcs\fR)
3039 or \fB_\|_builtin_expect\fR. In a hard real-time system, people don't
3040 want different runs of the compiler to produce code that has different
3041 behavior; minimizing non-determinism is of paramount import. This
3042 switch allows users to reduce non-determinism, possibly at the expense
3043 of inferior optimization.
3044 .Ip "\fB\-fstrict-aliasing\fR" 4
3045 .IX Item "-fstrict-aliasing"
3046 Allows the compiler to assume the strictest aliasing rules applicable to
3047 the language being compiled. For C (and \*(C+), this activates
3048 optimizations based on the type of expressions. In particular, an
3049 object of one type is assumed never to reside at the same address as an
3050 object of a different type, unless the types are almost the same. For
3051 example, an \f(CW\*(C`unsigned int\*(C'\fR can alias an \f(CW\*(C`int\*(C'\fR, but not a
3052 \&\f(CW\*(C`void*\*(C'\fR or a \f(CW\*(C`double\*(C'\fR. A character type may alias any other
3055 Pay special attention to code like this:
3070 The practice of reading from a different union member than the one most
3071 recently written to (called ``type-punning'') is common. Even with
3072 \&\fB\-fstrict-aliasing\fR, type-punning is allowed, provided the memory
3073 is accessed through the union type. So, the code above will work as
3074 expected. However, this code might not:
3085 .Ip "\fB\-falign-functions\fR" 4
3086 .IX Item "-falign-functions"
3088 .Ip "\fB\-falign-functions=\fR\fIn\fR" 4
3089 .IX Item "-falign-functions=n"
3091 Align the start of functions to the next power-of-two greater than
3092 \&\fIn\fR, skipping up to \fIn\fR bytes. For instance,
3093 \&\fB\-falign-functions=32\fR aligns functions to the next 32\-byte
3094 boundary, but \fB\-falign-functions=24\fR would align to the next
3095 32\-byte boundary only if this can be done by skipping 23 bytes or less.
3097 \&\fB\-fno-align-functions\fR and \fB\-falign-functions=1\fR are
3098 equivalent and mean that functions will not be aligned.
3100 Some assemblers only support this flag when \fIn\fR is a power of two;
3101 in that case, it is rounded up.
3103 If \fIn\fR is not specified, use a machine-dependent default.
3104 .Ip "\fB\-falign-labels\fR" 4
3105 .IX Item "-falign-labels"
3107 .Ip "\fB\-falign-labels=\fR\fIn\fR" 4
3108 .IX Item "-falign-labels=n"
3110 Align all branch targets to a power-of-two boundary, skipping up to
3111 \&\fIn\fR bytes like \fB\-falign-functions\fR. This option can easily
3112 make code slower, because it must insert dummy operations for when the
3113 branch target is reached in the usual flow of the code.
3115 If \fB\-falign-loops\fR or \fB\-falign-jumps\fR are applicable and
3116 are greater than this value, then their values are used instead.
3118 If \fIn\fR is not specified, use a machine-dependent default which is
3119 very likely to be \fB1\fR, meaning no alignment.
3120 .Ip "\fB\-falign-loops\fR" 4
3121 .IX Item "-falign-loops"
3123 .Ip "\fB\-falign-loops=\fR\fIn\fR" 4
3124 .IX Item "-falign-loops=n"
3126 Align loops to a power-of-two boundary, skipping up to \fIn\fR bytes
3127 like \fB\-falign-functions\fR. The hope is that the loop will be
3128 executed many times, which will make up for any execution of the dummy
3131 If \fIn\fR is not specified, use a machine-dependent default.
3132 .Ip "\fB\-falign-jumps\fR" 4
3133 .IX Item "-falign-jumps"
3135 .Ip "\fB\-falign-jumps=\fR\fIn\fR" 4
3136 .IX Item "-falign-jumps=n"
3138 Align branch targets to a power-of-two boundary, for branch targets
3139 where the targets can only be reached by jumping, skipping up to \fIn\fR
3140 bytes like \fB\-falign-functions\fR. In this case, no dummy operations
3143 If \fIn\fR is not specified, use a machine-dependent default.
3144 .Ip "\fB\-fssa\fR" 4
3146 Perform optimizations in static single assignment form. Each function's
3147 flow graph is translated into \s-1SSA\s0 form, optimizations are performed, and
3148 the flow graph is translated back from \s-1SSA\s0 form. User's should not
3149 specify this option, since it is not yet ready for production use.
3150 .Ip "\fB\-fdce\fR" 4
3152 Perform dead-code elimination in \s-1SSA\s0 form. Requires \fB\-fssa\fR. Like
3153 \&\fB\-fssa\fR, this is an experimental feature.
3154 .Ip "\fB\-fsingle-precision-constant\fR" 4
3155 .IX Item "-fsingle-precision-constant"
3156 Treat floating point constant as single precision constant instead of
3157 implicitly converting it to double precision constant.
3158 .Ip "\fB\-frename-registers\fR" 4
3159 .IX Item "-frename-registers"
3160 Attempt to avoid false dependancies in scheduled code by making use
3161 of registers left over after register allocation. This optimization
3162 will most benefit processors with lots of registers. It can, however,
3163 make debugging impossible, since variables will no longer stay in
3164 a ``home register''.
3165 .Ip "\fB\*(--param\fR \fIname\fR\fB=\fR\fIvalue\fR" 4
3166 .IX Item "param name=value"
3167 In some places, \s-1GCC\s0 uses various constants to control the amount of
3168 optimization that is done. For example, \s-1GCC\s0 will not inline functions
3169 that contain more that a certain number of instructions. You can
3170 control some of these constants on the command-line using the
3171 \&\fB\*(--param\fR option.
3173 In each case, the \fIvalue\fR is a integer. The allowable choices for
3174 \&\fIname\fR are given in the following table:
3176 .Ip "\fBmax-inline-insns\fR" 4
3177 .IX Item "max-inline-insns"
3178 If an function contains more than this many instructions, it
3179 will not be inlined. This option is precisely equivalent to
3180 \&\fB\-finline-limit\fR.
3181 .Ip "\fBmax-gcse-memory\fR" 4
3182 .IX Item "max-gcse-memory"
3183 The approximate maximum amount of memory that will be allocated in
3184 order to perform the global common subexpression elimination
3185 optimization. If more memory than specified is required, the
3186 optimization will not be done.
3190 .Sh "Options Controlling the Preprocessor"
3191 .IX Subsection "Options Controlling the Preprocessor"
3192 These options control the C preprocessor, which is run on each C source
3193 file before actual compilation.
3195 If you use the \fB\-E\fR option, nothing is done except preprocessing.
3196 Some of these options make sense only together with \fB\-E\fR because
3197 they cause the preprocessor output to be unsuitable for actual
3199 .Ip "\fB\-include\fR \fIfile\fR" 4
3200 .IX Item "-include file"
3201 Process \fIfile\fR as input before processing the regular input file.
3202 In effect, the contents of \fIfile\fR are compiled first. Any \fB\-D\fR
3203 and \fB\-U\fR options on the command line are always processed before
3204 \&\fB\-include\fR \fIfile\fR, regardless of the order in which they are
3205 written. All the \fB\-include\fR and \fB\-imacros\fR options are
3206 processed in the order in which they are written.
3207 .Ip "\fB\-imacros\fR \fIfile\fR" 4
3208 .IX Item "-imacros file"
3209 Process \fIfile\fR as input, discarding the resulting output, before
3210 processing the regular input file. Because the output generated from
3211 \&\fIfile\fR is discarded, the only effect of \fB\-imacros\fR \fIfile\fR
3212 is to make the macros defined in \fIfile\fR available for use in the
3213 main input. All the \fB\-include\fR and \fB\-imacros\fR options are
3214 processed in the order in which they are written.
3215 .Ip "\fB\-idirafter\fR \fIdir\fR" 4
3216 .IX Item "-idirafter dir"
3217 Add the directory \fIdir\fR to the second include path. The directories
3218 on the second include path are searched when a header file is not found
3219 in any of the directories in the main include path (the one that
3220 \&\fB\-I\fR adds to).
3221 .Ip "\fB\-iprefix\fR \fIprefix\fR" 4
3222 .IX Item "-iprefix prefix"
3223 Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR
3225 .Ip "\fB\-iwithprefix\fR \fIdir\fR" 4
3226 .IX Item "-iwithprefix dir"
3227 Add a directory to the second include path. The directory's name is
3228 made by concatenating \fIprefix\fR and \fIdir\fR, where \fIprefix\fR was
3229 specified previously with \fB\-iprefix\fR. If you have not specified a
3230 prefix yet, the directory containing the installed passes of the
3231 compiler is used as the default.
3232 .Ip "\fB\-iwithprefixbefore\fR \fIdir\fR" 4
3233 .IX Item "-iwithprefixbefore dir"
3234 Add a directory to the main include path. The directory's name is made
3235 by concatenating \fIprefix\fR and \fIdir\fR, as in the case of
3236 \&\fB\-iwithprefix\fR.
3237 .Ip "\fB\-isystem\fR \fIdir\fR" 4
3238 .IX Item "-isystem dir"
3239 Add a directory to the beginning of the second include path, marking it
3240 as a system directory, so that it gets the same special treatment as
3241 is applied to the standard system directories.
3242 .Ip "\fB\-nostdinc\fR" 4
3243 .IX Item "-nostdinc"
3244 Do not search the standard system directories for header files. Only
3245 the directories you have specified with \fB\-I\fR options (and the
3246 current directory, if appropriate) are searched.
3248 By using both \fB\-nostdinc\fR and \fB\-I-\fR, you can limit the include-file
3249 search path to only those directories you specify explicitly.
3250 .Ip "\fB\-remap\fR" 4
3252 When searching for a header file in a directory, remap file names if a
3253 file named \fIheader.gcc\fR exists in that directory. This can be used
3254 to work around limitations of file systems with file name restrictions.
3255 The \fIheader.gcc\fR file should contain a series of lines with two
3256 tokens on each line: the first token is the name to map, and the second
3257 token is the actual name to use.
3258 .Ip "\fB\-undef\fR" 4
3260 Do not predefine any nonstandard macros. (Including architecture flags).
3263 Run only the C preprocessor. Preprocess all the C source files
3264 specified and output the results to standard output or to the
3265 specified output file.
3268 Tell the preprocessor not to discard comments. Used with the
3272 Tell the preprocessor not to generate \fB#line\fR directives.
3273 Used with the \fB\-E\fR option.
3276 Instead of outputting the result of preprocessing, output a rule
3277 suitable for \f(CW\*(C`make\*(C'\fR describing the dependencies of the main source
3278 file. The preprocessor outputs one \f(CW\*(C`make\*(C'\fR rule containing the
3279 object file name for that source file, a colon, and the names of all the
3280 included files. Unless overridden explicitly, the object file name
3281 consists of the basename of the source file with any suffix replaced with
3282 object file suffix. If there are many included files then the
3283 rule is split into several lines using \fB\e\fR\-newline.
3285 \&\fB\-M\fR implies \fB\-E\fR.
3288 Like \fB\-M\fR, but mention only the files included with \fB#include
3289 "\fR\fIfile\fR\fB"\fR. System header files included with \fB#include
3290 <\fR\fIfile\fR\fB>\fR are omitted.
3293 Like \fB\-M\fR but the dependency information is written to a file
3294 rather than stdout. \f(CW\*(C`gcc\*(C'\fR will use the same file name and
3295 directory as the object file, but with the suffix \*(L".d\*(R" instead.
3297 This is in addition to compiling the main file as specified \-\-\-
3298 \&\fB\-MD\fR does not inhibit ordinary compilation the way \fB\-M\fR does,
3299 unless you also specify \fB\-MG\fR.
3301 With Mach, you can use the utility \f(CW\*(C`md\*(C'\fR to merge multiple
3302 dependency files into a single dependency file suitable for using with
3303 the \fBmake\fR command.
3306 Like \fB\-MD\fR except mention only user header files, not system
3308 .Ip "\fB\-MF\fR \fIfile\fR" 4
3310 When used with \fB\-M\fR or \fB\-MM\fR, specifies a file to write the
3311 dependencies to. This allows the preprocessor to write the preprocessed
3312 file to stdout normally. If no \fB\-MF\fR switch is given, \s-1CPP\s0 sends
3313 the rules to stdout and suppresses normal preprocessed output.
3315 Another way to specify output of a \f(CW\*(C`make\*(C'\fR rule is by setting
3316 the environment variable \fB\s-1DEPENDENCIES_OUTPUT\s0\fR.
3319 When used with \fB\-M\fR or \fB\-MM\fR, \fB\-MG\fR says to treat missing
3320 header files as generated files and assume they live in the same
3321 directory as the source file. It suppresses preprocessed output, as a
3322 missing header file is ordinarily an error.
3324 This feature is used in automatic updating of makefiles.
3327 This option instructs \s-1CPP\s0 to add a phony target for each dependency
3328 other than the main file, causing each to depend on nothing. These
3329 dummy rules work around errors \f(CW\*(C`make\*(C'\fR gives if you remove header
3330 files without updating the \f(CW\*(C`Makefile\*(C'\fR to match.
3332 This is typical output:\-
3335 \& /tmp/test.o: /tmp/test.c /tmp/test.h
3340 .Ip "\fB\-MQ\fR \fItarget\fR" 4
3341 .IX Item "-MQ target"
3343 .Ip "\fB\-MT\fR \fItarget\fR" 4
3344 .IX Item "-MT target"
3346 By default \s-1CPP\s0 uses the main file name, including any path, and appends
3347 the object suffix, normally ``.o'', to it to obtain the name of the
3348 target for dependency generation. With \fB\-MT\fR you can specify a
3349 target yourself, overriding the default one.
3351 If you want multiple targets, you can specify them as a single argument
3352 to \fB\-MT\fR, or use multiple \fB\-MT\fR options.
3354 The targets you specify are output in the order they appear on the
3355 command line. \fB\-MQ\fR is identical to \fB\-MT\fR, except that the
3356 target name is quoted for Make, but with \fB\-MT\fR it isn't. For
3357 example, \-MT '$(objpfx)foo.o' gives
3360 \& $(objpfx)foo.o: /tmp/foo.c
3362 but \-MQ '$(objpfx)foo.o' gives
3365 \& $$(objpfx)foo.o: /tmp/foo.c
3367 The default target is automatically quoted, as if it were given with
3371 Print the name of each header file used, in addition to other normal
3373 .Ip "\fB\-A\fR\fIquestion\fR\fB(\fR\fIanswer\fR\fB)\fR" 4
3374 .IX Item "-Aquestion(answer)"
3375 Assert the answer \fIanswer\fR for \fIquestion\fR, in case it is tested
3376 with a preprocessing conditional such as \fB#if
3377 #\fR\fIquestion\fR\fB(\fR\fIanswer\fR\fB)\fR. \fB\-A-\fR disables the standard
3378 assertions that normally describe the target machine.
3379 .Ip "\fB\-D\fR\fImacro\fR" 4
3381 Define macro \fImacro\fR with the string \fB1\fR as its definition.
3382 .Ip "\fB\-D\fR\fImacro\fR\fB=\fR\fIdefn\fR" 4
3383 .IX Item "-Dmacro=defn"
3384 Define macro \fImacro\fR as \fIdefn\fR. All instances of \fB\-D\fR on
3385 the command line are processed before any \fB\-U\fR options.
3387 Any \fB\-D\fR and \fB\-U\fR options on the command line are processed in
3388 order, and always before \fB\-imacros\fR \fIfile\fR, regardless of the
3389 order in which they are written.
3390 .Ip "\fB\-U\fR\fImacro\fR" 4
3392 Undefine macro \fImacro\fR. \fB\-U\fR options are evaluated after all
3393 \&\fB\-D\fR options, but before any \fB\-include\fR and \fB\-imacros\fR
3396 Any \fB\-D\fR and \fB\-U\fR options on the command line are processed in
3397 order, and always before \fB\-imacros\fR \fIfile\fR, regardless of the
3398 order in which they are written.
3401 Tell the preprocessor to output only a list of the macro definitions
3402 that are in effect at the end of preprocessing. Used with the \fB\-E\fR
3406 Tell the preprocessing to pass all macro definitions into the output, in
3407 their proper sequence in the rest of the output.
3410 Like \fB\-dD\fR except that the macro arguments and contents are omitted.
3411 Only \fB#define\fR \fIname\fR is included in the output.
3414 Output \fB#include\fR directives in addition to the result of
3416 .Ip "\fB\-trigraphs\fR" 4
3417 .IX Item "-trigraphs"
3418 Process \s-1ISO\s0 standard trigraph sequences. These are three-character
3419 sequences, all starting with \fB??\fR, that are defined by \s-1ISO\s0 C to
3420 stand for single characters. For example, \fB??/\fR stands for
3421 \&\fB\e\fR, so \fB'??/n'\fR is a character constant for a newline. By
3422 default, \s-1GCC\s0 ignores trigraphs, but in standard-conforming modes it
3423 converts them. See the \fB\-std\fR and \fB\-ansi\fR options.
3425 The nine trigraph sequences are
3457 Trigraph support is not popular, so many compilers do not implement it
3458 properly. Portable code should not rely on trigraphs being either
3459 converted or ignored.
3461 .Ip "\fB\-Wp,\fR\fIoption\fR" 4
3462 .IX Item "-Wp,option"
3463 Pass \fIoption\fR as an option to the preprocessor. If \fIoption\fR
3464 contains commas, it is split into multiple options at the commas.
3465 .Sh "Passing Options to the Assembler"
3466 .IX Subsection "Passing Options to the Assembler"
3467 You can pass options to the assembler.
3468 .Ip "\fB\-Wa,\fR\fIoption\fR" 4
3469 .IX Item "-Wa,option"
3470 Pass \fIoption\fR as an option to the assembler. If \fIoption\fR
3471 contains commas, it is split into multiple options at the commas.
3472 .Sh "Options for Linking"
3473 .IX Subsection "Options for Linking"
3474 These options come into play when the compiler links object files into
3475 an executable output file. They are meaningless if the compiler is
3476 not doing a link step.
3477 .Ip "\fIobject-file-name\fR" 4
3478 .IX Item "object-file-name"
3479 A file name that does not end in a special recognized suffix is
3480 considered to name an object file or library. (Object files are
3481 distinguished from libraries by the linker according to the file
3482 contents.) If linking is done, these object files are used as input
3492 If any of these options is used, then the linker is not run, and
3493 object file names should not be used as arguments.
3494 .Ip "\fB\-l\fR\fIlibrary\fR" 4
3495 .IX Item "-llibrary"
3496 Search the library named \fIlibrary\fR when linking.
3498 It makes a difference where in the command you write this option; the
3499 linker searches processes libraries and object files in the order they
3500 are specified. Thus, \fBfoo.o \-lz bar.o\fR searches library \fBz\fR
3501 after file \fIfoo.o\fR but before \fIbar.o\fR. If \fIbar.o\fR refers
3502 to functions in \fBz\fR, those functions may not be loaded.
3504 The linker searches a standard list of directories for the library,
3505 which is actually a file named \fIlib\fIlibrary\fI.a\fR. The linker
3506 then uses this file as if it had been specified precisely by name.
3508 The directories searched include several standard system directories
3509 plus any that you specify with \fB\-L\fR.
3511 Normally the files found this way are library files\-\-\-archive files
3512 whose members are object files. The linker handles an archive file by
3513 scanning through it for members which define symbols that have so far
3514 been referenced but not defined. But if the file that is found is an
3515 ordinary object file, it is linked in the usual fashion. The only
3516 difference between using an \fB\-l\fR option and specifying a file name
3517 is that \fB\-l\fR surrounds \fIlibrary\fR with \fBlib\fR and \fB.a\fR
3518 and searches several directories.
3519 .Ip "\fB\-lobjc\fR" 4
3521 You need this special case of the \fB\-l\fR option in order to
3522 link an Objective C program.
3523 .Ip "\fB\-nostartfiles\fR" 4
3524 .IX Item "-nostartfiles"
3525 Do not use the standard system startup files when linking.
3526 The standard system libraries are used normally, unless \fB\-nostdlib\fR
3527 or \fB\-nodefaultlibs\fR is used.
3528 .Ip "\fB\-nodefaultlibs\fR" 4
3529 .IX Item "-nodefaultlibs"
3530 Do not use the standard system libraries when linking.
3531 Only the libraries you specify will be passed to the linker.
3532 The standard startup files are used normally, unless \fB\-nostartfiles\fR
3533 is used. The compiler may generate calls to memcmp, memset, and memcpy
3534 for System V (and \s-1ISO\s0 C) environments or to bcopy and bzero for
3535 \&\s-1BSD\s0 environments. These entries are usually resolved by entries in
3536 libc. These entry points should be supplied through some other
3537 mechanism when this option is specified.
3538 .Ip "\fB\-nostdlib\fR" 4
3539 .IX Item "-nostdlib"
3540 Do not use the standard system startup files or libraries when linking.
3541 No startup files and only the libraries you specify will be passed to
3542 the linker. The compiler may generate calls to memcmp, memset, and memcpy
3543 for System V (and \s-1ISO\s0 C) environments or to bcopy and bzero for
3544 \&\s-1BSD\s0 environments. These entries are usually resolved by entries in
3545 libc. These entry points should be supplied through some other
3546 mechanism when this option is specified.
3548 One of the standard libraries bypassed by \fB\-nostdlib\fR and
3549 \&\fB\-nodefaultlibs\fR is \fIlibgcc.a\fR, a library of internal subroutines
3550 that \s-1GCC\s0 uses to overcome shortcomings of particular machines, or special
3551 needs for some languages.
3553 In most cases, you need \fIlibgcc.a\fR even when you want to avoid
3554 other standard libraries. In other words, when you specify \fB\-nostdlib\fR
3555 or \fB\-nodefaultlibs\fR you should usually specify \fB\-lgcc\fR as well.
3556 This ensures that you have no unresolved references to internal \s-1GCC\s0
3557 library subroutines. (For example, \fB_\|_main\fR, used to ensure \*(C+
3558 constructors will be called.)
3561 Remove all symbol table and relocation information from the executable.
3562 .Ip "\fB\-static\fR" 4
3564 On systems that support dynamic linking, this prevents linking with the shared
3565 libraries. On other systems, this option has no effect.
3566 .Ip "\fB\-shared\fR" 4
3568 Produce a shared object which can then be linked with other objects to
3569 form an executable. Not all systems support this option. For predictable
3570 results, you must also specify the same set of options that were used to
3571 generate code (\fB\-fpic\fR, \fB\-fPIC\fR, or model suboptions)
3572 when you specify this option.[1]
3573 .Ip "\fB\-shared-libgcc\fR" 4
3574 .IX Item "-shared-libgcc"
3576 .Ip "\fB\-static-libgcc\fR" 4
3577 .IX Item "-static-libgcc"
3579 On systems that provide \fIlibgcc\fR as a shared library, these options
3580 force the use of either the shared or static version respectively.
3581 If no shared version of \fIlibgcc\fR was built when the compiler was
3582 configured, these options have no effect.
3584 There are several situations in which an application should use the
3585 shared \fIlibgcc\fR instead of the static version. The most common
3586 of these is when the application wishes to throw and catch exceptions
3587 across different shared libraries. In that case, each of the libraries
3588 as well as the application itself should use the shared \fIlibgcc\fR.
3590 Therefore, whenever you specify the \fB\-shared\fR option, the \s-1GCC\s0
3591 driver automatically adds \fB\-shared-libgcc\fR, unless you explicitly
3592 specify \fB\-static-libgcc\fR. The G++ driver automatically adds
3593 \&\fB\-shared-libgcc\fR when you build a main executable as well because
3594 for \*(C+ programs that is typically the right thing to do.
3595 (Exception-handling will not work reliably otherwise.)
3597 However, when linking a main executable written in C, you must
3598 explicitly say \fB\-shared-libgcc\fR if you want to use the shared
3600 .Ip "\fB\-symbolic\fR" 4
3601 .IX Item "-symbolic"
3602 Bind references to global symbols when building a shared object. Warn
3603 about any unresolved references (unless overridden by the link editor
3604 option \fB\-Xlinker \-z \-Xlinker defs\fR). Only a few systems support
3606 .Ip "\fB\-Xlinker\fR \fIoption\fR" 4
3607 .IX Item "-Xlinker option"
3608 Pass \fIoption\fR as an option to the linker. You can use this to
3609 supply system-specific linker options which \s-1GCC\s0 does not know how to
3612 If you want to pass an option that takes an argument, you must use
3613 \&\fB\-Xlinker\fR twice, once for the option and once for the argument.
3614 For example, to pass \fB\-assert definitions\fR, you must write
3615 \&\fB\-Xlinker \-assert \-Xlinker definitions\fR. It does not work to write
3616 \&\fB\-Xlinker \*(L"\-assert definitions\*(R"\fR, because this passes the entire
3617 string as a single argument, which is not what the linker expects.
3618 .Ip "\fB\-Wl,\fR\fIoption\fR" 4
3619 .IX Item "-Wl,option"
3620 Pass \fIoption\fR as an option to the linker. If \fIoption\fR contains
3621 commas, it is split into multiple options at the commas.
3622 .Ip "\fB\-u\fR \fIsymbol\fR" 4
3623 .IX Item "-u symbol"
3624 Pretend the symbol \fIsymbol\fR is undefined, to force linking of
3625 library modules to define it. You can use \fB\-u\fR multiple times with
3626 different symbols to force loading of additional library modules.
3627 .Sh "Options for Directory Search"
3628 .IX Subsection "Options for Directory Search"
3629 These options specify directories to search for header files, for
3630 libraries and for parts of the compiler:
3631 .Ip "\fB\-I\fR\fIdir\fR" 4
3633 Add the directory \fIdir\fR to the head of the list of directories to be
3634 searched for header files. This can be used to override a system header
3635 file, substituting your own version, since these directories are
3636 searched before the system header file directories. However, you should
3637 not use this option to add directories that contain vendor-supplied
3638 system header files (use \fB\-isystem\fR for that). If you use more than
3639 one \fB\-I\fR option, the directories are scanned in left-to-right
3640 order; the standard system directories come after.
3643 Any directories you specify with \fB\-I\fR options before the \fB\-I-\fR
3644 option are searched only for the case of \fB#include "\fR\fIfile\fR\fB"\fR;
3645 they are not searched for \fB#include <\fR\fIfile\fR\fB>\fR.
3647 If additional directories are specified with \fB\-I\fR options after
3648 the \fB\-I-\fR, these directories are searched for all \fB#include\fR
3649 directives. (Ordinarily \fIall\fR \fB\-I\fR directories are used
3652 In addition, the \fB\-I-\fR option inhibits the use of the current
3653 directory (where the current input file came from) as the first search
3654 directory for \fB#include "\fR\fIfile\fR\fB"\fR. There is no way to
3655 override this effect of \fB\-I-\fR. With \fB\-I.\fR you can specify
3656 searching the directory which was current when the compiler was
3657 invoked. That is not exactly the same as what the preprocessor does
3658 by default, but it is often satisfactory.
3660 \&\fB\-I-\fR does not inhibit the use of the standard system directories
3661 for header files. Thus, \fB\-I-\fR and \fB\-nostdinc\fR are
3663 .Ip "\fB\-L\fR\fIdir\fR" 4
3665 Add directory \fIdir\fR to the list of directories to be searched
3667 .Ip "\fB\-B\fR\fIprefix\fR" 4
3669 This option specifies where to find the executables, libraries,
3670 include files, and data files of the compiler itself.
3672 The compiler driver program runs one or more of the subprograms
3673 \&\fIcpp\fR, \fIcc1\fR, \fIas\fR and \fIld\fR. It tries
3674 \&\fIprefix\fR as a prefix for each program it tries to run, both with and
3675 without \fImachine\fR\fB/\fR\fIversion\fR\fB/\fR.
3677 For each subprogram to be run, the compiler driver first tries the
3678 \&\fB\-B\fR prefix, if any. If that name is not found, or if \fB\-B\fR
3679 was not specified, the driver tries two standard prefixes, which are
3680 \&\fI/usr/lib/gcc/\fR and \fI/usr/local/lib/gcc-lib/\fR. If neither of
3681 those results in a file name that is found, the unmodified program
3682 name is searched for using the directories specified in your
3683 \&\fB\s-1PATH\s0\fR environment variable.
3685 \&\fB\-B\fR prefixes that effectively specify directory names also apply
3686 to libraries in the linker, because the compiler translates these
3687 options into \fB\-L\fR options for the linker. They also apply to
3688 includes files in the preprocessor, because the compiler translates these
3689 options into \fB\-isystem\fR options for the preprocessor. In this case,
3690 the compiler appends \fBinclude\fR to the prefix.
3692 The run-time support file \fIlibgcc.a\fR can also be searched for using
3693 the \fB\-B\fR prefix, if needed. If it is not found there, the two
3694 standard prefixes above are tried, and that is all. The file is left
3695 out of the link if it is not found by those means.
3697 Another way to specify a prefix much like the \fB\-B\fR prefix is to use
3698 the environment variable \fB\s-1GCC_EXEC_PREFIX\s0\fR.
3699 .Ip "\fB\-specs=\fR\fIfile\fR" 4
3700 .IX Item "-specs=file"
3701 Process \fIfile\fR after the compiler reads in the standard \fIspecs\fR
3702 file, in order to override the defaults that the \fIgcc\fR driver
3703 program uses when determining what switches to pass to \fIcc1\fR,
3704 \&\fIcc1plus\fR, \fIas\fR, \fIld\fR, etc. More than one
3705 \&\fB\-specs=\fR\fIfile\fR can be specified on the command line, and they
3706 are processed in order, from left to right.
3707 .Sh "Specifying Target Machine and Compiler Version"
3708 .IX Subsection "Specifying Target Machine and Compiler Version"
3709 By default, \s-1GCC\s0 compiles code for the same type of machine that you
3710 are using. However, it can also be installed as a cross-compiler, to
3711 compile for some other type of machine. In fact, several different
3712 configurations of \s-1GCC\s0, for different target machines, can be
3713 installed side by side. Then you specify which one to use with the
3716 In addition, older and newer versions of \s-1GCC\s0 can be installed side
3717 by side. One of them (probably the newest) will be the default, but
3718 you may sometimes wish to use another.
3719 .Ip "\fB\-b\fR \fImachine\fR" 4
3720 .IX Item "-b machine"
3721 The argument \fImachine\fR specifies the target machine for compilation.
3722 This is useful when you have installed \s-1GCC\s0 as a cross-compiler.
3724 The value to use for \fImachine\fR is the same as was specified as the
3725 machine type when configuring \s-1GCC\s0 as a cross-compiler. For
3726 example, if a cross-compiler was configured with \fBconfigure
3727 i386v\fR, meaning to compile for an 80386 running System V, then you
3728 would specify \fB\-b i386v\fR to run that cross compiler.
3730 When you do not specify \fB\-b\fR, it normally means to compile for
3731 the same type of machine that you are using.
3732 .Ip "\fB\-V\fR \fIversion\fR" 4
3733 .IX Item "-V version"
3734 The argument \fIversion\fR specifies which version of \s-1GCC\s0 to run.
3735 This is useful when multiple versions are installed. For example,
3736 \&\fIversion\fR might be \fB2.0\fR, meaning to run \s-1GCC\s0 version 2.0.
3738 The default version, when you do not specify \fB\-V\fR, is the last
3739 version of \s-1GCC\s0 that you installed.
3741 The \fB\-b\fR and \fB\-V\fR options actually work by controlling part of
3742 the file name used for the executable files and libraries used for
3743 compilation. A given version of \s-1GCC\s0, for a given target machine, is
3744 normally kept in the directory \fI/usr/local/lib/gcc-lib/\fImachine\fI/\fIversion\fI\fR.
3746 Thus, sites can customize the effect of \fB\-b\fR or \fB\-V\fR either by
3747 changing the names of these directories or adding alternate names (or
3748 symbolic links). If in directory \fI/usr/local/lib/gcc-lib/\fR the
3749 file \fI80386\fR is a link to the file \fIi386v\fR, then \fB\-b
3750 80386\fR becomes an alias for \fB\-b i386v\fR.
3752 In one respect, the \fB\-b\fR or \fB\-V\fR do not completely change
3753 to a different compiler: the top-level driver program \fBgcc\fR
3754 that you originally invoked continues to run and invoke the other
3755 executables (preprocessor, compiler per se, assembler and linker)
3756 that do the real work. However, since no real work is done in the
3757 driver program, it usually does not matter that the driver program
3758 in use is not the one for the specified target. It is common for the
3759 interface to the other executables to change incompatibly between
3760 compiler versions, so unless the version specified is very close to that
3761 of the driver (for example, \fB\-V 3.0\fR with a driver program from \s-1GCC\s0
3762 version 3.0.1), use of \fB\-V\fR may not work; for example, using
3763 \&\fB\-V 2.95.2\fR will not work with a driver program from \s-1GCC\s0 3.0.
3765 The only way that the driver program depends on the target machine is
3766 in the parsing and handling of special machine-specific options.
3767 However, this is controlled by a file which is found, along with the
3768 other executables, in the directory for the specified version and
3769 target machine. As a result, a single installed driver program adapts
3770 to any specified target machine, and sufficiently similar compiler
3773 The driver program executable does control one significant thing,
3774 however: the default version and target machine. Therefore, you can
3775 install different instances of the driver program, compiled for
3776 different targets or versions, under different names.
3778 For example, if the driver for version 2.0 is installed as \fBogcc\fR
3779 and that for version 2.1 is installed as \fBgcc\fR, then the command
3780 \&\fBgcc\fR will use version 2.1 by default, while \fBogcc\fR will use
3781 2.0 by default. However, you can choose either version with either
3782 command with the \fB\-V\fR option.
3783 .Sh "Hardware Models and Configurations"
3784 .IX Subsection "Hardware Models and Configurations"
3785 Earlier we discussed the standard option \fB\-b\fR which chooses among
3786 different installed compilers for completely different target
3787 machines, such as Vax vs. 68000 vs. 80386.
3789 In addition, each of these target machine types can have its own
3790 special options, starting with \fB\-m\fR, to choose among various
3791 hardware models or configurations\-\-\-for example, 68010 vs 68020,
3792 floating coprocessor or none. A single installed version of the
3793 compiler can compile for any model or configuration, according to the
3796 Some configurations of the compiler also support additional special
3797 options, usually for compatibility with other compilers on the same
3801 .IX Subsection "M680x0 Options"
3803 These are the \fB\-m\fR options defined for the 68000 series. The default
3804 values for these options depends on which style of 68000 was selected when
3805 the compiler was configured; the defaults for the most common choices are
3807 .Ip "\fB\-m68000\fR" 4
3810 .Ip "\fB\-mc68000\fR" 4
3813 Generate output for a 68000. This is the default
3814 when the compiler is configured for 68000\-based systems.
3816 Use this option for microcontrollers with a 68000 or \s-1EC000\s0 core,
3817 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
3818 .Ip "\fB\-m68020\fR" 4
3821 .Ip "\fB\-mc68020\fR" 4
3824 Generate output for a 68020. This is the default
3825 when the compiler is configured for 68020\-based systems.
3826 .Ip "\fB\-m68881\fR" 4
3828 Generate output containing 68881 instructions for floating point.
3829 This is the default for most 68020 systems unless \fB\-nfp\fR was
3830 specified when the compiler was configured.
3831 .Ip "\fB\-m68030\fR" 4
3833 Generate output for a 68030. This is the default when the compiler is
3834 configured for 68030\-based systems.
3835 .Ip "\fB\-m68040\fR" 4
3837 Generate output for a 68040. This is the default when the compiler is
3838 configured for 68040\-based systems.
3840 This option inhibits the use of 68881/68882 instructions that have to be
3841 emulated by software on the 68040. Use this option if your 68040 does not
3842 have code to emulate those instructions.
3843 .Ip "\fB\-m68060\fR" 4
3845 Generate output for a 68060. This is the default when the compiler is
3846 configured for 68060\-based systems.
3848 This option inhibits the use of 68020 and 68881/68882 instructions that
3849 have to be emulated by software on the 68060. Use this option if your 68060
3850 does not have code to emulate those instructions.
3851 .Ip "\fB\-mcpu32\fR" 4
3853 Generate output for a \s-1CPU32\s0. This is the default
3854 when the compiler is configured for CPU32\-based systems.
3856 Use this option for microcontrollers with a
3857 \&\s-1CPU32\s0 or \s-1CPU32+\s0 core, including the 68330, 68331, 68332, 68333, 68334,
3858 68336, 68340, 68341, 68349 and 68360.
3859 .Ip "\fB\-m5200\fR" 4
3861 Generate output for a 520X \*(L"coldfire\*(R" family cpu. This is the default
3862 when the compiler is configured for 520X-based systems.
3864 Use this option for microcontroller with a 5200 core, including
3865 the \s-1MCF5202\s0, \s-1MCF5203\s0, \s-1MCF5204\s0 and \s-1MCF5202\s0.
3866 .Ip "\fB\-m68020\-40\fR" 4
3867 .IX Item "-m68020-40"
3868 Generate output for a 68040, without using any of the new instructions.
3869 This results in code which can run relatively efficiently on either a
3870 68020/68881 or a 68030 or a 68040. The generated code does use the
3871 68881 instructions that are emulated on the 68040.
3872 .Ip "\fB\-m68020\-60\fR" 4
3873 .IX Item "-m68020-60"
3874 Generate output for a 68060, without using any of the new instructions.
3875 This results in code which can run relatively efficiently on either a
3876 68020/68881 or a 68030 or a 68040. The generated code does use the
3877 68881 instructions that are emulated on the 68060.
3878 .Ip "\fB\-mfpa\fR" 4
3880 Generate output containing Sun \s-1FPA\s0 instructions for floating point.
3881 .Ip "\fB\-msoft-float\fR" 4
3882 .IX Item "-msoft-float"
3883 Generate output containing library calls for floating point.
3884 \&\fBWarning:\fR the requisite libraries are not available for all m68k
3885 targets. Normally the facilities of the machine's usual C compiler are
3886 used, but this can't be done directly in cross-compilation. You must
3887 make your own arrangements to provide suitable library functions for
3888 cross-compilation. The embedded targets \fBm68k-*\-aout\fR and
3889 \&\fBm68k-*\-coff\fR do provide software floating point support.
3890 .Ip "\fB\-mshort\fR" 4
3892 Consider type \f(CW\*(C`int\*(C'\fR to be 16 bits wide, like \f(CW\*(C`short int\*(C'\fR.
3893 .Ip "\fB\-mnobitfield\fR" 4
3894 .IX Item "-mnobitfield"
3895 Do not use the bit-field instructions. The \fB\-m68000\fR, \fB\-mcpu32\fR
3896 and \fB\-m5200\fR options imply \fB\-mnobitfield\fR.
3897 .Ip "\fB\-mbitfield\fR" 4
3898 .IX Item "-mbitfield"
3899 Do use the bit-field instructions. The \fB\-m68020\fR option implies
3900 \&\fB\-mbitfield\fR. This is the default if you use a configuration
3901 designed for a 68020.
3902 .Ip "\fB\-mrtd\fR" 4
3904 Use a different function-calling convention, in which functions
3905 that take a fixed number of arguments return with the \f(CW\*(C`rtd\*(C'\fR
3906 instruction, which pops their arguments while returning. This
3907 saves one instruction in the caller since there is no need to pop
3908 the arguments there.
3910 This calling convention is incompatible with the one normally
3911 used on Unix, so you cannot use it if you need to call libraries
3912 compiled with the Unix compiler.
3914 Also, you must provide function prototypes for all functions that
3915 take variable numbers of arguments (including \f(CW\*(C`printf\*(C'\fR);
3916 otherwise incorrect code will be generated for calls to those
3919 In addition, seriously incorrect code will result if you call a
3920 function with too many arguments. (Normally, extra arguments are
3921 harmlessly ignored.)
3923 The \f(CW\*(C`rtd\*(C'\fR instruction is supported by the 68010, 68020, 68030,
3924 68040, 68060 and \s-1CPU32\s0 processors, but not by the 68000 or 5200.
3925 .Ip "\fB\-malign-int\fR" 4
3926 .IX Item "-malign-int"
3928 .Ip "\fB\-mno-align-int\fR" 4
3929 .IX Item "-mno-align-int"
3931 Control whether \s-1GCC\s0 aligns \f(CW\*(C`int\*(C'\fR, \f(CW\*(C`long\*(C'\fR, \f(CW\*(C`long long\*(C'\fR,
3932 \&\f(CW\*(C`float\*(C'\fR, \f(CW\*(C`double\*(C'\fR, and \f(CW\*(C`long double\*(C'\fR variables on a 32\-bit
3933 boundary (\fB\-malign-int\fR) or a 16\-bit boundary (\fB\-mno-align-int\fR).
3934 Aligning variables on 32\-bit boundaries produces code that runs somewhat
3935 faster on processors with 32\-bit busses at the expense of more memory.
3937 \&\fBWarning:\fR if you use the \fB\-malign-int\fR switch, \s-1GCC\s0 will
3938 align structures containing the above types differently than
3939 most published application binary interface specifications for the m68k.
3940 .Ip "\fB\-mpcrel\fR" 4
3942 Use the pc-relative addressing mode of the 68000 directly, instead of
3943 using a global offset table. At present, this option implies \-fpic,
3944 allowing at most a 16\-bit offset for pc-relative addressing. \-fPIC is
3945 not presently supported with \-mpcrel, though this could be supported for
3946 68020 and higher processors.
3947 .Ip "\fB\-mno-strict-align\fR" 4
3948 .IX Item "-mno-strict-align"
3950 .Ip "\fB\-mstrict-align\fR" 4
3951 .IX Item "-mstrict-align"
3953 Do not (do) assume that unaligned memory references will be handled by
3956 .I "M68hc1x Options"
3957 .IX Subsection "M68hc1x Options"
3959 These are the \fB\-m\fR options defined for the 68hc11 and 68hc12
3960 microcontrollers. The default values for these options depends on
3961 which style of microcontroller was selected when the compiler was configured;
3962 the defaults for the most common choices are given below.
3963 .Ip "\fB\-m6811\fR" 4
3966 .Ip "\fB\-m68hc11\fR" 4
3969 Generate output for a 68HC11. This is the default
3970 when the compiler is configured for 68HC11\-based systems.
3971 .Ip "\fB\-m6812\fR" 4
3974 .Ip "\fB\-m68hc12\fR" 4
3977 Generate output for a 68HC12. This is the default
3978 when the compiler is configured for 68HC12\-based systems.
3979 .Ip "\fB\-mauto-incdec\fR" 4
3980 .IX Item "-mauto-incdec"
3981 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
3983 .Ip "\fB\-mshort\fR" 4
3985 Consider type \f(CW\*(C`int\*(C'\fR to be 16 bits wide, like \f(CW\*(C`short int\*(C'\fR.
3986 .Ip "\fB\-msoft-reg-count=\fR\fIcount\fR" 4
3987 .IX Item "-msoft-reg-count=count"
3988 Specify the number of pseudo-soft registers which are used for the
3989 code generation. The maximum number is 32. Using more pseudo-soft
3990 register may or may not result in better code depending on the program.
3991 The default is 4 for 68HC11 and 2 for 68HC12.
3993 .I "\s-1VAX\s0 Options"
3994 .IX Subsection "VAX Options"
3996 These \fB\-m\fR options are defined for the Vax:
3997 .Ip "\fB\-munix\fR" 4
3999 Do not output certain jump instructions (\f(CW\*(C`aobleq\*(C'\fR and so on)
4000 that the Unix assembler for the Vax cannot handle across long
4002 .Ip "\fB\-mgnu\fR" 4
4004 Do output those jump instructions, on the assumption that you
4005 will assemble with the \s-1GNU\s0 assembler.
4008 Output code for g-format floating point numbers instead of d-format.
4010 .I "\s-1SPARC\s0 Options"
4011 .IX Subsection "SPARC Options"
4013 These \fB\-m\fR switches are supported on the \s-1SPARC:\s0
4014 .Ip "\fB\-mno-app-regs\fR" 4
4015 .IX Item "-mno-app-regs"
4017 .Ip "\fB\-mapp-regs\fR" 4
4018 .IX Item "-mapp-regs"
4020 Specify \fB\-mapp-regs\fR to generate output using the global registers
4021 2 through 4, which the \s-1SPARC\s0 \s-1SVR4\s0 \s-1ABI\s0 reserves for applications. This
4024 To be fully \s-1SVR4\s0 \s-1ABI\s0 compliant at the cost of some performance loss,
4025 specify \fB\-mno-app-regs\fR. You should compile libraries and system
4026 software with this option.
4027 .Ip "\fB\-mfpu\fR" 4
4030 .Ip "\fB\-mhard-float\fR" 4
4031 .IX Item "-mhard-float"
4033 Generate output containing floating point instructions. This is the
4035 .Ip "\fB\-mno-fpu\fR" 4
4038 .Ip "\fB\-msoft-float\fR" 4
4039 .IX Item "-msoft-float"
4041 Generate output containing library calls for floating point.
4042 \&\fBWarning:\fR the requisite libraries are not available for all \s-1SPARC\s0
4043 targets. Normally the facilities of the machine's usual C compiler are
4044 used, but this cannot be done directly in cross-compilation. You must make
4045 your own arrangements to provide suitable library functions for
4046 cross-compilation. The embedded targets \fBsparc-*\-aout\fR and
4047 \&\fBsparclite-*\-*\fR do provide software floating point support.
4049 \&\fB\-msoft-float\fR changes the calling convention in the output file;
4050 therefore, it is only useful if you compile \fIall\fR of a program with
4051 this option. In particular, you need to compile \fIlibgcc.a\fR, the
4052 library that comes with \s-1GCC\s0, with \fB\-msoft-float\fR in order for
4054 .Ip "\fB\-mhard-quad-float\fR" 4
4055 .IX Item "-mhard-quad-float"
4056 Generate output containing quad-word (long double) floating point
4058 .Ip "\fB\-msoft-quad-float\fR" 4
4059 .IX Item "-msoft-quad-float"
4060 Generate output containing library calls for quad-word (long double)
4061 floating point instructions. The functions called are those specified
4062 in the \s-1SPARC\s0 \s-1ABI\s0. This is the default.
4064 As of this writing, there are no sparc implementations that have hardware
4065 support for the quad-word floating point instructions. They all invoke
4066 a trap handler for one of these instructions, and then the trap handler
4067 emulates the effect of the instruction. Because of the trap handler overhead,
4068 this is much slower than calling the \s-1ABI\s0 library routines. Thus the
4069 \&\fB\-msoft-quad-float\fR option is the default.
4070 .Ip "\fB\-mno-epilogue\fR" 4
4071 .IX Item "-mno-epilogue"
4073 .Ip "\fB\-mepilogue\fR" 4
4074 .IX Item "-mepilogue"
4076 With \fB\-mepilogue\fR (the default), the compiler always emits code for
4077 function exit at the end of each function. Any function exit in
4078 the middle of the function (such as a return statement in C) will
4079 generate a jump to the exit code at the end of the function.
4081 With \fB\-mno-epilogue\fR, the compiler tries to emit exit code inline
4082 at every function exit.
4083 .Ip "\fB\-mno-flat\fR" 4
4084 .IX Item "-mno-flat"
4086 .Ip "\fB\-mflat\fR" 4
4089 With \fB\-mflat\fR, the compiler does not generate save/restore instructions
4090 and will use a \*(L"flat\*(R" or single register window calling convention.
4091 This model uses \f(CW%i7\fR as the frame pointer and is compatible with the normal
4092 register window model. Code from either may be intermixed.
4093 The local registers and the input registers (0\-5) are still treated as
4094 \&\*(L"call saved\*(R" registers and will be saved on the stack as necessary.
4096 With \fB\-mno-flat\fR (the default), the compiler emits save/restore
4097 instructions (except for leaf functions) and is the normal mode of operation.
4098 .Ip "\fB\-mno-unaligned-doubles\fR" 4
4099 .IX Item "-mno-unaligned-doubles"
4101 .Ip "\fB\-munaligned-doubles\fR" 4
4102 .IX Item "-munaligned-doubles"
4104 Assume that doubles have 8 byte alignment. This is the default.
4106 With \fB\-munaligned-doubles\fR, \s-1GCC\s0 assumes that doubles have 8 byte
4107 alignment only if they are contained in another type, or if they have an
4108 absolute address. Otherwise, it assumes they have 4 byte alignment.
4109 Specifying this option avoids some rare compatibility problems with code
4110 generated by other compilers. It is not the default because it results
4111 in a performance loss, especially for floating point code.
4112 .Ip "\fB\-mno-faster-structs\fR" 4
4113 .IX Item "-mno-faster-structs"
4115 .Ip "\fB\-mfaster-structs\fR" 4
4116 .IX Item "-mfaster-structs"
4118 With \fB\-mfaster-structs\fR, the compiler assumes that structures
4119 should have 8 byte alignment. This enables the use of pairs of
4120 \&\f(CW\*(C`ldd\*(C'\fR and \f(CW\*(C`std\*(C'\fR instructions for copies in structure
4121 assignment, in place of twice as many \f(CW\*(C`ld\*(C'\fR and \f(CW\*(C`st\*(C'\fR pairs.
4122 However, the use of this changed alignment directly violates the Sparc
4123 \&\s-1ABI\s0. Thus, it's intended only for use on targets where the developer
4124 acknowledges that their resulting code will not be directly in line with
4125 the rules of the \s-1ABI\s0.
4129 .Ip "\fB\-msparclite\fR" 4
4130 .IX Item "-msparclite"
4132 These two options select variations on the \s-1SPARC\s0 architecture.
4134 By default (unless specifically configured for the Fujitsu SPARClite),
4135 \&\s-1GCC\s0 generates code for the v7 variant of the \s-1SPARC\s0 architecture.
4137 \&\fB\-mv8\fR will give you \s-1SPARC\s0 v8 code. The only difference from v7
4138 code is that the compiler emits the integer multiply and integer
4139 divide instructions which exist in \s-1SPARC\s0 v8 but not in \s-1SPARC\s0 v7.
4141 \&\fB\-msparclite\fR will give you SPARClite code. This adds the integer
4142 multiply, integer divide step and scan (\f(CW\*(C`ffs\*(C'\fR) instructions which
4143 exist in SPARClite but not in \s-1SPARC\s0 v7.
4145 These options are deprecated and will be deleted in a future \s-1GCC\s0 release.
4146 They have been replaced with \fB\-mcpu=xxx\fR.
4147 .Ip "\fB\-mcypress\fR" 4
4148 .IX Item "-mcypress"
4150 .Ip "\fB\-msupersparc\fR" 4
4151 .IX Item "-msupersparc"
4153 These two options select the processor for which the code is optimised.
4155 With \fB\-mcypress\fR (the default), the compiler optimizes code for the
4156 Cypress \s-1CY7C602\s0 chip, as used in the SparcStation/SparcServer 3xx series.
4157 This is also appropriate for the older SparcStation 1, 2, \s-1IPX\s0 etc.
4159 With \fB\-msupersparc\fR the compiler optimizes code for the SuperSparc cpu, as
4160 used in the SparcStation 10, 1000 and 2000 series. This flag also enables use
4161 of the full \s-1SPARC\s0 v8 instruction set.
4163 These options are deprecated and will be deleted in a future \s-1GCC\s0 release.
4164 They have been replaced with \fB\-mcpu=xxx\fR.
4165 .Ip "\fB\-mcpu=\fR\fIcpu_type\fR" 4
4166 .IX Item "-mcpu=cpu_type"
4167 Set the instruction set, register set, and instruction scheduling parameters
4168 for machine type \fIcpu_type\fR. Supported values for \fIcpu_type\fR are
4169 \&\fBv7\fR, \fBcypress\fR, \fBv8\fR, \fBsupersparc\fR, \fBsparclite\fR,
4170 \&\fBhypersparc\fR, \fBsparclite86x\fR, \fBf930\fR, \fBf934\fR,
4171 \&\fBsparclet\fR, \fBtsc701\fR, \fBv9\fR, and \fBultrasparc\fR.
4173 Default instruction scheduling parameters are used for values that select
4174 an architecture and not an implementation. These are \fBv7\fR, \fBv8\fR,
4175 \&\fBsparclite\fR, \fBsparclet\fR, \fBv9\fR.
4177 Here is a list of each supported architecture and their supported
4182 \& v8: supersparc, hypersparc
4183 \& sparclite: f930, f934, sparclite86x
4187 .Ip "\fB\-mtune=\fR\fIcpu_type\fR" 4
4188 .IX Item "-mtune=cpu_type"
4189 Set the instruction scheduling parameters for machine type
4190 \&\fIcpu_type\fR, but do not set the instruction set or register set that the
4191 option \fB\-mcpu=\fR\fIcpu_type\fR would.
4193 The same values for \fB\-mcpu=\fR\fIcpu_type\fR are used for
4194 \&\fB\-mtune=\fR\fIcpu_type\fR, though the only useful values are those that
4195 select a particular cpu implementation: \fBcypress\fR, \fBsupersparc\fR,
4196 \&\fBhypersparc\fR, \fBf930\fR, \fBf934\fR, \fBsparclite86x\fR,
4197 \&\fBtsc701\fR, \fBultrasparc\fR.
4199 These \fB\-m\fR switches are supported in addition to the above
4200 on the \s-1SPARCLET\s0 processor.
4201 .Ip "\fB\-mlittle-endian\fR" 4
4202 .IX Item "-mlittle-endian"
4203 Generate code for a processor running in little-endian mode.
4204 .Ip "\fB\-mlive-g0\fR" 4
4205 .IX Item "-mlive-g0"
4206 Treat register \f(CW\*(C`%g0\*(C'\fR as a normal register.
4207 \&\s-1GCC\s0 will continue to clobber it as necessary but will not assume
4208 it always reads as 0.
4209 .Ip "\fB\-mbroken-saverestore\fR" 4
4210 .IX Item "-mbroken-saverestore"
4211 Generate code that does not use non-trivial forms of the \f(CW\*(C`save\*(C'\fR and
4212 \&\f(CW\*(C`restore\*(C'\fR instructions. Early versions of the \s-1SPARCLET\s0 processor do
4213 not correctly handle \f(CW\*(C`save\*(C'\fR and \f(CW\*(C`restore\*(C'\fR instructions used with
4214 arguments. They correctly handle them used without arguments. A \f(CW\*(C`save\*(C'\fR
4215 instruction used without arguments increments the current window pointer
4216 but does not allocate a new stack frame. It is assumed that the window
4217 overflow trap handler will properly handle this case as will interrupt
4220 These \fB\-m\fR switches are supported in addition to the above
4221 on \s-1SPARC\s0 V9 processors in 64 bit environments.
4222 .Ip "\fB\-mlittle-endian\fR" 4
4223 .IX Item "-mlittle-endian"
4224 Generate code for a processor running in little-endian mode.
4231 Generate code for a 32 bit or 64 bit environment.
4232 The 32 bit environment sets int, long and pointer to 32 bits.
4233 The 64 bit environment sets int to 32 bits and long and pointer
4235 .Ip "\fB\-mcmodel=medlow\fR" 4
4236 .IX Item "-mcmodel=medlow"
4237 Generate code for the Medium/Low code model: the program must be linked
4238 in the low 32 bits of the address space. Pointers are 64 bits.
4239 Programs can be statically or dynamically linked.
4240 .Ip "\fB\-mcmodel=medmid\fR" 4
4241 .IX Item "-mcmodel=medmid"
4242 Generate code for the Medium/Middle code model: the program must be linked
4243 in the low 44 bits of the address space, the text segment must be less than
4244 2G bytes, and data segment must be within 2G of the text segment.
4245 Pointers are 64 bits.
4246 .Ip "\fB\-mcmodel=medany\fR" 4
4247 .IX Item "-mcmodel=medany"
4248 Generate code for the Medium/Anywhere code model: the program may be linked
4249 anywhere in the address space, the text segment must be less than
4250 2G bytes, and data segment must be within 2G of the text segment.
4251 Pointers are 64 bits.
4252 .Ip "\fB\-mcmodel=embmedany\fR" 4
4253 .IX Item "-mcmodel=embmedany"
4254 Generate code for the Medium/Anywhere code model for embedded systems:
4255 assume a 32 bit text and a 32 bit data segment, both starting anywhere
4256 (determined at link time). Register \f(CW%g4\fR points to the base of the
4257 data segment. Pointers still 64 bits.
4258 Programs are statically linked, \s-1PIC\s0 is not supported.
4259 .Ip "\fB\-mstack-bias\fR" 4
4260 .IX Item "-mstack-bias"
4262 .Ip "\fB\-mno-stack-bias\fR" 4
4263 .IX Item "-mno-stack-bias"
4265 With \fB\-mstack-bias\fR, \s-1GCC\s0 assumes that the stack pointer, and
4266 frame pointer if present, are offset by \-2047 which must be added back
4267 when making stack frame references.
4268 Otherwise, assume no such offset is present.
4271 .IX Subsection "Convex Options"
4273 These \fB\-m\fR options are defined for Convex:
4276 Generate output for C1. The code will run on any Convex machine.
4277 The preprocessor symbol \f(CW\*(C`_\|_convex_\|_c1_\|_\*(C'\fR is defined.
4280 Generate output for C2. Uses instructions not available on C1.
4281 Scheduling and other optimizations are chosen for max performance on C2.
4282 The preprocessor symbol \f(CW\*(C`_\|_convex_c2_\|_\*(C'\fR is defined.
4283 .Ip "\fB\-mc32\fR" 4
4285 Generate output for C32xx. Uses instructions not available on C1.
4286 Scheduling and other optimizations are chosen for max performance on C32.
4287 The preprocessor symbol \f(CW\*(C`_\|_convex_c32_\|_\*(C'\fR is defined.
4288 .Ip "\fB\-mc34\fR" 4
4290 Generate output for C34xx. Uses instructions not available on C1.
4291 Scheduling and other optimizations are chosen for max performance on C34.
4292 The preprocessor symbol \f(CW\*(C`_\|_convex_c34_\|_\*(C'\fR is defined.
4293 .Ip "\fB\-mc38\fR" 4
4295 Generate output for C38xx. Uses instructions not available on C1.
4296 Scheduling and other optimizations are chosen for max performance on C38.
4297 The preprocessor symbol \f(CW\*(C`_\|_convex_c38_\|_\*(C'\fR is defined.
4298 .Ip "\fB\-margcount\fR" 4
4299 .IX Item "-margcount"
4300 Generate code which puts an argument count in the word preceding each
4301 argument list. This is compatible with regular \s-1CC\s0, and a few programs
4302 may need the argument count word. \s-1GDB\s0 and other source-level debuggers
4303 do not need it; this info is in the symbol table.
4304 .Ip "\fB\-mnoargcount\fR" 4
4305 .IX Item "-mnoargcount"
4306 Omit the argument count word. This is the default.
4307 .Ip "\fB\-mvolatile-cache\fR" 4
4308 .IX Item "-mvolatile-cache"
4309 Allow volatile references to be cached. This is the default.
4310 .Ip "\fB\-mvolatile-nocache\fR" 4
4311 .IX Item "-mvolatile-nocache"
4312 Volatile references bypass the data cache, going all the way to memory.
4313 This is only needed for multi-processor code that does not use standard
4314 synchronization instructions. Making non-volatile references to volatile
4315 locations will not necessarily work.
4316 .Ip "\fB\-mlong32\fR" 4
4318 Type long is 32 bits, the same as type int. This is the default.
4319 .Ip "\fB\-mlong64\fR" 4
4321 Type long is 64 bits, the same as type long long. This option is useless,
4322 because no library support exists for it.
4324 .I "\s-1AMD29K\s0 Options"
4325 .IX Subsection "AMD29K Options"
4327 These \fB\-m\fR options are defined for the \s-1AMD\s0 Am29000:
4330 Generate code that assumes the \f(CW\*(C`DW\*(C'\fR bit is set, i.e., that byte and
4331 halfword operations are directly supported by the hardware. This is the
4333 .Ip "\fB\-mndw\fR" 4
4335 Generate code that assumes the \f(CW\*(C`DW\*(C'\fR bit is not set.
4338 Generate code that assumes the system supports byte and halfword write
4339 operations. This is the default.
4340 .Ip "\fB\-mnbw\fR" 4
4342 Generate code that assumes the systems does not support byte and
4343 halfword write operations. \fB\-mnbw\fR implies \fB\-mndw\fR.
4344 .Ip "\fB\-msmall\fR" 4
4346 Use a small memory model that assumes that all function addresses are
4347 either within a single 256 \s-1KB\s0 segment or at an absolute address of less
4348 than 256k. This allows the \f(CW\*(C`call\*(C'\fR instruction to be used instead
4349 of a \f(CW\*(C`const\*(C'\fR, \f(CW\*(C`consth\*(C'\fR, \f(CW\*(C`calli\*(C'\fR sequence.
4350 .Ip "\fB\-mnormal\fR" 4
4352 Use the normal memory model: Generate \f(CW\*(C`call\*(C'\fR instructions only when
4353 calling functions in the same file and \f(CW\*(C`calli\*(C'\fR instructions
4354 otherwise. This works if each file occupies less than 256 \s-1KB\s0 but allows
4355 the entire executable to be larger than 256 \s-1KB\s0. This is the default.
4356 .Ip "\fB\-mlarge\fR" 4
4358 Always use \f(CW\*(C`calli\*(C'\fR instructions. Specify this option if you expect
4359 a single file to compile into more than 256 \s-1KB\s0 of code.
4360 .Ip "\fB\-m29050\fR" 4
4362 Generate code for the Am29050.
4363 .Ip "\fB\-m29000\fR" 4
4365 Generate code for the Am29000. This is the default.
4366 .Ip "\fB\-mkernel-registers\fR" 4
4367 .IX Item "-mkernel-registers"
4368 Generate references to registers \f(CW\*(C`gr64\-gr95\*(C'\fR instead of to
4369 registers \f(CW\*(C`gr96\-gr127\*(C'\fR. This option can be used when compiling
4370 kernel code that wants a set of global registers disjoint from that used
4373 Note that when this option is used, register names in \fB\-f\fR flags
4374 must use the normal, user-mode, names.
4375 .Ip "\fB\-muser-registers\fR" 4
4376 .IX Item "-muser-registers"
4377 Use the normal set of global registers, \f(CW\*(C`gr96\-gr127\*(C'\fR. This is the
4379 .Ip "\fB\-mstack-check\fR" 4
4380 .IX Item "-mstack-check"
4382 .Ip "\fB\-mno-stack-check\fR" 4
4383 .IX Item "-mno-stack-check"
4385 Insert (or do not insert) a call to \f(CW\*(C`_\|_msp_check\*(C'\fR after each stack
4386 adjustment. This is often used for kernel code.
4387 .Ip "\fB\-mstorem-bug\fR" 4
4388 .IX Item "-mstorem-bug"
4390 .Ip "\fB\-mno-storem-bug\fR" 4
4391 .IX Item "-mno-storem-bug"
4393 \&\fB\-mstorem-bug\fR handles 29k processors which cannot handle the
4394 separation of a mtsrim insn and a storem instruction (most 29000 chips
4395 to date, but not the 29050).
4396 .Ip "\fB\-mno-reuse-arg-regs\fR" 4
4397 .IX Item "-mno-reuse-arg-regs"
4399 .Ip "\fB\-mreuse-arg-regs\fR" 4
4400 .IX Item "-mreuse-arg-regs"
4402 \&\fB\-mno-reuse-arg-regs\fR tells the compiler to only use incoming argument
4403 registers for copying out arguments. This helps detect calling a function
4404 with fewer arguments than it was declared with.
4405 .Ip "\fB\-mno-impure-text\fR" 4
4406 .IX Item "-mno-impure-text"
4408 .Ip "\fB\-mimpure-text\fR" 4
4409 .IX Item "-mimpure-text"
4411 \&\fB\-mimpure-text\fR, used in addition to \fB\-shared\fR, tells the compiler to
4412 not pass \fB\-assert pure-text\fR to the linker when linking a shared object.
4413 .Ip "\fB\-msoft-float\fR" 4
4414 .IX Item "-msoft-float"
4415 Generate output containing library calls for floating point.
4416 \&\fBWarning:\fR the requisite libraries are not part of \s-1GCC\s0.
4417 Normally the facilities of the machine's usual C compiler are used, but
4418 this can't be done directly in cross-compilation. You must make your
4419 own arrangements to provide suitable library functions for
4421 .Ip "\fB\-mno-multm\fR" 4
4422 .IX Item "-mno-multm"
4423 Do not generate multm or multmu instructions. This is useful for some embedded
4424 systems which do not have trap handlers for these instructions.
4426 .I "\s-1ARM\s0 Options"
4427 .IX Subsection "ARM Options"
4429 These \fB\-m\fR options are defined for Advanced \s-1RISC\s0 Machines (\s-1ARM\s0)
4431 .Ip "\fB\-mapcs-frame\fR" 4
4432 .IX Item "-mapcs-frame"
4433 Generate a stack frame that is compliant with the \s-1ARM\s0 Procedure Call
4434 Standard for all functions, even if this is not strictly necessary for
4435 correct execution of the code. Specifying \fB\-fomit-frame-pointer\fR
4436 with this option will cause the stack frames not to be generated for
4437 leaf functions. The default is \fB\-mno-apcs-frame\fR.
4438 .Ip "\fB\-mapcs\fR" 4
4440 This is a synonym for \fB\-mapcs-frame\fR.
4441 .Ip "\fB\-mapcs-26\fR" 4
4442 .IX Item "-mapcs-26"
4443 Generate code for a processor running with a 26\-bit program counter,
4444 and conforming to the function calling standards for the \s-1APCS\s0 26\-bit
4445 option. This option replaces the \fB\-m2\fR and \fB\-m3\fR options
4446 of previous releases of the compiler.
4447 .Ip "\fB\-mapcs-32\fR" 4
4448 .IX Item "-mapcs-32"
4449 Generate code for a processor running with a 32\-bit program counter,
4450 and conforming to the function calling standards for the \s-1APCS\s0 32\-bit
4451 option. This option replaces the \fB\-m6\fR option of previous releases
4453 .Ip "\fB\-mapcs-stack-check\fR" 4
4454 .IX Item "-mapcs-stack-check"
4455 Generate code to check the amount of stack space available upon entry to
4456 every function (that actually uses some stack space). If there is
4457 insufficient space available then either the function
4458 \&\fB_\|_rt_stkovf_split_small\fR or \fB_\|_rt_stkovf_split_big\fR will be
4459 called, depending upon the amount of stack space required. The run time
4460 system is required to provide these functions. The default is
4461 \&\fB\-mno-apcs-stack-check\fR, since this produces smaller code.
4462 .Ip "\fB\-mapcs-float\fR" 4
4463 .IX Item "-mapcs-float"
4464 Pass floating point arguments using the float point registers. This is
4465 one of the variants of the \s-1APCS\s0. This option is recommended if the
4466 target hardware has a floating point unit or if a lot of floating point
4467 arithmetic is going to be performed by the code. The default is
4468 \&\fB\-mno-apcs-float\fR, since integer only code is slightly increased in
4469 size if \fB\-mapcs-float\fR is used.
4470 .Ip "\fB\-mapcs-reentrant\fR" 4
4471 .IX Item "-mapcs-reentrant"
4472 Generate reentrant, position independent code. This is the equivalent
4473 to specifying the \fB\-fpic\fR option. The default is
4474 \&\fB\-mno-apcs-reentrant\fR.
4475 .Ip "\fB\-mthumb-interwork\fR" 4
4476 .IX Item "-mthumb-interwork"
4477 Generate code which supports calling between the \s-1ARM\s0 and \s-1THUMB\s0
4478 instruction sets. Without this option the two instruction sets cannot
4479 be reliably used inside one program. The default is
4480 \&\fB\-mno-thumb-interwork\fR, since slightly larger code is generated
4481 when \fB\-mthumb-interwork\fR is specified.
4482 .Ip "\fB\-mno-sched-prolog\fR" 4
4483 .IX Item "-mno-sched-prolog"
4484 Prevent the reordering of instructions in the function prolog, or the
4485 merging of those instruction with the instructions in the function's
4486 body. This means that all functions will start with a recognizable set
4487 of instructions (or in fact one of a choice from a small set of
4488 different function prologues), and this information can be used to
4489 locate the start if functions inside an executable piece of code. The
4490 default is \fB\-msched-prolog\fR.
4491 .Ip "\fB\-mhard-float\fR" 4
4492 .IX Item "-mhard-float"
4493 Generate output containing floating point instructions. This is the
4495 .Ip "\fB\-msoft-float\fR" 4
4496 .IX Item "-msoft-float"
4497 Generate output containing library calls for floating point.
4498 \&\fBWarning:\fR the requisite libraries are not available for all \s-1ARM\s0
4499 targets. Normally the facilities of the machine's usual C compiler are
4500 used, but this cannot be done directly in cross-compilation. You must make
4501 your own arrangements to provide suitable library functions for
4504 \&\fB\-msoft-float\fR changes the calling convention in the output file;
4505 therefore, it is only useful if you compile \fIall\fR of a program with
4506 this option. In particular, you need to compile \fIlibgcc.a\fR, the
4507 library that comes with \s-1GCC\s0, with \fB\-msoft-float\fR in order for
4509 .Ip "\fB\-mlittle-endian\fR" 4
4510 .IX Item "-mlittle-endian"
4511 Generate code for a processor running in little-endian mode. This is
4512 the default for all standard configurations.
4513 .Ip "\fB\-mbig-endian\fR" 4
4514 .IX Item "-mbig-endian"
4515 Generate code for a processor running in big-endian mode; the default is
4516 to compile code for a little-endian processor.
4517 .Ip "\fB\-mwords-little-endian\fR" 4
4518 .IX Item "-mwords-little-endian"
4519 This option only applies when generating code for big-endian processors.
4520 Generate code for a little-endian word order but a big-endian byte
4521 order. That is, a byte order of the form \fB32107654\fR. Note: this
4522 option should only be used if you require compatibility with code for
4523 big-endian \s-1ARM\s0 processors generated by versions of the compiler prior to
4525 .Ip "\fB\-malignment-traps\fR" 4
4526 .IX Item "-malignment-traps"
4527 Generate code that will not trap if the \s-1MMU\s0 has alignment traps enabled.
4528 On \s-1ARM\s0 architectures prior to ARMv4, there were no instructions to
4529 access half-word objects stored in memory. However, when reading from
4530 memory a feature of the \s-1ARM\s0 architecture allows a word load to be used,
4531 even if the address is unaligned, and the processor core will rotate the
4532 data as it is being loaded. This option tells the compiler that such
4533 misaligned accesses will cause a \s-1MMU\s0 trap and that it should instead
4534 synthesise the access as a series of byte accesses. The compiler can
4535 still use word accesses to load half-word data if it knows that the
4536 address is aligned to a word boundary.
4538 This option is ignored when compiling for \s-1ARM\s0 architecture 4 or later,
4539 since these processors have instructions to directly access half-word
4541 .Ip "\fB\-mno-alignment-traps\fR" 4
4542 .IX Item "-mno-alignment-traps"
4543 Generate code that assumes that the \s-1MMU\s0 will not trap unaligned
4544 accesses. This produces better code when the target instruction set
4545 does not have half-word memory operations (implementations prior to
4548 Note that you cannot use this option to access unaligned word objects,
4549 since the processor will only fetch one 32\-bit aligned object from
4552 The default setting for most targets is \-mno-alignment-traps, since
4553 this produces better code when there are no half-word memory
4554 instructions available.
4555 .Ip "\fB\-mshort-load-bytes\fR" 4
4556 .IX Item "-mshort-load-bytes"
4557 This is a deprecated alias for \fB\-malignment-traps\fR.
4558 .Ip "\fB\-mno-short-load-bytes\fR" 4
4559 .IX Item "-mno-short-load-bytes"
4560 This is a deprecated alias for \fB\-mno-alignment-traps\fR.
4561 .Ip "\fB\-mshort-load-words\fR" 4
4562 .IX Item "-mshort-load-words"
4563 This is a deprecated alias for \fB\-mno-alignment-traps\fR.
4564 .Ip "\fB\-mno-short-load-words\fR" 4
4565 .IX Item "-mno-short-load-words"
4566 This is a deprecated alias for \fB\-malignment-traps\fR.
4567 .Ip "\fB\-mbsd\fR" 4
4569 This option only applies to \s-1RISC\s0 iX. Emulate the native BSD-mode
4570 compiler. This is the default if \fB\-ansi\fR is not specified.
4571 .Ip "\fB\-mxopen\fR" 4
4573 This option only applies to \s-1RISC\s0 iX. Emulate the native X/Open-mode
4575 .Ip "\fB\-mno-symrename\fR" 4
4576 .IX Item "-mno-symrename"
4577 This option only applies to \s-1RISC\s0 iX. Do not run the assembler
4578 post-processor, \fBsymrename\fR, after code has been assembled.
4579 Normally it is necessary to modify some of the standard symbols in
4580 preparation for linking with the \s-1RISC\s0 iX C library; this option
4581 suppresses this pass. The post-processor is never run when the
4582 compiler is built for cross-compilation.
4583 .Ip "\fB\-mcpu=<name>\fR" 4
4584 .IX Item "-mcpu=<name>"
4585 This specifies the name of the target \s-1ARM\s0 processor. \s-1GCC\s0 uses this name
4586 to determine what kind of instructions it can use when generating
4587 assembly code. Permissible names are: arm2, arm250, arm3, arm6, arm60,
4588 arm600, arm610, arm620, arm7, arm7m, arm7d, arm7dm, arm7di, arm7dmi,
4589 arm70, arm700, arm700i, arm710, arm710c, arm7100, arm7500, arm7500fe,
4590 arm7tdmi, arm8, strongarm, strongarm110, strongarm1100, arm8, arm810,
4591 arm9, arm920, arm920t, arm9tdmi.
4592 .Ip "\fB\-mtune=<name>\fR" 4
4593 .IX Item "-mtune=<name>"
4594 This option is very similar to the \fB\-mcpu=\fR option, except that
4595 instead of specifying the actual target processor type, and hence
4596 restricting which instructions can be used, it specifies that \s-1GCC\s0 should
4597 tune the performance of the code as if the target were of the type
4598 specified in this option, but still choosing the instructions that it
4599 will generate based on the cpu specified by a \fB\-mcpu=\fR option.
4600 For some arm implementations better performance can be obtained by using
4602 .Ip "\fB\-march=<name>\fR" 4
4603 .IX Item "-march=<name>"
4604 This specifies the name of the target \s-1ARM\s0 architecture. \s-1GCC\s0 uses this
4605 name to determine what kind of instructions it can use when generating
4606 assembly code. This option can be used in conjunction with or instead
4607 of the \fB\-mcpu=\fR option. Permissible names are: armv2, armv2a,
4608 armv3, armv3m, armv4, armv4t, armv5.
4609 .Ip "\fB\-mfpe=<number>\fR" 4
4610 .IX Item "-mfpe=<number>"
4612 .Ip "\fB\-mfp=<number>\fR" 4
4613 .IX Item "-mfp=<number>"
4615 This specifies the version of the floating point emulation available on
4616 the target. Permissible values are 2 and 3. \fB\-mfp=\fR is a synonym
4617 for \fB\-mfpe=\fR to support older versions of \s-1GCC\s0.
4618 .Ip "\fB\-mstructure-size-boundary=<n>\fR" 4
4619 .IX Item "-mstructure-size-boundary=<n>"
4620 The size of all structures and unions will be rounded up to a multiple
4621 of the number of bits set by this option. Permissible values are 8 and
4622 32. The default value varies for different toolchains. For the \s-1COFF\s0
4623 targeted toolchain the default value is 8. Specifying the larger number
4624 can produce faster, more efficient code, but can also increase the size
4625 of the program. The two values are potentially incompatible. Code
4626 compiled with one value cannot necessarily expect to work with code or
4627 libraries compiled with the other value, if they exchange information
4628 using structures or unions. Programmers are encouraged to use the 32
4629 value as future versions of the toolchain may default to this value.
4630 .Ip "\fB\-mabort-on-noreturn\fR" 4
4631 .IX Item "-mabort-on-noreturn"
4632 Generate a call to the function abort at the end of a noreturn function.
4633 It will be executed if the function tries to return.
4634 .Ip "\fB\-mlong-calls\fR" 4
4635 .IX Item "-mlong-calls"
4637 .Ip "\fB\-mno-long-calls\fR" 4
4638 .IX Item "-mno-long-calls"
4640 Tells the compiler to perform function calls by first loading the
4641 address of the function into a register and then performing a subroutine
4642 call on this register. This switch is needed if the target function
4643 will lie outside of the 64 megabyte addressing range of the offset based
4644 version of subroutine call instruction.
4646 Even if this switch is enabled, not all function calls will be turned
4647 into long calls. The heuristic is that static functions, functions
4648 which have the \fBshort-call\fR attribute, functions that are inside
4649 the scope of a \fB#pragma no_long_calls\fR directive and functions whose
4650 definitions have already been compiled within the current compilation
4651 unit, will not be turned into long calls. The exception to this rule is
4652 that weak function definitions, functions with the \fBlong-call\fR
4653 attribute or the \fBsection\fR attribute, and functions that are within
4654 the scope of a \fB#pragma long_calls\fR directive, will always be
4655 turned into long calls.
4657 This feature is not enabled by default. Specifying
4658 \&\fB\*(--no-long-calls\fR will restore the default behaviour, as will
4659 placing the function calls within the scope of a \fB#pragma
4660 long_calls_off\fR directive. Note these switches have no effect on how
4661 the compiler generates code to handle function calls via function
4663 .Ip "\fB\-mnop-fun-dllimport\fR" 4
4664 .IX Item "-mnop-fun-dllimport"
4665 Disable the support for the \fIdllimport\fR attribute.
4666 .Ip "\fB\-msingle-pic-base\fR" 4
4667 .IX Item "-msingle-pic-base"
4668 Treat the register used for \s-1PIC\s0 addressing as read-only, rather than
4669 loading it in the prologue for each function. The run-time system is
4670 responsible for initialising this register with an appropriate value
4671 before execution begins.
4672 .Ip "\fB\-mpic-register=<reg>\fR" 4
4673 .IX Item "-mpic-register=<reg>"
4674 Specify the register to be used for \s-1PIC\s0 addressing. The default is R10
4675 unless stack-checking is enabled, when R9 is used.
4678 .IX Subsection "Thumb Options"
4679 .Ip "\fB\-mthumb-interwork\fR" 4
4680 .IX Item "-mthumb-interwork"
4681 Generate code which supports calling between the \s-1THUMB\s0 and \s-1ARM\s0
4682 instruction sets. Without this option the two instruction sets cannot
4683 be reliably used inside one program. The default is
4684 \&\fB\-mno-thumb-interwork\fR, since slightly smaller code is generated
4686 .Ip "\fB\-mtpcs-frame\fR" 4
4687 .IX Item "-mtpcs-frame"
4688 Generate a stack frame that is compliant with the Thumb Procedure Call
4689 Standard for all non-leaf functions. (A leaf function is one that does
4690 not call any other functions). The default is \fB\-mno-apcs-frame\fR.
4691 .Ip "\fB\-mtpcs-leaf-frame\fR" 4
4692 .IX Item "-mtpcs-leaf-frame"
4693 Generate a stack frame that is compliant with the Thumb Procedure Call
4694 Standard for all leaf functions. (A leaf function is one that does
4695 not call any other functions). The default is \fB\-mno-apcs-leaf-frame\fR.
4696 .Ip "\fB\-mlittle-endian\fR" 4
4697 .IX Item "-mlittle-endian"
4698 Generate code for a processor running in little-endian mode. This is
4699 the default for all standard configurations.
4700 .Ip "\fB\-mbig-endian\fR" 4
4701 .IX Item "-mbig-endian"
4702 Generate code for a processor running in big-endian mode.
4703 .Ip "\fB\-mstructure-size-boundary=<n>\fR" 4
4704 .IX Item "-mstructure-size-boundary=<n>"
4705 The size of all structures and unions will be rounded up to a multiple
4706 of the number of bits set by this option. Permissible values are 8 and
4707 32. The default value varies for different toolchains. For the \s-1COFF\s0
4708 targeted toolchain the default value is 8. Specifying the larger number
4709 can produced faster, more efficient code, but can also increase the size
4710 of the program. The two values are potentially incompatible. Code
4711 compiled with one value cannot necessarily expect to work with code or
4712 libraries compiled with the other value, if they exchange information
4713 using structures or unions. Programmers are encouraged to use the 32
4714 value as future versions of the toolchain may default to this value.
4715 .Ip "\fB\-mnop-fun-dllimport\fR" 4
4716 .IX Item "-mnop-fun-dllimport"
4717 Disable the support for the \fIdllimport\fR attribute.
4718 .Ip "\fB\-mcallee-super-interworking\fR" 4
4719 .IX Item "-mcallee-super-interworking"
4720 Gives all externally visible functions in the file being compiled an \s-1ARM\s0
4721 instruction set header which switches to Thumb mode before executing the
4722 rest of the function. This allows these functions to be called from
4723 non-interworking code.
4724 .Ip "\fB\-mcaller-super-interworking\fR" 4
4725 .IX Item "-mcaller-super-interworking"
4726 Allows calls via function pointers (including virtual functions) to
4727 execute correctly regardless of whether the target code has been
4728 compiled for interworking or not. There is a small overhead in the cost
4729 of executing a function pointer if this option is enabled.
4730 .Ip "\fB\-msingle-pic-base\fR" 4
4731 .IX Item "-msingle-pic-base"
4732 Treat the register used for \s-1PIC\s0 addressing as read-only, rather than
4733 loading it in the prologue for each function. The run-time system is
4734 responsible for initialising this register with an appropriate value
4735 before execution begins.
4736 .Ip "\fB\-mpic-register=<reg>\fR" 4
4737 .IX Item "-mpic-register=<reg>"
4738 Specify the register to be used for \s-1PIC\s0 addressing. The default is R10.
4740 .I "\s-1MN10200\s0 Options"
4741 .IX Subsection "MN10200 Options"
4743 These \fB\-m\fR options are defined for Matsushita \s-1MN10200\s0 architectures:
4744 .Ip "\fB\-mrelax\fR" 4
4746 Indicate to the linker that it should perform a relaxation optimization pass
4747 to shorten branches, calls and absolute memory addresses. This option only
4748 has an effect when used on the command line for the final link step.
4750 This option makes symbolic debugging impossible.
4752 .I "\s-1MN10300\s0 Options"
4753 .IX Subsection "MN10300 Options"
4755 These \fB\-m\fR options are defined for Matsushita \s-1MN10300\s0 architectures:
4756 .Ip "\fB\-mmult-bug\fR" 4
4757 .IX Item "-mmult-bug"
4758 Generate code to avoid bugs in the multiply instructions for the \s-1MN10300\s0
4759 processors. This is the default.
4760 .Ip "\fB\-mno-mult-bug\fR" 4
4761 .IX Item "-mno-mult-bug"
4762 Do not generate code to avoid bugs in the multiply instructions for the
4763 \&\s-1MN10300\s0 processors.
4764 .Ip "\fB\-mam33\fR" 4
4766 Generate code which uses features specific to the \s-1AM33\s0 processor.
4767 .Ip "\fB\-mno-am33\fR" 4
4768 .IX Item "-mno-am33"
4769 Do not generate code which uses features specific to the \s-1AM33\s0 processor. This
4771 .Ip "\fB\-mrelax\fR" 4
4773 Indicate to the linker that it should perform a relaxation optimization pass
4774 to shorten branches, calls and absolute memory addresses. This option only
4775 has an effect when used on the command line for the final link step.
4777 This option makes symbolic debugging impossible.
4780 .IX Subsection "M32R/D Options"
4782 These \fB\-m\fR options are defined for Mitsubishi M32R/D architectures:
4783 .Ip "\fB\-mcode-model=small\fR" 4
4784 .IX Item "-mcode-model=small"
4785 Assume all objects live in the lower 16MB of memory (so that their addresses
4786 can be loaded with the \f(CW\*(C`ld24\*(C'\fR instruction), and assume all subroutines
4787 are reachable with the \f(CW\*(C`bl\*(C'\fR instruction.
4788 This is the default.
4790 The addressability of a particular object can be set with the
4791 \&\f(CW\*(C`model\*(C'\fR attribute.
4792 .Ip "\fB\-mcode-model=medium\fR" 4
4793 .IX Item "-mcode-model=medium"
4794 Assume objects may be anywhere in the 32 bit address space (the compiler
4795 will generate \f(CW\*(C`seth/add3\*(C'\fR instructions to load their addresses), and
4796 assume all subroutines are reachable with the \f(CW\*(C`bl\*(C'\fR instruction.
4797 .Ip "\fB\-mcode-model=large\fR" 4
4798 .IX Item "-mcode-model=large"
4799 Assume objects may be anywhere in the 32 bit address space (the compiler
4800 will generate \f(CW\*(C`seth/add3\*(C'\fR instructions to load their addresses), and
4801 assume subroutines may not be reachable with the \f(CW\*(C`bl\*(C'\fR instruction
4802 (the compiler will generate the much slower \f(CW\*(C`seth/add3/jl\*(C'\fR
4803 instruction sequence).
4804 .Ip "\fB\-msdata=none\fR" 4
4805 .IX Item "-msdata=none"
4806 Disable use of the small data area. Variables will be put into
4807 one of \fB.data\fR, \fBbss\fR, or \fB.rodata\fR (unless the
4808 \&\f(CW\*(C`section\*(C'\fR attribute has been specified).
4809 This is the default.
4811 The small data area consists of sections \fB.sdata\fR and \fB.sbss\fR.
4812 Objects may be explicitly put in the small data area with the
4813 \&\f(CW\*(C`section\*(C'\fR attribute using one of these sections.
4814 .Ip "\fB\-msdata=sdata\fR" 4
4815 .IX Item "-msdata=sdata"
4816 Put small global and static data in the small data area, but do not
4817 generate special code to reference them.
4818 .Ip "\fB\-msdata=use\fR" 4
4819 .IX Item "-msdata=use"
4820 Put small global and static data in the small data area, and generate
4821 special instructions to reference them.
4822 .Ip "\fB\-G\fR \fInum\fR" 4
4824 Put global and static objects less than or equal to \fInum\fR bytes
4825 into the small data or bss sections instead of the normal data or bss
4826 sections. The default value of \fInum\fR is 8.
4827 The \fB\-msdata\fR option must be set to one of \fBsdata\fR or \fBuse\fR
4828 for this option to have any effect.
4830 All modules should be compiled with the same \fB\-G\fR \fInum\fR value.
4831 Compiling with different values of \fInum\fR may or may not work; if it
4832 doesn't the linker will give an error message \- incorrect code will not be
4836 .IX Subsection "M88K Options"
4838 These \fB\-m\fR options are defined for Motorola 88k architectures:
4839 .Ip "\fB\-m88000\fR" 4
4841 Generate code that works well on both the m88100 and the
4843 .Ip "\fB\-m88100\fR" 4
4845 Generate code that works best for the m88100, but that also
4847 .Ip "\fB\-m88110\fR" 4
4849 Generate code that works best for the m88110, and may not run
4851 .Ip "\fB\-mbig-pic\fR" 4
4852 .IX Item "-mbig-pic"
4853 Obsolete option to be removed from the next revision.
4855 .Ip "\fB\-midentify-revision\fR" 4
4856 .IX Item "-midentify-revision"
4857 Include an \f(CW\*(C`ident\*(C'\fR directive in the assembler output recording the
4858 source file name, compiler name and version, timestamp, and compilation
4860 .Ip "\fB\-mno-underscores\fR" 4
4861 .IX Item "-mno-underscores"
4862 In assembler output, emit symbol names without adding an underscore
4863 character at the beginning of each name. The default is to use an
4864 underscore as prefix on each name.
4865 .Ip "\fB\-mocs-debug-info\fR" 4
4866 .IX Item "-mocs-debug-info"
4868 .Ip "\fB\-mno-ocs-debug-info\fR" 4
4869 .IX Item "-mno-ocs-debug-info"
4871 Include (or omit) additional debugging information (about registers used
4872 in each stack frame) as specified in the 88open Object Compatibility
4873 Standard, ``\s-1OCS\s0''. This extra information allows debugging of code that
4874 has had the frame pointer eliminated. The default for \s-1DG/UX\s0, SVr4, and
4875 Delta 88 SVr3.2 is to include this information; other 88k configurations
4876 omit this information by default.
4877 .Ip "\fB\-mocs-frame-position\fR" 4
4878 .IX Item "-mocs-frame-position"
4879 When emitting \s-1COFF\s0 debugging information for automatic variables and
4880 parameters stored on the stack, use the offset from the canonical frame
4881 address, which is the stack pointer (register 31) on entry to the
4882 function. The \s-1DG/UX\s0, SVr4, Delta88 SVr3.2, and \s-1BCS\s0 configurations use
4883 \&\fB\-mocs-frame-position\fR; other 88k configurations have the default
4884 \&\fB\-mno-ocs-frame-position\fR.
4885 .Ip "\fB\-mno-ocs-frame-position\fR" 4
4886 .IX Item "-mno-ocs-frame-position"
4887 When emitting \s-1COFF\s0 debugging information for automatic variables and
4888 parameters stored on the stack, use the offset from the frame pointer
4889 register (register 30). When this option is in effect, the frame
4890 pointer is not eliminated when debugging information is selected by the
4892 .Ip "\fB\-moptimize-arg-area\fR" 4
4893 .IX Item "-moptimize-arg-area"
4895 .Ip "\fB\-mno-optimize-arg-area\fR" 4
4896 .IX Item "-mno-optimize-arg-area"
4898 Control how function arguments are stored in stack frames.
4899 \&\fB\-moptimize-arg-area\fR saves space by optimizing them, but this
4900 conflicts with the 88open specifications. The opposite alternative,
4901 \&\fB\-mno-optimize-arg-area\fR, agrees with 88open standards. By default
4902 \&\s-1GCC\s0 does not optimize the argument area.
4903 .Ip "\fB\-mshort-data-\fR\fInum\fR" 4
4904 .IX Item "-mshort-data-num"
4905 Generate smaller data references by making them relative to \f(CW\*(C`r0\*(C'\fR,
4906 which allows loading a value using a single instruction (rather than the
4907 usual two). You control which data references are affected by
4908 specifying \fInum\fR with this option. For example, if you specify
4909 \&\fB\-mshort-data-512\fR, then the data references affected are those
4910 involving displacements of less than 512 bytes.
4911 \&\fB\-mshort-data-\fR\fInum\fR is not effective for \fInum\fR greater
4913 .Ip "\fB\-mserialize-volatile\fR" 4
4914 .IX Item "-mserialize-volatile"
4916 .Ip "\fB\-mno-serialize-volatile\fR" 4
4917 .IX Item "-mno-serialize-volatile"
4919 Do, or don't, generate code to guarantee sequential consistency
4920 of volatile memory references. By default, consistency is
4923 The order of memory references made by the \s-1MC88110\s0 processor does
4924 not always match the order of the instructions requesting those
4925 references. In particular, a load instruction may execute before
4926 a preceding store instruction. Such reordering violates
4927 sequential consistency of volatile memory references, when there
4928 are multiple processors. When consistency must be guaranteed,
4929 \&\s-1GNU\s0 C generates special instructions, as needed, to force
4930 execution in the proper order.
4932 The \s-1MC88100\s0 processor does not reorder memory references and so
4933 always provides sequential consistency. However, by default, \s-1GNU\s0
4934 C generates the special instructions to guarantee consistency
4935 even when you use \fB\-m88100\fR, so that the code may be run on an
4936 \&\s-1MC88110\s0 processor. If you intend to run your code only on the
4937 \&\s-1MC88100\s0 processor, you may use \fB\-mno-serialize-volatile\fR.
4939 The extra code generated to guarantee consistency may affect the
4940 performance of your application. If you know that you can safely
4941 forgo this guarantee, you may use \fB\-mno-serialize-volatile\fR.
4942 .Ip "\fB\-msvr4\fR" 4
4945 .Ip "\fB\-msvr3\fR" 4
4948 Turn on (\fB\-msvr4\fR) or off (\fB\-msvr3\fR) compiler extensions
4949 related to System V release 4 (SVr4). This controls the following:
4952 Which variant of the assembler syntax to emit.
4954 \&\fB\-msvr4\fR makes the C preprocessor recognize \fB#pragma weak\fR
4955 that is used on System V release 4.
4957 \&\fB\-msvr4\fR makes \s-1GCC\s0 issue additional declaration directives used in
4962 \&\fB\-msvr4\fR is the default for the m88k-motorola-sysv4 and
4963 m88k-dg-dgux m88k configurations. \fB\-msvr3\fR is the default for all
4964 other m88k configurations.
4966 .Ip "\fB\-mversion-03.00\fR" 4
4967 .IX Item "-mversion-03.00"
4968 This option is obsolete, and is ignored.
4969 .Ip "\fB\-mno-check-zero-division\fR" 4
4970 .IX Item "-mno-check-zero-division"
4972 .Ip "\fB\-mcheck-zero-division\fR" 4
4973 .IX Item "-mcheck-zero-division"
4975 Do, or don't, generate code to guarantee that integer division by
4976 zero will be detected. By default, detection is guaranteed.
4978 Some models of the \s-1MC88100\s0 processor fail to trap upon integer
4979 division by zero under certain conditions. By default, when
4980 compiling code that might be run on such a processor, \s-1GNU\s0 C
4981 generates code that explicitly checks for zero-valued divisors
4982 and traps with exception number 503 when one is detected. Use of
4983 mno-check-zero-division suppresses such checking for code
4984 generated to run on an \s-1MC88100\s0 processor.
4986 \&\s-1GNU\s0 C assumes that the \s-1MC88110\s0 processor correctly detects all
4987 instances of integer division by zero. When \fB\-m88110\fR is
4988 specified, both \fB\-mcheck-zero-division\fR and
4989 \&\fB\-mno-check-zero-division\fR are ignored, and no explicit checks for
4990 zero-valued divisors are generated.
4991 .Ip "\fB\-muse-div-instruction\fR" 4
4992 .IX Item "-muse-div-instruction"
4993 Use the div instruction for signed integer division on the
4994 \&\s-1MC88100\s0 processor. By default, the div instruction is not used.
4996 On the \s-1MC88100\s0 processor the signed integer division instruction
4997 div) traps to the operating system on a negative operand. The
4998 operating system transparently completes the operation, but at a
4999 large cost in execution time. By default, when compiling code
5000 that might be run on an \s-1MC88100\s0 processor, \s-1GNU\s0 C emulates signed
5001 integer division using the unsigned integer division instruction
5002 divu), thereby avoiding the large penalty of a trap to the
5003 operating system. Such emulation has its own, smaller, execution
5004 cost in both time and space. To the extent that your code's
5005 important signed integer division operations are performed on two
5006 nonnegative operands, it may be desirable to use the div
5007 instruction directly.
5009 On the \s-1MC88110\s0 processor the div instruction (also known as the
5010 divs instruction) processes negative operands without trapping to
5011 the operating system. When \fB\-m88110\fR is specified,
5012 \&\fB\-muse-div-instruction\fR is ignored, and the div instruction is used
5013 for signed integer division.
5015 Note that the result of dividing \s-1INT_MIN\s0 by \-1 is undefined. In
5016 particular, the behavior of such a division with and without
5017 \&\fB\-muse-div-instruction\fR may differ.
5018 .Ip "\fB\-mtrap-large-shift\fR" 4
5019 .IX Item "-mtrap-large-shift"
5021 .Ip "\fB\-mhandle-large-shift\fR" 4
5022 .IX Item "-mhandle-large-shift"
5024 Include code to detect bit-shifts of more than 31 bits; respectively,
5025 trap such shifts or emit code to handle them properly. By default \s-1GCC\s0
5026 makes no special provision for large bit shifts.
5027 .Ip "\fB\-mwarn-passed-structs\fR" 4
5028 .IX Item "-mwarn-passed-structs"
5029 Warn when a function passes a struct as an argument or result.
5030 Structure-passing conventions have changed during the evolution of the C
5031 language, and are often the source of portability problems. By default,
5032 \&\s-1GCC\s0 issues no such warning.
5034 .I "\s-1IBM\s0 \s-1RS/6000\s0 and PowerPC Options"
5035 .IX Subsection "IBM RS/6000 and PowerPC Options"
5037 These \fB\-m\fR options are defined for the \s-1IBM\s0 \s-1RS/6000\s0 and PowerPC:
5038 .Ip "\fB\-mpower\fR" 4
5041 .Ip "\fB\-mno-power\fR" 4
5042 .IX Item "-mno-power"
5043 .Ip "\fB\-mpower2\fR" 4
5045 .Ip "\fB\-mno-power2\fR" 4
5046 .IX Item "-mno-power2"
5047 .Ip "\fB\-mpowerpc\fR" 4
5048 .IX Item "-mpowerpc"
5049 .Ip "\fB\-mno-powerpc\fR" 4
5050 .IX Item "-mno-powerpc"
5051 .Ip "\fB\-mpowerpc-gpopt\fR" 4
5052 .IX Item "-mpowerpc-gpopt"
5053 .Ip "\fB\-mno-powerpc-gpopt\fR" 4
5054 .IX Item "-mno-powerpc-gpopt"
5055 .Ip "\fB\-mpowerpc-gfxopt\fR" 4
5056 .IX Item "-mpowerpc-gfxopt"
5057 .Ip "\fB\-mno-powerpc-gfxopt\fR" 4
5058 .IX Item "-mno-powerpc-gfxopt"
5059 .Ip "\fB\-mpowerpc64\fR" 4
5060 .IX Item "-mpowerpc64"
5061 .Ip "\fB\-mno-powerpc64\fR" 4
5062 .IX Item "-mno-powerpc64"
5064 \&\s-1GCC\s0 supports two related instruction set architectures for the
5065 \&\s-1RS/6000\s0 and PowerPC. The \fI\s-1POWER\s0\fR instruction set are those
5066 instructions supported by the \fBrios\fR chip set used in the original
5067 \&\s-1RS/6000\s0 systems and the \fIPowerPC\fR instruction set is the
5068 architecture of the Motorola MPC5xx, MPC6xx, MPC8xx microprocessors, and
5069 the \s-1IBM\s0 4xx microprocessors.
5071 Neither architecture is a subset of the other. However there is a
5072 large common subset of instructions supported by both. An \s-1MQ\s0
5073 register is included in processors supporting the \s-1POWER\s0 architecture.
5075 You use these options to specify which instructions are available on the
5076 processor you are using. The default value of these options is
5077 determined when configuring \s-1GCC\s0. Specifying the
5078 \&\fB\-mcpu=\fR\fIcpu_type\fR overrides the specification of these
5079 options. We recommend you use the \fB\-mcpu=\fR\fIcpu_type\fR option
5080 rather than the options listed above.
5082 The \fB\-mpower\fR option allows \s-1GCC\s0 to generate instructions that
5083 are found only in the \s-1POWER\s0 architecture and to use the \s-1MQ\s0 register.
5084 Specifying \fB\-mpower2\fR implies \fB\-power\fR and also allows \s-1GCC\s0
5085 to generate instructions that are present in the \s-1POWER2\s0 architecture but
5086 not the original \s-1POWER\s0 architecture.
5088 The \fB\-mpowerpc\fR option allows \s-1GCC\s0 to generate instructions that
5089 are found only in the 32\-bit subset of the PowerPC architecture.
5090 Specifying \fB\-mpowerpc-gpopt\fR implies \fB\-mpowerpc\fR and also allows
5091 \&\s-1GCC\s0 to use the optional PowerPC architecture instructions in the
5092 General Purpose group, including floating-point square root. Specifying
5093 \&\fB\-mpowerpc-gfxopt\fR implies \fB\-mpowerpc\fR and also allows \s-1GCC\s0 to
5094 use the optional PowerPC architecture instructions in the Graphics
5095 group, including floating-point select.
5097 The \fB\-mpowerpc64\fR option allows \s-1GCC\s0 to generate the additional
5098 64\-bit instructions that are found in the full PowerPC64 architecture
5099 and to treat GPRs as 64\-bit, doubleword quantities. \s-1GCC\s0 defaults to
5100 \&\fB\-mno-powerpc64\fR.
5102 If you specify both \fB\-mno-power\fR and \fB\-mno-powerpc\fR, \s-1GCC\s0
5103 will use only the instructions in the common subset of both
5104 architectures plus some special \s-1AIX\s0 common-mode calls, and will not use
5105 the \s-1MQ\s0 register. Specifying both \fB\-mpower\fR and \fB\-mpowerpc\fR
5106 permits \s-1GCC\s0 to use any instruction from either architecture and to
5107 allow use of the \s-1MQ\s0 register; specify this for the Motorola \s-1MPC601\s0.
5108 .Ip "\fB\-mnew-mnemonics\fR" 4
5109 .IX Item "-mnew-mnemonics"
5111 .Ip "\fB\-mold-mnemonics\fR" 4
5112 .IX Item "-mold-mnemonics"
5114 Select which mnemonics to use in the generated assembler code.
5115 \&\fB\-mnew-mnemonics\fR requests output that uses the assembler mnemonics
5116 defined for the PowerPC architecture, while \fB\-mold-mnemonics\fR
5117 requests the assembler mnemonics defined for the \s-1POWER\s0 architecture.
5118 Instructions defined in only one architecture have only one mnemonic;
5119 \&\s-1GCC\s0 uses that mnemonic irrespective of which of these options is
5122 \&\s-1GCC\s0 defaults to the mnemonics appropriate for the architecture in
5123 use. Specifying \fB\-mcpu=\fR\fIcpu_type\fR sometimes overrides the
5124 value of these option. Unless you are building a cross-compiler, you
5125 should normally not specify either \fB\-mnew-mnemonics\fR or
5126 \&\fB\-mold-mnemonics\fR, but should instead accept the default.
5127 .Ip "\fB\-mcpu=\fR\fIcpu_type\fR" 4
5128 .IX Item "-mcpu=cpu_type"
5129 Set architecture type, register usage, choice of mnemonics, and
5130 instruction scheduling parameters for machine type \fIcpu_type\fR.
5131 Supported values for \fIcpu_type\fR are \fBrios\fR, \fBrios1\fR,
5132 \&\fBrsc\fR, \fBrios2\fR, \fBrs64a\fR, \fB601\fR, \fB602\fR,
5133 \&\fB603\fR, \fB603e\fR, \fB604\fR, \fB604e\fR, \fB620\fR,
5134 \&\fB630\fR, \fB740\fR, \fB750\fR, \fBpower\fR, \fBpower2\fR,
5135 \&\fBpowerpc\fR, \fB403\fR, \fB505\fR, \fB801\fR, \fB821\fR,
5136 \&\fB823\fR, and \fB860\fR and \fBcommon\fR. \fB\-mcpu=power\fR,
5137 \&\fB\-mcpu=power2\fR, \fB\-mcpu=powerpc\fR, and \fB\-mcpu=powerpc64\fR
5138 specify generic \s-1POWER\s0, \s-1POWER2\s0, pure 32\-bit PowerPC (i.e., not \s-1MPC601\s0),
5139 and 64\-bit PowerPC architecture machine types, with an appropriate,
5140 generic processor model assumed for scheduling purposes.
5142 Specifying any of the following options:
5143 \&\fB\-mcpu=rios1\fR, \fB\-mcpu=rios2\fR, \fB\-mcpu=rsc\fR,
5144 \&\fB\-mcpu=power\fR, or \fB\-mcpu=power2\fR
5145 enables the \fB\-mpower\fR option and disables the \fB\-mpowerpc\fR option;
5146 \&\fB\-mcpu=601\fR enables both the \fB\-mpower\fR and \fB\-mpowerpc\fR options.
5147 All of \fB\-mcpu=rs64a\fR, \fB\-mcpu=602\fR, \fB\-mcpu=603\fR,
5148 \&\fB\-mcpu=603e\fR, \fB\-mcpu=604\fR, \fB\-mcpu=620\fR, \fB\-mcpu=630\fR,
5149 \&\fB\-mcpu=740\fR, and \fB\-mcpu=750\fR
5150 enable the \fB\-mpowerpc\fR option and disable the \fB\-mpower\fR option.
5151 Exactly similarly, all of \fB\-mcpu=403\fR,
5152 \&\fB\-mcpu=505\fR, \fB\-mcpu=821\fR, \fB\-mcpu=860\fR and \fB\-mcpu=powerpc\fR
5153 enable the \fB\-mpowerpc\fR option and disable the \fB\-mpower\fR option.
5154 \&\fB\-mcpu=common\fR disables both the
5155 \&\fB\-mpower\fR and \fB\-mpowerpc\fR options.
5157 \&\s-1AIX\s0 versions 4 or greater selects \fB\-mcpu=common\fR by default, so
5158 that code will operate on all members of the \s-1RS/6000\s0 \s-1POWER\s0 and PowerPC
5159 families. In that case, \s-1GCC\s0 will use only the instructions in the
5160 common subset of both architectures plus some special \s-1AIX\s0 common-mode
5161 calls, and will not use the \s-1MQ\s0 register. \s-1GCC\s0 assumes a generic
5162 processor model for scheduling purposes.
5164 Specifying any of the options \fB\-mcpu=rios1\fR, \fB\-mcpu=rios2\fR,
5165 \&\fB\-mcpu=rsc\fR, \fB\-mcpu=power\fR, or \fB\-mcpu=power2\fR also
5166 disables the \fBnew-mnemonics\fR option. Specifying \fB\-mcpu=601\fR,
5167 \&\fB\-mcpu=602\fR, \fB\-mcpu=603\fR, \fB\-mcpu=603e\fR, \fB\-mcpu=604\fR,
5168 \&\fB\-mcpu=620\fR, \fB\-mcpu=630\fR, \fB\-mcpu=403\fR, \fB\-mcpu=505\fR,
5169 \&\fB\-mcpu=821\fR, \fB\-mcpu=860\fR or \fB\-mcpu=powerpc\fR also enables
5170 the \fBnew-mnemonics\fR option.
5172 Specifying \fB\-mcpu=403\fR, \fB\-mcpu=821\fR, or \fB\-mcpu=860\fR also
5173 enables the \fB\-msoft-float\fR option.
5174 .Ip "\fB\-mtune=\fR\fIcpu_type\fR" 4
5175 .IX Item "-mtune=cpu_type"
5176 Set the instruction scheduling parameters for machine type
5177 \&\fIcpu_type\fR, but do not set the architecture type, register usage,
5178 choice of mnemonics like \fB\-mcpu=\fR\fIcpu_type\fR would. The same
5179 values for \fIcpu_type\fR are used for \fB\-mtune=\fR\fIcpu_type\fR as
5180 for \fB\-mcpu=\fR\fIcpu_type\fR. The \fB\-mtune=\fR\fIcpu_type\fR
5181 option overrides the \fB\-mcpu=\fR\fIcpu_type\fR option in terms of
5182 instruction scheduling parameters.
5183 .Ip "\fB\-mfull-toc\fR" 4
5184 .IX Item "-mfull-toc"
5186 .Ip "\fB\-mno-fp-in-toc\fR" 4
5187 .IX Item "-mno-fp-in-toc"
5188 .Ip "\fB\-mno-sum-in-toc\fR" 4
5189 .IX Item "-mno-sum-in-toc"
5190 .Ip "\fB\-mminimal-toc\fR" 4
5191 .IX Item "-mminimal-toc"
5193 Modify generation of the \s-1TOC\s0 (Table Of Contents), which is created for
5194 every executable file. The \fB\-mfull-toc\fR option is selected by
5195 default. In that case, \s-1GCC\s0 will allocate at least one \s-1TOC\s0 entry for
5196 each unique non-automatic variable reference in your program. \s-1GCC\s0
5197 will also place floating-point constants in the \s-1TOC\s0. However, only
5198 16,384 entries are available in the \s-1TOC\s0.
5200 If you receive a linker error message that saying you have overflowed
5201 the available \s-1TOC\s0 space, you can reduce the amount of \s-1TOC\s0 space used
5202 with the \fB\-mno-fp-in-toc\fR and \fB\-mno-sum-in-toc\fR options.
5203 \&\fB\-mno-fp-in-toc\fR prevents \s-1GCC\s0 from putting floating-point
5204 constants in the \s-1TOC\s0 and \fB\-mno-sum-in-toc\fR forces \s-1GCC\s0 to
5205 generate code to calculate the sum of an address and a constant at
5206 run-time instead of putting that sum into the \s-1TOC\s0. You may specify one
5207 or both of these options. Each causes \s-1GCC\s0 to produce very slightly
5208 slower and larger code at the expense of conserving \s-1TOC\s0 space.
5210 If you still run out of space in the \s-1TOC\s0 even when you specify both of
5211 these options, specify \fB\-mminimal-toc\fR instead. This option causes
5212 \&\s-1GCC\s0 to make only one \s-1TOC\s0 entry for every file. When you specify this
5213 option, \s-1GCC\s0 will produce code that is slower and larger but which
5214 uses extremely little \s-1TOC\s0 space. You may wish to use this option
5215 only on files that contain less frequently executed code.
5216 .Ip "\fB\-maix64\fR" 4
5219 .Ip "\fB\-maix32\fR" 4
5222 Enable 64\-bit \s-1AIX\s0 \s-1ABI\s0 and calling convention: 64\-bit pointers, 64\-bit
5223 \&\f(CW\*(C`long\*(C'\fR type, and the infrastructure needed to support them.
5224 Specifying \fB\-maix64\fR implies \fB\-mpowerpc64\fR and
5225 \&\fB\-mpowerpc\fR, while \fB\-maix32\fR disables the 64\-bit \s-1ABI\s0 and
5226 implies \fB\-mno-powerpc64\fR. \s-1GCC\s0 defaults to \fB\-maix32\fR.
5227 .Ip "\fB\-mxl-call\fR" 4
5228 .IX Item "-mxl-call"
5230 .Ip "\fB\-mno-xl-call\fR" 4
5231 .IX Item "-mno-xl-call"
5233 On \s-1AIX\s0, pass floating-point arguments to prototyped functions beyond the
5234 register save area (\s-1RSA\s0) on the stack in addition to argument FPRs. The
5235 \&\s-1AIX\s0 calling convention was extended but not initially documented to
5236 handle an obscure K&R C case of calling a function that takes the
5237 address of its arguments with fewer arguments than declared. \s-1AIX\s0 \s-1XL\s0
5238 compilers access floating point arguments which do not fit in the
5239 \&\s-1RSA\s0 from the stack when a subroutine is compiled without
5240 optimization. Because always storing floating-point arguments on the
5241 stack is inefficient and rarely needed, this option is not enabled by
5242 default and only is necessary when calling subroutines compiled by \s-1AIX\s0
5243 \&\s-1XL\s0 compilers without optimization.
5244 .Ip "\fB\-mthreads\fR" 4
5245 .IX Item "-mthreads"
5246 Support \fI\s-1AIX\s0 Threads\fR. Link an application written to use
5247 \&\fIpthreads\fR with special libraries and startup code to enable the
5251 Support \fI\s-1IBM\s0 \s-1RS/6000\s0 \s-1SP\s0\fR \fIParallel Environment\fR (\s-1PE\s0). Link an
5252 application written to use message passing with special startup code to
5253 enable the application to run. The system must have \s-1PE\s0 installed in the
5254 standard location (\fI/usr/lpp/ppe.poe/\fR), or the \fIspecs\fR file
5255 must be overridden with the \fB\-specs=\fR option to specify the
5256 appropriate directory location. The Parallel Environment does not
5257 support threads, so the \fB\-mpe\fR option and the \fB\-mthreads\fR
5258 option are incompatible.
5259 .Ip "\fB\-msoft-float\fR" 4
5260 .IX Item "-msoft-float"
5262 .Ip "\fB\-mhard-float\fR" 4
5263 .IX Item "-mhard-float"
5265 Generate code that does not use (uses) the floating-point register set.
5266 Software floating point emulation is provided if you use the
5267 \&\fB\-msoft-float\fR option, and pass the option to \s-1GCC\s0 when linking.
5268 .Ip "\fB\-mmultiple\fR" 4
5269 .IX Item "-mmultiple"
5271 .Ip "\fB\-mno-multiple\fR" 4
5272 .IX Item "-mno-multiple"
5274 Generate code that uses (does not use) the load multiple word
5275 instructions and the store multiple word instructions. These
5276 instructions are generated by default on \s-1POWER\s0 systems, and not
5277 generated on PowerPC systems. Do not use \fB\-mmultiple\fR on little
5278 endian PowerPC systems, since those instructions do not work when the
5279 processor is in little endian mode. The exceptions are \s-1PPC740\s0 and
5280 \&\s-1PPC750\s0 which permit the instructions usage in little endian mode.
5281 .Ip "\fB\-mstring\fR" 4
5284 .Ip "\fB\-mno-string\fR" 4
5285 .IX Item "-mno-string"
5287 Generate code that uses (does not use) the load string instructions
5288 and the store string word instructions to save multiple registers and
5289 do small block moves. These instructions are generated by default on
5290 \&\s-1POWER\s0 systems, and not generated on PowerPC systems. Do not use
5291 \&\fB\-mstring\fR on little endian PowerPC systems, since those
5292 instructions do not work when the processor is in little endian mode.
5293 The exceptions are \s-1PPC740\s0 and \s-1PPC750\s0 which permit the instructions
5294 usage in little endian mode.
5295 .Ip "\fB\-mupdate\fR" 4
5298 .Ip "\fB\-mno-update\fR" 4
5299 .IX Item "-mno-update"
5301 Generate code that uses (does not use) the load or store instructions
5302 that update the base register to the address of the calculated memory
5303 location. These instructions are generated by default. If you use
5304 \&\fB\-mno-update\fR, there is a small window between the time that the
5305 stack pointer is updated and the address of the previous frame is
5306 stored, which means code that walks the stack frame across interrupts or
5307 signals may get corrupted data.
5308 .Ip "\fB\-mfused-madd\fR" 4
5309 .IX Item "-mfused-madd"
5311 .Ip "\fB\-mno-fused-madd\fR" 4
5312 .IX Item "-mno-fused-madd"
5314 Generate code that uses (does not use) the floating point multiply and
5315 accumulate instructions. These instructions are generated by default if
5316 hardware floating is used.
5317 .Ip "\fB\-mno-bit-align\fR" 4
5318 .IX Item "-mno-bit-align"
5320 .Ip "\fB\-mbit-align\fR" 4
5321 .IX Item "-mbit-align"
5323 On System V.4 and embedded PowerPC systems do not (do) force structures
5324 and unions that contain bit fields to be aligned to the base type of the
5327 For example, by default a structure containing nothing but 8
5328 \&\f(CW\*(C`unsigned\*(C'\fR bitfields of length 1 would be aligned to a 4 byte
5329 boundary and have a size of 4 bytes. By using \fB\-mno-bit-align\fR,
5330 the structure would be aligned to a 1 byte boundary and be one byte in
5332 .Ip "\fB\-mno-strict-align\fR" 4
5333 .IX Item "-mno-strict-align"
5335 .Ip "\fB\-mstrict-align\fR" 4
5336 .IX Item "-mstrict-align"
5338 On System V.4 and embedded PowerPC systems do not (do) assume that
5339 unaligned memory references will be handled by the system.
5340 .Ip "\fB\-mrelocatable\fR" 4
5341 .IX Item "-mrelocatable"
5343 .Ip "\fB\-mno-relocatable\fR" 4
5344 .IX Item "-mno-relocatable"
5346 On embedded PowerPC systems generate code that allows (does not allow)
5347 the program to be relocated to a different address at runtime. If you
5348 use \fB\-mrelocatable\fR on any module, all objects linked together must
5349 be compiled with \fB\-mrelocatable\fR or \fB\-mrelocatable-lib\fR.
5350 .Ip "\fB\-mrelocatable-lib\fR" 4
5351 .IX Item "-mrelocatable-lib"
5353 .Ip "\fB\-mno-relocatable-lib\fR" 4
5354 .IX Item "-mno-relocatable-lib"
5356 On embedded PowerPC systems generate code that allows (does not allow)
5357 the program to be relocated to a different address at runtime. Modules
5358 compiled with \fB\-mrelocatable-lib\fR can be linked with either modules
5359 compiled without \fB\-mrelocatable\fR and \fB\-mrelocatable-lib\fR or
5360 with modules compiled with the \fB\-mrelocatable\fR options.
5361 .Ip "\fB\-mno-toc\fR" 4
5364 .Ip "\fB\-mtoc\fR" 4
5367 On System V.4 and embedded PowerPC systems do not (do) assume that
5368 register 2 contains a pointer to a global area pointing to the addresses
5369 used in the program.
5370 .Ip "\fB\-mlittle\fR" 4
5373 .Ip "\fB\-mlittle-endian\fR" 4
5374 .IX Item "-mlittle-endian"
5376 On System V.4 and embedded PowerPC systems compile code for the
5377 processor in little endian mode. The \fB\-mlittle-endian\fR option is
5378 the same as \fB\-mlittle\fR.
5379 .Ip "\fB\-mbig\fR" 4
5382 .Ip "\fB\-mbig-endian\fR" 4
5383 .IX Item "-mbig-endian"
5385 On System V.4 and embedded PowerPC systems compile code for the
5386 processor in big endian mode. The \fB\-mbig-endian\fR option is
5387 the same as \fB\-mbig\fR.
5388 .Ip "\fB\-mcall-sysv\fR" 4
5389 .IX Item "-mcall-sysv"
5390 On System V.4 and embedded PowerPC systems compile code using calling
5391 conventions that adheres to the March 1995 draft of the System V
5392 Application Binary Interface, PowerPC processor supplement. This is the
5393 default unless you configured \s-1GCC\s0 using \fBpowerpc-*\-eabiaix\fR.
5394 .Ip "\fB\-mcall-sysv-eabi\fR" 4
5395 .IX Item "-mcall-sysv-eabi"
5396 Specify both \fB\-mcall-sysv\fR and \fB\-meabi\fR options.
5397 .Ip "\fB\-mcall-sysv-noeabi\fR" 4
5398 .IX Item "-mcall-sysv-noeabi"
5399 Specify both \fB\-mcall-sysv\fR and \fB\-mno-eabi\fR options.
5400 .Ip "\fB\-mcall-aix\fR" 4
5401 .IX Item "-mcall-aix"
5402 On System V.4 and embedded PowerPC systems compile code using calling
5403 conventions that are similar to those used on \s-1AIX\s0. This is the
5404 default if you configured \s-1GCC\s0 using \fBpowerpc-*\-eabiaix\fR.
5405 .Ip "\fB\-mcall-solaris\fR" 4
5406 .IX Item "-mcall-solaris"
5407 On System V.4 and embedded PowerPC systems compile code for the Solaris
5409 .Ip "\fB\-mcall-linux\fR" 4
5410 .IX Item "-mcall-linux"
5411 On System V.4 and embedded PowerPC systems compile code for the
5412 Linux-based \s-1GNU\s0 system.
5413 .Ip "\fB\-mprototype\fR" 4
5414 .IX Item "-mprototype"
5416 .Ip "\fB\-mno-prototype\fR" 4
5417 .IX Item "-mno-prototype"
5419 On System V.4 and embedded PowerPC systems assume that all calls to
5420 variable argument functions are properly prototyped. Otherwise, the
5421 compiler must insert an instruction before every non prototyped call to
5422 set or clear bit 6 of the condition code register (\fI\s-1CR\s0\fR) to
5423 indicate whether floating point values were passed in the floating point
5424 registers in case the function takes a variable arguments. With
5425 \&\fB\-mprototype\fR, only calls to prototyped variable argument functions
5426 will set or clear the bit.
5427 .Ip "\fB\-msim\fR" 4
5429 On embedded PowerPC systems, assume that the startup module is called
5430 \&\fIsim-crt0.o\fR and that the standard C libraries are \fIlibsim.a\fR and
5431 \&\fIlibc.a\fR. This is the default for \fBpowerpc-*\-eabisim\fR.
5433 .Ip "\fB\-mmvme\fR" 4
5435 On embedded PowerPC systems, assume that the startup module is called
5436 \&\fIcrt0.o\fR and the standard C libraries are \fIlibmvme.a\fR and
5438 .Ip "\fB\-mads\fR" 4
5440 On embedded PowerPC systems, assume that the startup module is called
5441 \&\fIcrt0.o\fR and the standard C libraries are \fIlibads.a\fR and
5443 .Ip "\fB\-myellowknife\fR" 4
5444 .IX Item "-myellowknife"
5445 On embedded PowerPC systems, assume that the startup module is called
5446 \&\fIcrt0.o\fR and the standard C libraries are \fIlibyk.a\fR and
5448 .Ip "\fB\-mvxworks\fR" 4
5449 .IX Item "-mvxworks"
5450 On System V.4 and embedded PowerPC systems, specify that you are
5451 compiling for a VxWorks system.
5452 .Ip "\fB\-memb\fR" 4
5454 On embedded PowerPC systems, set the \fI\s-1PPC_EMB\s0\fR bit in the \s-1ELF\s0 flags
5455 header to indicate that \fBeabi\fR extended relocations are used.
5456 .Ip "\fB\-meabi\fR" 4
5459 .Ip "\fB\-mno-eabi\fR" 4
5460 .IX Item "-mno-eabi"
5462 On System V.4 and embedded PowerPC systems do (do not) adhere to the
5463 Embedded Applications Binary Interface (eabi) which is a set of
5464 modifications to the System V.4 specifications. Selecting \fB\-meabi\fR
5465 means that the stack is aligned to an 8 byte boundary, a function
5466 \&\f(CW\*(C`_\|_eabi\*(C'\fR is called to from \f(CW\*(C`main\*(C'\fR to set up the eabi
5467 environment, and the \fB\-msdata\fR option can use both \f(CW\*(C`r2\*(C'\fR and
5468 \&\f(CW\*(C`r13\*(C'\fR to point to two separate small data areas. Selecting
5469 \&\fB\-mno-eabi\fR means that the stack is aligned to a 16 byte boundary,
5470 do not call an initialization function from \f(CW\*(C`main\*(C'\fR, and the
5471 \&\fB\-msdata\fR option will only use \f(CW\*(C`r13\*(C'\fR to point to a single
5472 small data area. The \fB\-meabi\fR option is on by default if you
5473 configured \s-1GCC\s0 using one of the \fBpowerpc*\-*\-eabi*\fR options.
5474 .Ip "\fB\-msdata=eabi\fR" 4
5475 .IX Item "-msdata=eabi"
5476 On System V.4 and embedded PowerPC systems, put small initialized
5477 \&\f(CW\*(C`const\*(C'\fR global and static data in the \fB.sdata2\fR section, which
5478 is pointed to by register \f(CW\*(C`r2\*(C'\fR. Put small initialized
5479 non-\f(CW\*(C`const\*(C'\fR global and static data in the \fB.sdata\fR section,
5480 which is pointed to by register \f(CW\*(C`r13\*(C'\fR. Put small uninitialized
5481 global and static data in the \fB.sbss\fR section, which is adjacent to
5482 the \fB.sdata\fR section. The \fB\-msdata=eabi\fR option is
5483 incompatible with the \fB\-mrelocatable\fR option. The
5484 \&\fB\-msdata=eabi\fR option also sets the \fB\-memb\fR option.
5485 .Ip "\fB\-msdata=sysv\fR" 4
5486 .IX Item "-msdata=sysv"
5487 On System V.4 and embedded PowerPC systems, put small global and static
5488 data in the \fB.sdata\fR section, which is pointed to by register
5489 \&\f(CW\*(C`r13\*(C'\fR. Put small uninitialized global and static data in the
5490 \&\fB.sbss\fR section, which is adjacent to the \fB.sdata\fR section.
5491 The \fB\-msdata=sysv\fR option is incompatible with the
5492 \&\fB\-mrelocatable\fR option.
5493 .Ip "\fB\-msdata=default\fR" 4
5494 .IX Item "-msdata=default"
5496 .Ip "\fB\-msdata\fR" 4
5499 On System V.4 and embedded PowerPC systems, if \fB\-meabi\fR is used,
5500 compile code the same as \fB\-msdata=eabi\fR, otherwise compile code the
5501 same as \fB\-msdata=sysv\fR.
5502 .Ip "\fB\-msdata-data\fR" 4
5503 .IX Item "-msdata-data"
5504 On System V.4 and embedded PowerPC systems, put small global and static
5505 data in the \fB.sdata\fR section. Put small uninitialized global and
5506 static data in the \fB.sbss\fR section. Do not use register \f(CW\*(C`r13\*(C'\fR
5507 to address small data however. This is the default behavior unless
5508 other \fB\-msdata\fR options are used.
5509 .Ip "\fB\-msdata=none\fR" 4
5510 .IX Item "-msdata=none"
5512 .Ip "\fB\-mno-sdata\fR" 4
5513 .IX Item "-mno-sdata"
5515 On embedded PowerPC systems, put all initialized global and static data
5516 in the \fB.data\fR section, and all uninitialized data in the
5517 \&\fB.bss\fR section.
5518 .Ip "\fB\-G\fR \fInum\fR" 4
5520 On embedded PowerPC systems, put global and static items less than or
5521 equal to \fInum\fR bytes into the small data or bss sections instead of
5522 the normal data or bss section. By default, \fInum\fR is 8. The
5523 \&\fB\-G\fR \fInum\fR switch is also passed to the linker.
5524 All modules should be compiled with the same \fB\-G\fR \fInum\fR value.
5525 .Ip "\fB\-mregnames\fR" 4
5526 .IX Item "-mregnames"
5528 .Ip "\fB\-mno-regnames\fR" 4
5529 .IX Item "-mno-regnames"
5531 On System V.4 and embedded PowerPC systems do (do not) emit register
5532 names in the assembly language output using symbolic forms.
5534 .I "\s-1IBM\s0 \s-1RT\s0 Options"
5535 .IX Subsection "IBM RT Options"
5537 These \fB\-m\fR options are defined for the \s-1IBM\s0 \s-1RT\s0 \s-1PC:\s0
5538 .Ip "\fB\-min-line-mul\fR" 4
5539 .IX Item "-min-line-mul"
5540 Use an in-line code sequence for integer multiplies. This is the
5542 .Ip "\fB\-mcall-lib-mul\fR" 4
5543 .IX Item "-mcall-lib-mul"
5544 Call \f(CW\*(C`lmul$$\*(C'\fR for integer multiples.
5545 .Ip "\fB\-mfull-fp-blocks\fR" 4
5546 .IX Item "-mfull-fp-blocks"
5547 Generate full-size floating point data blocks, including the minimum
5548 amount of scratch space recommended by \s-1IBM\s0. This is the default.
5549 .Ip "\fB\-mminimum-fp-blocks\fR" 4
5550 .IX Item "-mminimum-fp-blocks"
5551 Do not include extra scratch space in floating point data blocks. This
5552 results in smaller code, but slower execution, since scratch space must
5553 be allocated dynamically.
5554 .Ip "\fB\-mfp-arg-in-fpregs\fR" 4
5555 .IX Item "-mfp-arg-in-fpregs"
5556 Use a calling sequence incompatible with the \s-1IBM\s0 calling convention in
5557 which floating point arguments are passed in floating point registers.
5558 Note that \f(CW\*(C`varargs.h\*(C'\fR and \f(CW\*(C`stdargs.h\*(C'\fR will not work with
5559 floating point operands if this option is specified.
5560 .Ip "\fB\-mfp-arg-in-gregs\fR" 4
5561 .IX Item "-mfp-arg-in-gregs"
5562 Use the normal calling convention for floating point arguments. This is
5564 .Ip "\fB\-mhc-struct-return\fR" 4
5565 .IX Item "-mhc-struct-return"
5566 Return structures of more than one word in memory, rather than in a
5567 register. This provides compatibility with the MetaWare HighC (hc)
5568 compiler. Use the option \fB\-fpcc-struct-return\fR for compatibility
5569 with the Portable C Compiler (pcc).
5570 .Ip "\fB\-mnohc-struct-return\fR" 4
5571 .IX Item "-mnohc-struct-return"
5572 Return some structures of more than one word in registers, when
5573 convenient. This is the default. For compatibility with the
5574 IBM-supplied compilers, use the option \fB\-fpcc-struct-return\fR or the
5575 option \fB\-mhc-struct-return\fR.
5577 .I "\s-1MIPS\s0 Options"
5578 .IX Subsection "MIPS Options"
5580 These \fB\-m\fR options are defined for the \s-1MIPS\s0 family of computers:
5581 .Ip "\fB\-mcpu=\fR\fIcpu type\fR" 4
5582 .IX Item "-mcpu=cpu type"
5583 Assume the defaults for the machine type \fIcpu type\fR when scheduling
5584 instructions. The choices for \fIcpu type\fR are \fBr2000\fR, \fBr3000\fR,
5585 \&\fBr3900\fR, \fBr4000\fR, \fBr4100\fR, \fBr4300\fR, \fBr4400\fR,
5586 \&\fBr4600\fR, \fBr4650\fR, \fBr5000\fR, \fBr6000\fR, \fBr8000\fR,
5587 and \fBorion\fR. Additionally, the \fBr2000\fR, \fBr3000\fR,
5588 \&\fBr4000\fR, \fBr5000\fR, and \fBr6000\fR can be abbreviated as
5589 \&\fBr2k\fR (or \fBr2K\fR), \fBr3k\fR, etc. While picking a specific
5590 \&\fIcpu type\fR will schedule things appropriately for that particular
5591 chip, the compiler will not generate any code that does not meet level 1
5592 of the \s-1MIPS\s0 \s-1ISA\s0 (instruction set architecture) without a \fB\-mipsX\fR
5593 or \fB\-mabi\fR switch being used.
5594 .Ip "\fB\-mips1\fR" 4
5596 Issue instructions from level 1 of the \s-1MIPS\s0 \s-1ISA\s0. This is the default.
5597 \&\fBr3000\fR is the default \fIcpu type\fR at this \s-1ISA\s0 level.
5598 .Ip "\fB\-mips2\fR" 4
5600 Issue instructions from level 2 of the \s-1MIPS\s0 \s-1ISA\s0 (branch likely, square
5601 root instructions). \fBr6000\fR is the default \fIcpu type\fR at this
5603 .Ip "\fB\-mips3\fR" 4
5605 Issue instructions from level 3 of the \s-1MIPS\s0 \s-1ISA\s0 (64 bit instructions).
5606 \&\fBr4000\fR is the default \fIcpu type\fR at this \s-1ISA\s0 level.
5607 .Ip "\fB\-mips4\fR" 4
5609 Issue instructions from level 4 of the \s-1MIPS\s0 \s-1ISA\s0 (conditional move,
5610 prefetch, enhanced \s-1FPU\s0 instructions). \fBr8000\fR is the default
5611 \&\fIcpu type\fR at this \s-1ISA\s0 level.
5612 .Ip "\fB\-mfp32\fR" 4
5614 Assume that 32 32\-bit floating point registers are available. This is
5616 .Ip "\fB\-mfp64\fR" 4
5618 Assume that 32 64\-bit floating point registers are available. This is
5619 the default when the \fB\-mips3\fR option is used.
5620 .Ip "\fB\-mgp32\fR" 4
5622 Assume that 32 32\-bit general purpose registers are available. This is
5624 .Ip "\fB\-mgp64\fR" 4
5626 Assume that 32 64\-bit general purpose registers are available. This is
5627 the default when the \fB\-mips3\fR option is used.
5628 .Ip "\fB\-mint64\fR" 4
5630 Force int and long types to be 64 bits wide. See \fB\-mlong32\fR for an
5631 explanation of the default, and the width of pointers.
5632 .Ip "\fB\-mlong64\fR" 4
5634 Force long types to be 64 bits wide. See \fB\-mlong32\fR for an
5635 explanation of the default, and the width of pointers.
5636 .Ip "\fB\-mlong32\fR" 4
5638 Force long, int, and pointer types to be 32 bits wide.
5640 If none of \fB\-mlong32\fR, \fB\-mlong64\fR, or \fB\-mint64\fR are set,
5641 the size of ints, longs, and pointers depends on the \s-1ABI\s0 and \s-1ISA\s0 chosen.
5642 For \fB\-mabi=32\fR, and \fB\-mabi=n32\fR, ints and longs are 32 bits
5643 wide. For \fB\-mabi=64\fR, ints are 32 bits, and longs are 64 bits wide.
5644 For \fB\-mabi=eabi\fR and either \fB\-mips1\fR or \fB\-mips2\fR, ints
5645 and longs are 32 bits wide. For \fB\-mabi=eabi\fR and higher ISAs, ints
5646 are 32 bits, and longs are 64 bits wide. The width of pointer types is
5647 the smaller of the width of longs or the width of general purpose
5648 registers (which in turn depends on the \s-1ISA\s0).
5649 .Ip "\fB\-mabi=32\fR" 4
5652 .Ip "\fB\-mabi=o64\fR" 4
5653 .IX Item "-mabi=o64"
5654 .Ip "\fB\-mabi=n32\fR" 4
5655 .IX Item "-mabi=n32"
5656 .Ip "\fB\-mabi=64\fR" 4
5658 .Ip "\fB\-mabi=eabi\fR" 4
5659 .IX Item "-mabi=eabi"
5661 Generate code for the indicated \s-1ABI\s0. The default instruction level is
5662 \&\fB\-mips1\fR for \fB32\fR, \fB\-mips3\fR for \fBn32\fR, and
5663 \&\fB\-mips4\fR otherwise. Conversely, with \fB\-mips1\fR or
5664 \&\fB\-mips2\fR, the default \s-1ABI\s0 is \fB32\fR; otherwise, the default \s-1ABI\s0
5666 .Ip "\fB\-mmips-as\fR" 4
5667 .IX Item "-mmips-as"
5668 Generate code for the \s-1MIPS\s0 assembler, and invoke \fImips-tfile\fR to
5669 add normal debug information. This is the default for all
5670 platforms except for the \s-1OSF/1\s0 reference platform, using the OSF/rose
5671 object format. If the either of the \fB\-gstabs\fR or \fB\-gstabs+\fR
5672 switches are used, the \fImips-tfile\fR program will encapsulate the
5673 stabs within \s-1MIPS\s0 \s-1ECOFF\s0.
5674 .Ip "\fB\-mgas\fR" 4
5676 Generate code for the \s-1GNU\s0 assembler. This is the default on the \s-1OSF/1\s0
5677 reference platform, using the OSF/rose object format. Also, this is
5678 the default if the configure option \fB\*(--with-gnu-as\fR is used.
5679 .Ip "\fB\-msplit-addresses\fR" 4
5680 .IX Item "-msplit-addresses"
5682 .Ip "\fB\-mno-split-addresses\fR" 4
5683 .IX Item "-mno-split-addresses"
5685 Generate code to load the high and low parts of address constants separately.
5686 This allows \f(CW\*(C`gcc\*(C'\fR to optimize away redundant loads of the high order
5687 bits of addresses. This optimization requires \s-1GNU\s0 as and \s-1GNU\s0 ld.
5688 This optimization is enabled by default for some embedded targets where
5689 \&\s-1GNU\s0 as and \s-1GNU\s0 ld are standard.
5690 .Ip "\fB\-mrnames\fR" 4
5693 .Ip "\fB\-mno-rnames\fR" 4
5694 .IX Item "-mno-rnames"
5696 The \fB\-mrnames\fR switch says to output code using the \s-1MIPS\s0 software
5697 names for the registers, instead of the hardware names (ie, \fIa0\fR
5698 instead of \fI$4\fR). The only known assembler that supports this option
5699 is the Algorithmics assembler.
5700 .Ip "\fB\-mgpopt\fR" 4
5703 .Ip "\fB\-mno-gpopt\fR" 4
5704 .IX Item "-mno-gpopt"
5706 The \fB\-mgpopt\fR switch says to write all of the data declarations
5707 before the instructions in the text section, this allows the \s-1MIPS\s0
5708 assembler to generate one word memory references instead of using two
5709 words for short global or static data items. This is on by default if
5710 optimization is selected.
5711 .Ip "\fB\-mstats\fR" 4
5714 .Ip "\fB\-mno-stats\fR" 4
5715 .IX Item "-mno-stats"
5717 For each non-inline function processed, the \fB\-mstats\fR switch
5718 causes the compiler to emit one line to the standard error file to
5719 print statistics about the program (number of registers saved, stack
5721 .Ip "\fB\-mmemcpy\fR" 4
5724 .Ip "\fB\-mno-memcpy\fR" 4
5725 .IX Item "-mno-memcpy"
5727 The \fB\-mmemcpy\fR switch makes all block moves call the appropriate
5728 string function (\fBmemcpy\fR or \fBbcopy\fR) instead of possibly
5729 generating inline code.
5730 .Ip "\fB\-mmips-tfile\fR" 4
5731 .IX Item "-mmips-tfile"
5733 .Ip "\fB\-mno-mips-tfile\fR" 4
5734 .IX Item "-mno-mips-tfile"
5736 The \fB\-mno-mips-tfile\fR switch causes the compiler not
5737 postprocess the object file with the \fImips-tfile\fR program,
5738 after the \s-1MIPS\s0 assembler has generated it to add debug support. If
5739 \&\fImips-tfile\fR is not run, then no local variables will be
5740 available to the debugger. In addition, \fIstage2\fR and
5741 \&\fIstage3\fR objects will have the temporary file names passed to the
5742 assembler embedded in the object file, which means the objects will
5743 not compare the same. The \fB\-mno-mips-tfile\fR switch should only
5744 be used when there are bugs in the \fImips-tfile\fR program that
5745 prevents compilation.
5746 .Ip "\fB\-msoft-float\fR" 4
5747 .IX Item "-msoft-float"
5748 Generate output containing library calls for floating point.
5749 \&\fBWarning:\fR the requisite libraries are not part of \s-1GCC\s0.
5750 Normally the facilities of the machine's usual C compiler are used, but
5751 this can't be done directly in cross-compilation. You must make your
5752 own arrangements to provide suitable library functions for
5754 .Ip "\fB\-mhard-float\fR" 4
5755 .IX Item "-mhard-float"
5756 Generate output containing floating point instructions. This is the
5757 default if you use the unmodified sources.
5758 .Ip "\fB\-mabicalls\fR" 4
5759 .IX Item "-mabicalls"
5761 .Ip "\fB\-mno-abicalls\fR" 4
5762 .IX Item "-mno-abicalls"
5764 Emit (or do not emit) the pseudo operations \fB.abicalls\fR,
5765 \&\fB.cpload\fR, and \fB.cprestore\fR that some System V.4 ports use for
5766 position independent code.
5767 .Ip "\fB\-mlong-calls\fR" 4
5768 .IX Item "-mlong-calls"
5770 .Ip "\fB\-mno-long-calls\fR" 4
5771 .IX Item "-mno-long-calls"
5773 Do all calls with the \fB\s-1JALR\s0\fR instruction, which requires
5774 loading up a function's address into a register before the call.
5775 You need to use this switch, if you call outside of the current
5776 512 megabyte segment to functions that are not through pointers.
5777 .Ip "\fB\-mhalf-pic\fR" 4
5778 .IX Item "-mhalf-pic"
5780 .Ip "\fB\-mno-half-pic\fR" 4
5781 .IX Item "-mno-half-pic"
5783 Put pointers to extern references into the data section and load them
5784 up, rather than put the references in the text section.
5785 .Ip "\fB\-membedded-pic\fR" 4
5786 .IX Item "-membedded-pic"
5788 .Ip "\fB\-mno-embedded-pic\fR" 4
5789 .IX Item "-mno-embedded-pic"
5791 Generate \s-1PIC\s0 code suitable for some embedded systems. All calls are
5792 made using \s-1PC\s0 relative address, and all data is addressed using the \f(CW$gp\fR
5793 register. No more than 65536 bytes of global data may be used. This
5794 requires \s-1GNU\s0 as and \s-1GNU\s0 ld which do most of the work. This currently
5795 only works on targets which use \s-1ECOFF\s0; it does not work with \s-1ELF\s0.
5796 .Ip "\fB\-membedded-data\fR" 4
5797 .IX Item "-membedded-data"
5799 .Ip "\fB\-mno-embedded-data\fR" 4
5800 .IX Item "-mno-embedded-data"
5802 Allocate variables to the read-only data section first if possible, then
5803 next in the small data section if possible, otherwise in data. This gives
5804 slightly slower code than the default, but reduces the amount of \s-1RAM\s0 required
5805 when executing, and thus may be preferred for some embedded systems.
5806 .Ip "\fB\-muninit-const-in-rodata\fR" 4
5807 .IX Item "-muninit-const-in-rodata"
5809 .Ip "\fB\-mno-uninit-const-in-rodata\fR" 4
5810 .IX Item "-mno-uninit-const-in-rodata"
5812 When used together with \-membedded-data, it will always store uninitialized
5813 const variables in the read-only data section.
5814 .Ip "\fB\-msingle-float\fR" 4
5815 .IX Item "-msingle-float"
5817 .Ip "\fB\-mdouble-float\fR" 4
5818 .IX Item "-mdouble-float"
5820 The \fB\-msingle-float\fR switch tells gcc to assume that the floating
5821 point coprocessor only supports single precision operations, as on the
5822 \&\fBr4650\fR chip. The \fB\-mdouble-float\fR switch permits gcc to use
5823 double precision operations. This is the default.
5824 .Ip "\fB\-mmad\fR" 4
5827 .Ip "\fB\-mno-mad\fR" 4
5830 Permit use of the \fBmad\fR, \fBmadu\fR and \fBmul\fR instructions,
5831 as on the \fBr4650\fR chip.
5832 .Ip "\fB\-m4650\fR" 4
5834 Turns on \fB\-msingle-float\fR, \fB\-mmad\fR, and, at least for now,
5835 \&\fB\-mcpu=r4650\fR.
5836 .Ip "\fB\-mips16\fR" 4
5839 .Ip "\fB\-mno-mips16\fR" 4
5840 .IX Item "-mno-mips16"
5842 Enable 16\-bit instructions.
5843 .Ip "\fB\-mentry\fR" 4
5845 Use the entry and exit pseudo ops. This option can only be used with
5849 Compile code for the processor in little endian mode.
5850 The requisite libraries are assumed to exist.
5853 Compile code for the processor in big endian mode.
5854 The requisite libraries are assumed to exist.
5855 .Ip "\fB\-G\fR \fInum\fR" 4
5857 Put global and static items less than or equal to \fInum\fR bytes into
5858 the small data or bss sections instead of the normal data or bss
5859 section. This allows the assembler to emit one word memory reference
5860 instructions based on the global pointer (\fIgp\fR or \fI$28\fR),
5861 instead of the normal two words used. By default, \fInum\fR is 8 when
5862 the \s-1MIPS\s0 assembler is used, and 0 when the \s-1GNU\s0 assembler is used. The
5863 \&\fB\-G\fR \fInum\fR switch is also passed to the assembler and linker.
5864 All modules should be compiled with the same \fB\-G\fR \fInum\fR
5866 .Ip "\fB\-nocpp\fR" 4
5868 Tell the \s-1MIPS\s0 assembler to not run its preprocessor over user
5869 assembler files (with a \fB.s\fR suffix) when assembling them.
5870 .Ip "\fB\-mfix7000\fR" 4
5871 .IX Item "-mfix7000"
5872 Pass an option to gas which will cause nops to be inserted if
5873 the read of the destination register of an mfhi or mflo instruction
5874 occurs in the following two instructions.
5875 .Ip "\fB\-no-crt0\fR" 4
5877 Do not include the default crt0.
5879 .I "Intel 386 Options"
5880 .IX Subsection "Intel 386 Options"
5882 These \fB\-m\fR options are defined for the i386 family of computers:
5883 .Ip "\fB\-mcpu=\fR\fIcpu type\fR" 4
5884 .IX Item "-mcpu=cpu type"
5885 Assume the defaults for the machine type \fIcpu type\fR when scheduling
5886 instructions. The choices for \fIcpu type\fR are \fBi386\fR,
5887 \&\fBi486\fR, \fBi586\fR, \fBi686\fR, \fBpentium\fR,
5888 \&\fBpentiumpro\fR, \fBk6\fR, and \fBathlon\fR
5890 While picking a specific \fIcpu type\fR will schedule things appropriately
5891 for that particular chip, the compiler will not generate any code that
5892 does not run on the i386 without the \fB\-march=\fR\fIcpu type\fR option
5893 being used. \fBi586\fR is equivalent to \fBpentium\fR and \fBi686\fR
5894 is equivalent to \fBpentiumpro\fR. \fBk6\fR is the \s-1AMD\s0 chip as
5895 opposed to the Intel ones.
5896 .Ip "\fB\-march=\fR\fIcpu type\fR" 4
5897 .IX Item "-march=cpu type"
5898 Generate instructions for the machine type \fIcpu type\fR. The choices
5899 for \fIcpu type\fR are the same as for \fB\-mcpu\fR. Moreover,
5900 specifying \fB\-march=\fR\fIcpu type\fR implies \fB\-mcpu=\fR\fIcpu type\fR.
5901 .Ip "\fB\-m386\fR" 4
5904 .Ip "\fB\-m486\fR" 4
5906 .Ip "\fB\-mpentium\fR" 4
5907 .IX Item "-mpentium"
5908 .Ip "\fB\-mpentiumpro\fR" 4
5909 .IX Item "-mpentiumpro"
5911 Synonyms for \-mcpu=i386, \-mcpu=i486, \-mcpu=pentium, and \-mcpu=pentiumpro
5912 respectively. These synonyms are deprecated.
5913 .Ip "\fB\-mintel-syntax\fR" 4
5914 .IX Item "-mintel-syntax"
5915 Emit assembly using Intel syntax opcodes instead of \s-1AT&T\s0 syntax.
5916 .Ip "\fB\-mieee-fp\fR" 4
5917 .IX Item "-mieee-fp"
5919 .Ip "\fB\-mno-ieee-fp\fR" 4
5920 .IX Item "-mno-ieee-fp"
5922 Control whether or not the compiler uses \s-1IEEE\s0 floating point
5923 comparisons. These handle correctly the case where the result of a
5924 comparison is unordered.
5925 .Ip "\fB\-msoft-float\fR" 4
5926 .IX Item "-msoft-float"
5927 Generate output containing library calls for floating point.
5928 \&\fBWarning:\fR the requisite libraries are not part of \s-1GCC\s0.
5929 Normally the facilities of the machine's usual C compiler are used, but
5930 this can't be done directly in cross-compilation. You must make your
5931 own arrangements to provide suitable library functions for
5934 On machines where a function returns floating point results in the 80387
5935 register stack, some floating point opcodes may be emitted even if
5936 \&\fB\-msoft-float\fR is used.
5937 .Ip "\fB\-mno-fp-ret-in-387\fR" 4
5938 .IX Item "-mno-fp-ret-in-387"
5939 Do not use the \s-1FPU\s0 registers for return values of functions.
5941 The usual calling convention has functions return values of types
5942 \&\f(CW\*(C`float\*(C'\fR and \f(CW\*(C`double\*(C'\fR in an \s-1FPU\s0 register, even if there
5943 is no \s-1FPU\s0. The idea is that the operating system should emulate
5946 The option \fB\-mno-fp-ret-in-387\fR causes such values to be returned
5947 in ordinary \s-1CPU\s0 registers instead.
5948 .Ip "\fB\-mno-fancy-math-387\fR" 4
5949 .IX Item "-mno-fancy-math-387"
5950 Some 387 emulators do not support the \f(CW\*(C`sin\*(C'\fR, \f(CW\*(C`cos\*(C'\fR and
5951 \&\f(CW\*(C`sqrt\*(C'\fR instructions for the 387. Specify this option to avoid
5952 generating those instructions. This option is the default on FreeBSD.
5953 As of revision 2.6.1, these instructions are not generated unless you
5954 also use the \fB\-ffast-math\fR switch.
5955 .Ip "\fB\-malign-double\fR" 4
5956 .IX Item "-malign-double"
5958 .Ip "\fB\-mno-align-double\fR" 4
5959 .IX Item "-mno-align-double"
5961 Control whether \s-1GCC\s0 aligns \f(CW\*(C`double\*(C'\fR, \f(CW\*(C`long double\*(C'\fR, and
5962 \&\f(CW\*(C`long long\*(C'\fR variables on a two word boundary or a one word
5963 boundary. Aligning \f(CW\*(C`double\*(C'\fR variables on a two word boundary will
5964 produce code that runs somewhat faster on a \fBPentium\fR at the
5965 expense of more memory.
5966 .Ip "\fB\-m128bit-long-double\fR" 4
5967 .IX Item "-m128bit-long-double"
5969 .Ip "\fB\-m128bit-long-double\fR" 4
5970 .IX Item "-m128bit-long-double"
5972 Control the size of \f(CW\*(C`long double\*(C'\fR type. i386 application binary interface
5973 specify the size to be 12 bytes, while modern architectures (Pentium and newer)
5974 preffer \f(CW\*(C`long double\*(C'\fR aligned to 8 or 16 byte boundary. This is
5975 impossible to reach with 12 byte long doubles in the array accesses.
5977 \&\fBWarning:\fR if you use the \fB\-m128bit-long-double\fR switch, the
5978 structures and arrays containing \f(CW\*(C`long double\*(C'\fR will change their size as
5979 well as function calling convention for function taking \f(CW\*(C`long double\*(C'\fR
5981 .Ip "\fB\-m96bit-long-double\fR" 4
5982 .IX Item "-m96bit-long-double"
5984 .Ip "\fB\-m96bit-long-double\fR" 4
5985 .IX Item "-m96bit-long-double"
5987 Set the size of \f(CW\*(C`long double\*(C'\fR to 96 bits as required by the i386
5988 application binary interface. This is the default.
5989 .Ip "\fB\-msvr3\-shlib\fR" 4
5990 .IX Item "-msvr3-shlib"
5992 .Ip "\fB\-mno-svr3\-shlib\fR" 4
5993 .IX Item "-mno-svr3-shlib"
5995 Control whether \s-1GCC\s0 places uninitialized locals into \f(CW\*(C`bss\*(C'\fR or
5996 \&\f(CW\*(C`data\*(C'\fR. \fB\-msvr3\-shlib\fR places these locals into \f(CW\*(C`bss\*(C'\fR.
5997 These options are meaningful only on System V Release 3.
5998 .Ip "\fB\-mno-wide-multiply\fR" 4
5999 .IX Item "-mno-wide-multiply"
6001 .Ip "\fB\-mwide-multiply\fR" 4
6002 .IX Item "-mwide-multiply"
6004 Control whether \s-1GCC\s0 uses the \f(CW\*(C`mul\*(C'\fR and \f(CW\*(C`imul\*(C'\fR that produce
6005 64 bit results in \f(CW\*(C`eax:edx\*(C'\fR from 32 bit operands to do \f(CW\*(C`long
6006 long\*(C'\fR multiplies and 32\-bit division by constants.
6007 .Ip "\fB\-mrtd\fR" 4
6009 Use a different function-calling convention, in which functions that
6010 take a fixed number of arguments return with the \f(CW\*(C`ret\*(C'\fR \fInum\fR
6011 instruction, which pops their arguments while returning. This saves one
6012 instruction in the caller since there is no need to pop the arguments
6015 You can specify that an individual function is called with this calling
6016 sequence with the function attribute \fBstdcall\fR. You can also
6017 override the \fB\-mrtd\fR option by using the function attribute
6020 \&\fBWarning:\fR this calling convention is incompatible with the one
6021 normally used on Unix, so you cannot use it if you need to call
6022 libraries compiled with the Unix compiler.
6024 Also, you must provide function prototypes for all functions that
6025 take variable numbers of arguments (including \f(CW\*(C`printf\*(C'\fR);
6026 otherwise incorrect code will be generated for calls to those
6029 In addition, seriously incorrect code will result if you call a
6030 function with too many arguments. (Normally, extra arguments are
6031 harmlessly ignored.)
6032 .Ip "\fB\-mreg-alloc=\fR\fIregs\fR" 4
6033 .IX Item "-mreg-alloc=regs"
6034 Control the default allocation order of integer registers. The
6035 string \fIregs\fR is a series of letters specifying a register. The
6036 supported letters are: \f(CW\*(C`a\*(C'\fR allocate \s-1EAX\s0; \f(CW\*(C`b\*(C'\fR allocate \s-1EBX\s0;
6037 \&\f(CW\*(C`c\*(C'\fR allocate \s-1ECX\s0; \f(CW\*(C`d\*(C'\fR allocate \s-1EDX\s0; \f(CW\*(C`S\*(C'\fR allocate \s-1ESI\s0;
6038 \&\f(CW\*(C`D\*(C'\fR allocate \s-1EDI\s0; \f(CW\*(C`B\*(C'\fR allocate \s-1EBP\s0.
6039 This option is deprecated and will not be supported by future releases
6041 .Ip "\fB\-mregparm=\fR\fInum\fR" 4
6042 .IX Item "-mregparm=num"
6043 Control how many registers are used to pass integer arguments. By
6044 default, no registers are used to pass arguments, and at most 3
6045 registers can be used. You can control this behavior for a specific
6046 function by using the function attribute \fBregparm\fR.
6048 \&\fBWarning:\fR if you use this switch, and
6049 \&\fInum\fR is nonzero, then you must build all modules with the same
6050 value, including any libraries. This includes the system libraries and
6052 .Ip "\fB\-malign-loops=\fR\fInum\fR" 4
6053 .IX Item "-malign-loops=num"
6054 Align loops to a 2 raised to a \fInum\fR byte boundary. If
6055 \&\fB\-malign-loops\fR is not specified, the default is 2 unless
6056 gas 2.8 (or later) is being used in which case the default is
6057 to align the loop on a 16 byte boundary if it is less than 8
6059 .Ip "\fB\-malign-jumps=\fR\fInum\fR" 4
6060 .IX Item "-malign-jumps=num"
6061 Align instructions that are only jumped to to a 2 raised to a \fInum\fR
6062 byte boundary. If \fB\-malign-jumps\fR is not specified, the default is
6063 2 if optimizing for a 386, and 4 if optimizing for a 486 unless
6064 gas 2.8 (or later) is being used in which case the default is
6065 to align the instruction on a 16 byte boundary if it is less
6067 .Ip "\fB\-malign-functions=\fR\fInum\fR" 4
6068 .IX Item "-malign-functions=num"
6069 Align the start of functions to a 2 raised to \fInum\fR byte boundary.
6070 If \fB\-malign-functions\fR is not specified, the default is 2 if optimizing
6071 for a 386, and 4 if optimizing for a 486.
6072 .Ip "\fB\-mpreferred-stack-boundary=\fR\fInum\fR" 4
6073 .IX Item "-mpreferred-stack-boundary=num"
6074 Attempt to keep the stack boundary aligned to a 2 raised to \fInum\fR
6075 byte boundary. If \fB\-mpreferred-stack-boundary\fR is not specified,
6076 the default is 4 (16 bytes or 128 bits).
6078 The stack is required to be aligned on a 4 byte boundary. On Pentium
6079 and PentiumPro, \f(CW\*(C`double\*(C'\fR and \f(CW\*(C`long double\*(C'\fR values should be
6080 aligned to an 8 byte boundary (see \fB\-malign-double\fR) or suffer
6081 significant run time performance penalties. On Pentium \s-1III\s0, the
6082 Streaming \s-1SIMD\s0 Extension (\s-1SSE\s0) data type \f(CW\*(C`_\|_m128\*(C'\fR suffers similar
6083 penalties if it is not 16 byte aligned.
6085 To ensure proper alignment of this values on the stack, the stack boundary
6086 must be as aligned as that required by any value stored on the stack.
6087 Further, every function must be generated such that it keeps the stack
6088 aligned. Thus calling a function compiled with a higher preferred
6089 stack boundary from a function compiled with a lower preferred stack
6090 boundary will most likely misalign the stack. It is recommended that
6091 libraries that use callbacks always use the default setting.
6093 This extra alignment does consume extra stack space. Code that is sensitive
6094 to stack space usage, such as embedded systems and operating system kernels,
6095 may want to reduce the preferred alignment to
6096 \&\fB\-mpreferred-stack-boundary=2\fR.
6097 .Ip "\fB\-mpush-args\fR" 4
6098 .IX Item "-mpush-args"
6099 Use \s-1PUSH\s0 operations to store outgoing parameters. This method is shorter
6100 and usually equally fast as method using \s-1SUB/MOV\s0 operations and is enabled
6101 by default. In some cases disabling it may improve performance because of
6102 improved scheduling and reduced dependencies.
6103 .Ip "\fB\-maccumulate-outgoing-args\fR" 4
6104 .IX Item "-maccumulate-outgoing-args"
6105 If enabled, the maximum amount of space required for outgoing arguments will be
6106 computed in the function prologue. This in faster on most modern CPUs
6107 because of reduced dependencies, improved scheduling and reduced stack usage
6108 when preferred stack boundary is not equal to 2. The drawback is a notable
6109 increase in code size. This switch implies \-mno-push-args.
6110 .Ip "\fB\-mthreads\fR" 4
6111 .IX Item "-mthreads"
6112 Support thread-safe exception handling on \fBMingw32\fR. Code that relies
6113 on thread-safe exception handling must compile and link all code with the
6114 \&\fB\-mthreads\fR option. When compiling, \fB\-mthreads\fR defines
6115 \&\fB\-D_MT\fR; when linking, it links in a special thread helper library
6116 \&\fB\-lmingwthrd\fR which cleans up per thread exception handling data.
6117 .Ip "\fB\-mno-align-stringops\fR" 4
6118 .IX Item "-mno-align-stringops"
6119 Do not align destination of inlined string operations. This switch reduces
6120 code size and improves performance in case the destination is already aligned,
6121 but gcc don't know about it.
6122 .Ip "\fB\-minline-all-stringops\fR" 4
6123 .IX Item "-minline-all-stringops"
6124 By default \s-1GCC\s0 inlines string operations only when destination is known to be
6125 aligned at least to 4 byte boundary. This enables more inlining, increase code
6126 size, but may improve performance of code that depends on fast memcpy, strlen
6127 and memset for short lengths.
6129 .I "\s-1HPPA\s0 Options"
6130 .IX Subsection "HPPA Options"
6132 These \fB\-m\fR options are defined for the \s-1HPPA\s0 family of computers:
6133 .Ip "\fB\-march=\fR\fIarchitecture type\fR" 4
6134 .IX Item "-march=architecture type"
6135 Generate code for the specified architecture. The choices for
6136 \&\fIarchitecture type\fR are \fB1.0\fR for \s-1PA\s0 1.0, \fB1.1\fR for \s-1PA\s0
6137 1.1, and \fB2.0\fR for \s-1PA\s0 2.0 processors. Refer to
6138 \&\fI/usr/lib/sched.models\fR on an \s-1HP-UX\s0 system to determine the proper
6139 architecture option for your machine. Code compiled for lower numbered
6140 architectures will run on higher numbered architectures, but not the
6143 \&\s-1PA\s0 2.0 support currently requires gas snapshot 19990413 or later. The
6144 next release of binutils (current is 2.9.1) will probably contain \s-1PA\s0 2.0
6146 .Ip "\fB\-mpa-risc-1\-0\fR" 4
6147 .IX Item "-mpa-risc-1-0"
6149 .Ip "\fB\-mpa-risc-1\-1\fR" 4
6150 .IX Item "-mpa-risc-1-1"
6151 .Ip "\fB\-mpa-risc-2\-0\fR" 4
6152 .IX Item "-mpa-risc-2-0"
6154 Synonyms for \-march=1.0, \-march=1.1, and \-march=2.0 respectively.
6155 .Ip "\fB\-mbig-switch\fR" 4
6156 .IX Item "-mbig-switch"
6157 Generate code suitable for big switch tables. Use this option only if
6158 the assembler/linker complain about out of range branches within a switch
6160 .Ip "\fB\-mjump-in-delay\fR" 4
6161 .IX Item "-mjump-in-delay"
6162 Fill delay slots of function calls with unconditional jump instructions
6163 by modifying the return pointer for the function call to be the target
6164 of the conditional jump.
6165 .Ip "\fB\-mdisable-fpregs\fR" 4
6166 .IX Item "-mdisable-fpregs"
6167 Prevent floating point registers from being used in any manner. This is
6168 necessary for compiling kernels which perform lazy context switching of
6169 floating point registers. If you use this option and attempt to perform
6170 floating point operations, the compiler will abort.
6171 .Ip "\fB\-mdisable-indexing\fR" 4
6172 .IX Item "-mdisable-indexing"
6173 Prevent the compiler from using indexing address modes. This avoids some
6174 rather obscure problems when compiling \s-1MIG\s0 generated code under \s-1MACH\s0.
6175 .Ip "\fB\-mno-space-regs\fR" 4
6176 .IX Item "-mno-space-regs"
6177 Generate code that assumes the target has no space registers. This allows
6178 \&\s-1GCC\s0 to generate faster indirect calls and use unscaled index address modes.
6180 Such code is suitable for level 0 \s-1PA\s0 systems and kernels.
6181 .Ip "\fB\-mfast-indirect-calls\fR" 4
6182 .IX Item "-mfast-indirect-calls"
6183 Generate code that assumes calls never cross space boundaries. This
6184 allows \s-1GCC\s0 to emit code which performs faster indirect calls.
6186 This option will not work in the presence of shared libraries or nested
6188 .Ip "\fB\-mlong-load-store\fR" 4
6189 .IX Item "-mlong-load-store"
6190 Generate 3\-instruction load and store sequences as sometimes required by
6191 the \s-1HP-UX\s0 10 linker. This is equivalent to the \fB+k\fR option to
6192 the \s-1HP\s0 compilers.
6193 .Ip "\fB\-mportable-runtime\fR" 4
6194 .IX Item "-mportable-runtime"
6195 Use the portable calling conventions proposed by \s-1HP\s0 for \s-1ELF\s0 systems.
6196 .Ip "\fB\-mgas\fR" 4
6198 Enable the use of assembler directives only \s-1GAS\s0 understands.
6199 .Ip "\fB\-mschedule=\fR\fIcpu type\fR" 4
6200 .IX Item "-mschedule=cpu type"
6201 Schedule code according to the constraints for the machine type
6202 \&\fIcpu type\fR. The choices for \fIcpu type\fR are \fB700\fR
6203 \&\fB7100\fR, \fB7100LC\fR, \fB7200\fR, and \fB8000\fR. Refer to
6204 \&\fI/usr/lib/sched.models\fR on an \s-1HP-UX\s0 system to determine the
6205 proper scheduling option for your machine.
6206 .Ip "\fB\-mlinker-opt\fR" 4
6207 .IX Item "-mlinker-opt"
6208 Enable the optimization pass in the \s-1HPUX\s0 linker. Note this makes symbolic
6209 debugging impossible. It also triggers a bug in the \s-1HPUX\s0 8 and \s-1HPUX\s0 9 linkers
6210 in which they give bogus error messages when linking some programs.
6211 .Ip "\fB\-msoft-float\fR" 4
6212 .IX Item "-msoft-float"
6213 Generate output containing library calls for floating point.
6214 \&\fBWarning:\fR the requisite libraries are not available for all \s-1HPPA\s0
6215 targets. Normally the facilities of the machine's usual C compiler are
6216 used, but this cannot be done directly in cross-compilation. You must make
6217 your own arrangements to provide suitable library functions for
6218 cross-compilation. The embedded target \fBhppa1.1\-*\-pro\fR
6219 does provide software floating point support.
6221 \&\fB\-msoft-float\fR changes the calling convention in the output file;
6222 therefore, it is only useful if you compile \fIall\fR of a program with
6223 this option. In particular, you need to compile \fIlibgcc.a\fR, the
6224 library that comes with \s-1GCC\s0, with \fB\-msoft-float\fR in order for
6227 .I "Intel 960 Options"
6228 .IX Subsection "Intel 960 Options"
6230 These \fB\-m\fR options are defined for the Intel 960 implementations:
6231 .Ip "\fB\-m\fR\fIcpu type\fR" 4
6232 .IX Item "-mcpu type"
6233 Assume the defaults for the machine type \fIcpu type\fR for some of
6234 the other options, including instruction scheduling, floating point
6235 support, and addressing modes. The choices for \fIcpu type\fR are
6236 \&\fBka\fR, \fBkb\fR, \fBmc\fR, \fBca\fR, \fBcf\fR,
6237 \&\fBsa\fR, and \fBsb\fR.
6240 .Ip "\fB\-mnumerics\fR" 4
6241 .IX Item "-mnumerics"
6243 .Ip "\fB\-msoft-float\fR" 4
6244 .IX Item "-msoft-float"
6246 The \fB\-mnumerics\fR option indicates that the processor does support
6247 floating-point instructions. The \fB\-msoft-float\fR option indicates
6248 that floating-point support should not be assumed.
6249 .Ip "\fB\-mleaf-procedures\fR" 4
6250 .IX Item "-mleaf-procedures"
6252 .Ip "\fB\-mno-leaf-procedures\fR" 4
6253 .IX Item "-mno-leaf-procedures"
6255 Do (or do not) attempt to alter leaf procedures to be callable with the
6256 \&\f(CW\*(C`bal\*(C'\fR instruction as well as \f(CW\*(C`call\*(C'\fR. This will result in more
6257 efficient code for explicit calls when the \f(CW\*(C`bal\*(C'\fR instruction can be
6258 substituted by the assembler or linker, but less efficient code in other
6259 cases, such as calls via function pointers, or using a linker that doesn't
6260 support this optimization.
6261 .Ip "\fB\-mtail-call\fR" 4
6262 .IX Item "-mtail-call"
6264 .Ip "\fB\-mno-tail-call\fR" 4
6265 .IX Item "-mno-tail-call"
6267 Do (or do not) make additional attempts (beyond those of the
6268 machine-independent portions of the compiler) to optimize tail-recursive
6269 calls into branches. You may not want to do this because the detection of
6270 cases where this is not valid is not totally complete. The default is
6271 \&\fB\-mno-tail-call\fR.
6272 .Ip "\fB\-mcomplex-addr\fR" 4
6273 .IX Item "-mcomplex-addr"
6275 .Ip "\fB\-mno-complex-addr\fR" 4
6276 .IX Item "-mno-complex-addr"
6278 Assume (or do not assume) that the use of a complex addressing mode is a
6279 win on this implementation of the i960. Complex addressing modes may not
6280 be worthwhile on the K-series, but they definitely are on the C-series.
6281 The default is currently \fB\-mcomplex-addr\fR for all processors except
6282 the \s-1CB\s0 and \s-1CC\s0.
6283 .Ip "\fB\-mcode-align\fR" 4
6284 .IX Item "-mcode-align"
6286 .Ip "\fB\-mno-code-align\fR" 4
6287 .IX Item "-mno-code-align"
6289 Align code to 8\-byte boundaries for faster fetching (or don't bother).
6290 Currently turned on by default for C-series implementations only.
6291 .Ip "\fB\-mic-compat\fR" 4
6292 .IX Item "-mic-compat"
6294 .Ip "\fB\-mic2.0\-compat\fR" 4
6295 .IX Item "-mic2.0-compat"
6296 .Ip "\fB\-mic3.0\-compat\fR" 4
6297 .IX Item "-mic3.0-compat"
6299 Enable compatibility with iC960 v2.0 or v3.0.
6300 .Ip "\fB\-masm-compat\fR" 4
6301 .IX Item "-masm-compat"
6303 .Ip "\fB\-mintel-asm\fR" 4
6304 .IX Item "-mintel-asm"
6306 Enable compatibility with the iC960 assembler.
6307 .Ip "\fB\-mstrict-align\fR" 4
6308 .IX Item "-mstrict-align"
6310 .Ip "\fB\-mno-strict-align\fR" 4
6311 .IX Item "-mno-strict-align"
6313 Do not permit (do permit) unaligned accesses.
6314 .Ip "\fB\-mold-align\fR" 4
6315 .IX Item "-mold-align"
6316 Enable structure-alignment compatibility with Intel's gcc release version
6317 1.3 (based on gcc 1.37). This option implies \fB\-mstrict-align\fR.
6318 .Ip "\fB\-mlong-double-64\fR" 4
6319 .IX Item "-mlong-double-64"
6320 Implement type \fBlong double\fR as 64\-bit floating point numbers.
6321 Without the option \fBlong double\fR is implemented by 80\-bit
6322 floating point numbers. The only reason we have it because there is
6323 no 128\-bit \fBlong double\fR support in \fBfp-bit.c\fR yet. So it
6324 is only useful for people using soft-float targets. Otherwise, we
6325 should recommend against use of it.
6327 .I "\s-1DEC\s0 Alpha Options"
6328 .IX Subsection "DEC Alpha Options"
6330 These \fB\-m\fR options are defined for the \s-1DEC\s0 Alpha implementations:
6331 .Ip "\fB\-mno-soft-float\fR" 4
6332 .IX Item "-mno-soft-float"
6334 .Ip "\fB\-msoft-float\fR" 4
6335 .IX Item "-msoft-float"
6337 Use (do not use) the hardware floating-point instructions for
6338 floating-point operations. When \fB\-msoft-float\fR is specified,
6339 functions in \fIlibgcc1.c\fR will be used to perform floating-point
6340 operations. Unless they are replaced by routines that emulate the
6341 floating-point operations, or compiled in such a way as to call such
6342 emulations routines, these routines will issue floating-point
6343 operations. If you are compiling for an Alpha without floating-point
6344 operations, you must ensure that the library is built so as not to call
6347 Note that Alpha implementations without floating-point operations are
6348 required to have floating-point registers.
6349 .Ip "\fB\-mfp-reg\fR" 4
6352 .Ip "\fB\-mno-fp-regs\fR" 4
6353 .IX Item "-mno-fp-regs"
6355 Generate code that uses (does not use) the floating-point register set.
6356 \&\fB\-mno-fp-regs\fR implies \fB\-msoft-float\fR. If the floating-point
6357 register set is not used, floating point operands are passed in integer
6358 registers as if they were integers and floating-point results are passed
6359 in \f(CW$0\fR instead of \f(CW$f0\fR. This is a non-standard calling sequence, so any
6360 function with a floating-point argument or return value called by code
6361 compiled with \fB\-mno-fp-regs\fR must also be compiled with that
6364 A typical use of this option is building a kernel that does not use,
6365 and hence need not save and restore, any floating-point registers.
6366 .Ip "\fB\-mieee\fR" 4
6368 The Alpha architecture implements floating-point hardware optimized for
6369 maximum performance. It is mostly compliant with the \s-1IEEE\s0 floating
6370 point standard. However, for full compliance, software assistance is
6371 required. This option generates code fully \s-1IEEE\s0 compliant code
6372 \&\fIexcept\fR that the \fIinexact flag\fR is not maintained (see below).
6373 If this option is turned on, the \s-1CPP\s0 macro \f(CW\*(C`_IEEE_FP\*(C'\fR is defined
6374 during compilation. The option is a shorthand for: \fB\-D_IEEE_FP
6375 \&\-mfp-trap-mode=su \-mtrap-precision=i \-mieee-conformant\fR. The resulting
6376 code is less efficient but is able to correctly support denormalized
6377 numbers and exceptional \s-1IEEE\s0 values such as not-a-number and plus/minus
6378 infinity. Other Alpha compilers call this option
6379 \&\fB\-ieee_with_no_inexact\fR.
6380 .Ip "\fB\-mieee-with-inexact\fR" 4
6381 .IX Item "-mieee-with-inexact"
6382 This is like \fB\-mieee\fR except the generated code also maintains the
6383 \&\s-1IEEE\s0 \fIinexact flag\fR. Turning on this option causes the generated
6384 code to implement fully-compliant \s-1IEEE\s0 math. The option is a shorthand
6385 for \fB\-D_IEEE_FP \-D_IEEE_FP_INEXACT\fR plus the three following:
6386 \&\fB\-mieee-conformant\fR,
6387 \&\fB\-mfp-trap-mode=sui\fR,
6388 and \fB\-mtrap-precision=i\fR.
6389 On some Alpha implementations the resulting code may execute
6390 significantly slower than the code generated by default. Since there
6391 is very little code that depends on the \fIinexact flag\fR, you should
6392 normally not specify this option. Other Alpha compilers call this
6393 option \fB\-ieee_with_inexact\fR.
6394 .Ip "\fB\-mfp-trap-mode=\fR\fItrap mode\fR" 4
6395 .IX Item "-mfp-trap-mode=trap mode"
6396 This option controls what floating-point related traps are enabled.
6397 Other Alpha compilers call this option \fB\-fptm\fR \fItrap mode\fR.
6398 The trap mode can be set to one of four values:
6402 This is the default (normal) setting. The only traps that are enabled
6403 are the ones that cannot be disabled in software (e.g., division by zero
6407 In addition to the traps enabled by \fBn\fR, underflow traps are enabled
6411 Like \fBsu\fR, but the instructions are marked to be safe for software
6412 completion (see Alpha architecture manual for details).
6415 Like \fBsu\fR, but inexact traps are enabled as well.
6419 .Ip "\fB\-mfp-rounding-mode=\fR\fIrounding mode\fR" 4
6420 .IX Item "-mfp-rounding-mode=rounding mode"
6421 Selects the \s-1IEEE\s0 rounding mode. Other Alpha compilers call this option
6422 \&\fB\-fprm\fR \fIrounding mode\fR. The \fIrounding mode\fR can be one
6427 Normal \s-1IEEE\s0 rounding mode. Floating point numbers are rounded towards
6428 the nearest machine number or towards the even machine number in case
6432 Round towards minus infinity.
6435 Chopped rounding mode. Floating point numbers are rounded towards zero.
6438 Dynamic rounding mode. A field in the floating point control register
6439 (\fIfpcr\fR, see Alpha architecture reference manual) controls the
6440 rounding mode in effect. The C library initializes this register for
6441 rounding towards plus infinity. Thus, unless your program modifies the
6442 \&\fIfpcr\fR, \fBd\fR corresponds to round towards plus infinity.
6446 .Ip "\fB\-mtrap-precision=\fR\fItrap precision\fR" 4
6447 .IX Item "-mtrap-precision=trap precision"
6448 In the Alpha architecture, floating point traps are imprecise. This
6449 means without software assistance it is impossible to recover from a
6450 floating trap and program execution normally needs to be terminated.
6451 \&\s-1GCC\s0 can generate code that can assist operating system trap handlers
6452 in determining the exact location that caused a floating point trap.
6453 Depending on the requirements of an application, different levels of
6454 precisions can be selected:
6458 Program precision. This option is the default and means a trap handler
6459 can only identify which program caused a floating point exception.
6462 Function precision. The trap handler can determine the function that
6463 caused a floating point exception.
6466 Instruction precision. The trap handler can determine the exact
6467 instruction that caused a floating point exception.
6471 Other Alpha compilers provide the equivalent options called
6472 \&\fB\-scope_safe\fR and \fB\-resumption_safe\fR.
6474 .Ip "\fB\-mieee-conformant\fR" 4
6475 .IX Item "-mieee-conformant"
6476 This option marks the generated code as \s-1IEEE\s0 conformant. You must not
6477 use this option unless you also specify \fB\-mtrap-precision=i\fR and either
6478 \&\fB\-mfp-trap-mode=su\fR or \fB\-mfp-trap-mode=sui\fR. Its only effect
6479 is to emit the line \fB.eflag 48\fR in the function prologue of the
6480 generated assembly file. Under \s-1DEC\s0 Unix, this has the effect that
6481 IEEE-conformant math library routines will be linked in.
6482 .Ip "\fB\-mbuild-constants\fR" 4
6483 .IX Item "-mbuild-constants"
6484 Normally \s-1GCC\s0 examines a 32\- or 64\-bit integer constant to
6485 see if it can construct it from smaller constants in two or three
6486 instructions. If it cannot, it will output the constant as a literal and
6487 generate code to load it from the data segment at runtime.
6489 Use this option to require \s-1GCC\s0 to construct \fIall\fR integer constants
6490 using code, even if it takes more instructions (the maximum is six).
6492 You would typically use this option to build a shared library dynamic
6493 loader. Itself a shared library, it must relocate itself in memory
6494 before it can find the variables and constants in its own data segment.
6495 .Ip "\fB\-malpha-as\fR" 4
6496 .IX Item "-malpha-as"
6498 .Ip "\fB\-mgas\fR" 4
6501 Select whether to generate code to be assembled by the vendor-supplied
6502 assembler (\fB\-malpha-as\fR) or by the \s-1GNU\s0 assembler \fB\-mgas\fR.
6503 .Ip "\fB\-mbwx\fR" 4
6506 .Ip "\fB\-mno-bwx\fR" 4
6508 .Ip "\fB\-mcix\fR" 4
6510 .Ip "\fB\-mno-cix\fR" 4
6512 .Ip "\fB\-mmax\fR" 4
6514 .Ip "\fB\-mno-max\fR" 4
6517 Indicate whether \s-1GCC\s0 should generate code to use the optional \s-1BWX\s0,
6518 \&\s-1CIX\s0, and \s-1MAX\s0 instruction sets. The default is to use the instruction sets
6519 supported by the \s-1CPU\s0 type specified via \fB\-mcpu=\fR option or that
6520 of the \s-1CPU\s0 on which \s-1GCC\s0 was built if none was specified.
6521 .Ip "\fB\-mcpu=\fR\fIcpu_type\fR" 4
6522 .IX Item "-mcpu=cpu_type"
6523 Set the instruction set, register set, and instruction scheduling
6524 parameters for machine type \fIcpu_type\fR. You can specify either the
6525 \&\fB\s-1EV\s0\fR style name or the corresponding chip number. \s-1GCC\s0
6526 supports scheduling parameters for the \s-1EV4\s0 and \s-1EV5\s0 family of processors
6527 and will choose the default values for the instruction set from
6528 the processor you specify. If you do not specify a processor type,
6529 \&\s-1GCC\s0 will default to the processor on which the compiler was built.
6531 Supported values for \fIcpu_type\fR are
6539 Schedules as an \s-1EV4\s0 and has no instruction set extensions.
6546 Schedules as an \s-1EV5\s0 and has no instruction set extensions.
6550 .Ip "\fB21164a\fR" 4
6553 Schedules as an \s-1EV5\s0 and supports the \s-1BWX\s0 extension.
6557 .Ip "\fB21164pc\fR" 4
6559 .Ip "\fB21164PC\fR" 4
6562 Schedules as an \s-1EV5\s0 and supports the \s-1BWX\s0 and \s-1MAX\s0 extensions.
6569 Schedules as an \s-1EV5\s0 (until Digital releases the scheduling parameters
6570 for the \s-1EV6\s0) and supports the \s-1BWX\s0, \s-1CIX\s0, and \s-1MAX\s0 extensions.
6574 .Ip "\fB\-mmemory-latency=\fR\fItime\fR" 4
6575 .IX Item "-mmemory-latency=time"
6576 Sets the latency the scheduler should assume for typical memory
6577 references as seen by the application. This number is highly
6578 dependent on the memory access patterns used by the application
6579 and the size of the external cache on the machine.
6581 Valid options for \fItime\fR are
6583 .Ip "\fInumber\fR" 4
6585 A decimal number representing clock cycles.
6596 The compiler contains estimates of the number of clock cycles for
6597 ``typical'' \s-1EV4\s0 & \s-1EV5\s0 hardware for the Level 1, 2 & 3 caches
6598 (also called Dcache, Scache, and Bcache), as well as to main memory.
6599 Note that L3 is only valid for \s-1EV5\s0.
6604 .I "Clipper Options"
6605 .IX Subsection "Clipper Options"
6607 These \fB\-m\fR options are defined for the Clipper implementations:
6608 .Ip "\fB\-mc300\fR" 4
6610 Produce code for a C300 Clipper processor. This is the default.
6611 .Ip "\fB\-mc400\fR" 4
6613 Produce code for a C400 Clipper processor i.e. use floating point
6617 .IX Subsection "H8/300 Options"
6619 These \fB\-m\fR options are defined for the H8/300 implementations:
6620 .Ip "\fB\-mrelax\fR" 4
6622 Shorten some address references at link time, when possible; uses the
6623 linker option \fB\-relax\fR.
6626 Generate code for the H8/300H.
6629 Generate code for the H8/S.
6630 .Ip "\fB\-ms2600\fR" 4
6632 Generate code for the H8/S2600. This switch must be used with \-ms.
6633 .Ip "\fB\-mint32\fR" 4
6635 Make \f(CW\*(C`int\*(C'\fR data 32 bits by default.
6636 .Ip "\fB\-malign-300\fR" 4
6637 .IX Item "-malign-300"
6638 On the H8/300H and H8/S, use the same alignment rules as for the H8/300.
6639 The default for the H8/300H and H8/S is to align longs and floats on 4
6641 \&\fB\-malign-300\fR causes them to be aligned on 2 byte boundaries.
6642 This option has no effect on the H8/300.
6644 .I "\s-1SH\s0 Options"
6645 .IX Subsection "SH Options"
6647 These \fB\-m\fR options are defined for the \s-1SH\s0 implementations:
6650 Generate code for the \s-1SH1\s0.
6653 Generate code for the \s-1SH2\s0.
6656 Generate code for the \s-1SH3\s0.
6659 Generate code for the SH3e.
6660 .Ip "\fB\-m4\-nofpu\fR" 4
6661 .IX Item "-m4-nofpu"
6662 Generate code for the \s-1SH4\s0 without a floating-point unit.
6663 .Ip "\fB\-m4\-single-only\fR" 4
6664 .IX Item "-m4-single-only"
6665 Generate code for the \s-1SH4\s0 with a floating-point unit that only
6666 supports single-precision arithmentic.
6667 .Ip "\fB\-m4\-single\fR" 4
6668 .IX Item "-m4-single"
6669 Generate code for the \s-1SH4\s0 assuming the floating-point unit is in
6670 single-precision mode by default.
6673 Generate code for the \s-1SH4\s0.
6676 Compile code for the processor in big endian mode.
6679 Compile code for the processor in little endian mode.
6680 .Ip "\fB\-mdalign\fR" 4
6682 Align doubles at 64 bit boundaries. Note that this changes the calling
6683 conventions, and thus some functions from the standard C library will
6684 not work unless you recompile it first with \-mdalign.
6685 .Ip "\fB\-mrelax\fR" 4
6687 Shorten some address references at link time, when possible; uses the
6688 linker option \fB\-relax\fR.
6689 .Ip "\fB\-mbigtable\fR" 4
6690 .IX Item "-mbigtable"
6691 Use 32\-bit offsets in \f(CW\*(C`switch\*(C'\fR tables. The default is to use
6693 .Ip "\fB\-mfmovd\fR" 4
6695 Enable the use of the instruction \f(CW\*(C`fmovd\*(C'\fR.
6696 .Ip "\fB\-mhitachi\fR" 4
6697 .IX Item "-mhitachi"
6698 Comply with the calling conventions defined by Hitachi.
6699 .Ip "\fB\-mnomacsave\fR" 4
6700 .IX Item "-mnomacsave"
6701 Mark the \f(CW\*(C`MAC\*(C'\fR register as call-clobbered, even if
6702 \&\fB\-mhitachi\fR is given.
6703 .Ip "\fB\-misize\fR" 4
6705 Dump instruction size and location in the assembly code.
6706 .Ip "\fB\-mpadstruct\fR" 4
6707 .IX Item "-mpadstruct"
6708 This option is deprecated. It pads structures to multiple of 4 bytes,
6709 which is incompatible with the \s-1SH\s0 \s-1ABI\s0.
6710 .Ip "\fB\-mspace\fR" 4
6712 Optimize for space instead of speed. Implied by \fB\-Os\fR.
6713 .Ip "\fB\-mprefergot\fR" 4
6714 .IX Item "-mprefergot"
6715 When generating position-independent code, emit function calls using
6716 the Global Offset Table instead of the Procedure Linkage Table.
6717 .Ip "\fB\-musermode\fR" 4
6718 .IX Item "-musermode"
6719 Generate a library function call to invalidate instruction cache
6720 entries, after fixing up a trampoline. This library function call
6721 doesn't assume it can write to the whole memory address space. This
6722 is the default when the target is \f(CW\*(C`sh\-*\-linux*\*(C'\fR.
6724 .I "Options for System V"
6725 .IX Subsection "Options for System V"
6727 These additional options are available on System V Release 4 for
6728 compatibility with other compilers on those systems:
6731 Create a shared object.
6732 It is recommended that \fB\-symbolic\fR or \fB\-shared\fR be used instead.
6735 Identify the versions of each tool used by the compiler, in a
6736 \&\f(CW\*(C`.ident\*(C'\fR assembler directive in the output.
6739 Refrain from adding \f(CW\*(C`.ident\*(C'\fR directives to the output file (this is
6741 .Ip "\fB\-YP,\fR\fIdirs\fR" 4
6743 Search the directories \fIdirs\fR, and no others, for libraries
6744 specified with \fB\-l\fR.
6745 .Ip "\fB\-Ym,\fR\fIdir\fR" 4
6747 Look in the directory \fIdir\fR to find the M4 preprocessor.
6748 The assembler uses this option.
6750 .I "TMS320C3x/C4x Options"
6751 .IX Subsection "TMS320C3x/C4x Options"
6753 These \fB\-m\fR options are defined for TMS320C3x/C4x implementations:
6754 .Ip "\fB\-mcpu=\fR\fIcpu_type\fR" 4
6755 .IX Item "-mcpu=cpu_type"
6756 Set the instruction set, register set, and instruction scheduling
6757 parameters for machine type \fIcpu_type\fR. Supported values for
6758 \&\fIcpu_type\fR are \fBc30\fR, \fBc31\fR, \fBc32\fR, \fBc40\fR, and
6759 \&\fBc44\fR. The default is \fBc40\fR to generate code for the
6761 .Ip "\fB\-mbig-memory\fR" 4
6762 .IX Item "-mbig-memory"
6764 .Ip "\fB\-mbig\fR" 4
6766 .Ip "\fB\-msmall-memory\fR" 4
6767 .IX Item "-msmall-memory"
6768 .Ip "\fB\-msmall\fR" 4
6771 Generates code for the big or small memory model. The small memory
6772 model assumed that all data fits into one 64K word page. At run-time
6773 the data page (\s-1DP\s0) register must be set to point to the 64K page
6774 containing the .bss and .data program sections. The big memory model is
6775 the default and requires reloading of the \s-1DP\s0 register for every direct
6780 .Ip "\fB\-mno-bk\fR" 4
6783 Allow (disallow) allocation of general integer operands into the block
6784 count register \s-1BK\s0.
6788 .Ip "\fB\-mno-db\fR" 4
6791 Enable (disable) generation of code using decrement and branch,
6792 \&\fIDBcond\fR\|(D), instructions. This is enabled by default for the C4x. To be
6793 on the safe side, this is disabled for the C3x, since the maximum
6794 iteration count on the C3x is 2^23 + 1 (but who iterates loops more than
6795 2^23 times on the C3x?). Note that \s-1GCC\s0 will try to reverse a loop so
6796 that it can utilise the decrement and branch instruction, but will give
6797 up if there is more than one memory reference in the loop. Thus a loop
6798 where the loop counter is decremented can generate slightly more
6799 efficient code, in cases where the \s-1RPTB\s0 instruction cannot be utilised.
6800 .Ip "\fB\-mdp-isr-reload\fR" 4
6801 .IX Item "-mdp-isr-reload"
6803 .Ip "\fB\-mparanoid\fR" 4
6804 .IX Item "-mparanoid"
6806 Force the \s-1DP\s0 register to be saved on entry to an interrupt service
6807 routine (\s-1ISR\s0), reloaded to point to the data section, and restored on
6808 exit from the \s-1ISR\s0. This should not be required unless someone has
6809 violated the small memory model by modifying the \s-1DP\s0 register, say within
6811 .Ip "\fB\-mmpyi\fR" 4
6814 .Ip "\fB\-mno-mpyi\fR" 4
6815 .IX Item "-mno-mpyi"
6817 For the C3x use the 24\-bit \s-1MPYI\s0 instruction for integer multiplies
6818 instead of a library call to guarantee 32\-bit results. Note that if one
6819 of the operands is a constant, then the multiplication will be performed
6820 using shifts and adds. If the \-mmpyi option is not specified for the C3x,
6821 then squaring operations are performed inline instead of a library call.
6822 .Ip "\fB\-mfast-fix\fR" 4
6823 .IX Item "-mfast-fix"
6825 .Ip "\fB\-mno-fast-fix\fR" 4
6826 .IX Item "-mno-fast-fix"
6828 The C3x/C4x \s-1FIX\s0 instruction to convert a floating point value to an
6829 integer value chooses the nearest integer less than or equal to the
6830 floating point value rather than to the nearest integer. Thus if the
6831 floating point number is negative, the result will be incorrectly
6832 truncated an additional code is necessary to detect and correct this
6833 case. This option can be used to disable generation of the additional
6834 code required to correct the result.
6835 .Ip "\fB\-mrptb\fR" 4
6838 .Ip "\fB\-mno-rptb\fR" 4
6839 .IX Item "-mno-rptb"
6841 Enable (disable) generation of repeat block sequences using the \s-1RPTB\s0
6842 instruction for zero overhead looping. The \s-1RPTB\s0 construct is only used
6843 for innermost loops that do not call functions or jump across the loop
6844 boundaries. There is no advantage having nested \s-1RPTB\s0 loops due to the
6845 overhead required to save and restore the \s-1RC\s0, \s-1RS\s0, and \s-1RE\s0 registers.
6846 This is enabled by default with \-O2.
6847 .Ip "\fB\-mrpts=\fR\fIcount\fR" 4
6848 .IX Item "-mrpts=count"
6850 .Ip "\fB\-mno-rpts\fR" 4
6851 .IX Item "-mno-rpts"
6853 Enable (disable) the use of the single instruction repeat instruction
6854 \&\s-1RPTS\s0. If a repeat block contains a single instruction, and the loop
6855 count can be guaranteed to be less than the value \fIcount\fR, \s-1GCC\s0 will
6856 emit a \s-1RPTS\s0 instruction instead of a \s-1RPTB\s0. If no value is specified,
6857 then a \s-1RPTS\s0 will be emitted even if the loop count cannot be determined
6858 at compile time. Note that the repeated instruction following \s-1RPTS\s0 does
6859 not have to be reloaded from memory each iteration, thus freeing up the
6860 \&\s-1CPU\s0 buses for operands. However, since interrupts are blocked by this
6861 instruction, it is disabled by default.
6862 .Ip "\fB\-mloop-unsigned\fR" 4
6863 .IX Item "-mloop-unsigned"
6865 .Ip "\fB\-mno-loop-unsigned\fR" 4
6866 .IX Item "-mno-loop-unsigned"
6868 The maximum iteration count when using \s-1RPTS\s0 and \s-1RPTB\s0 (and \s-1DB\s0 on the C40)
6869 is 2^31 + 1 since these instructions test if the iteration count is
6870 negative to terminate the loop. If the iteration count is unsigned
6871 there is a possibility than the 2^31 + 1 maximum iteration count may be
6872 exceeded. This switch allows an unsigned iteration count.
6875 Try to emit an assembler syntax that the \s-1TI\s0 assembler (asm30) is happy
6876 with. This also enforces compatibility with the \s-1API\s0 employed by the \s-1TI\s0
6877 C3x C compiler. For example, long doubles are passed as structures
6878 rather than in floating point registers.
6879 .Ip "\fB\-mregparm\fR" 4
6880 .IX Item "-mregparm"
6882 .Ip "\fB\-mmemparm\fR" 4
6883 .IX Item "-mmemparm"
6885 Generate code that uses registers (stack) for passing arguments to functions.
6886 By default, arguments are passed in registers where possible rather
6887 than by pushing arguments on to the stack.
6888 .Ip "\fB\-mparallel-insns\fR" 4
6889 .IX Item "-mparallel-insns"
6891 .Ip "\fB\-mno-parallel-insns\fR" 4
6892 .IX Item "-mno-parallel-insns"
6894 Allow the generation of parallel instructions. This is enabled by
6896 .Ip "\fB\-mparallel-mpy\fR" 4
6897 .IX Item "-mparallel-mpy"
6899 .Ip "\fB\-mno-parallel-mpy\fR" 4
6900 .IX Item "-mno-parallel-mpy"
6902 Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
6903 provided \-mparallel-insns is also specified. These instructions have
6904 tight register constraints which can pessimize the code generation
6908 .IX Subsection "V850 Options"
6910 These \fB\-m\fR options are defined for V850 implementations:
6911 .Ip "\fB\-mlong-calls\fR" 4
6912 .IX Item "-mlong-calls"
6914 .Ip "\fB\-mno-long-calls\fR" 4
6915 .IX Item "-mno-long-calls"
6917 Treat all calls as being far away (near). If calls are assumed to be
6918 far away, the compiler will always load the functions address up into a
6919 register, and call indirect through the pointer.
6920 .Ip "\fB\-mno-ep\fR" 4
6926 Do not optimize (do optimize) basic blocks that use the same index
6927 pointer 4 or more times to copy pointer into the \f(CW\*(C`ep\*(C'\fR register, and
6928 use the shorter \f(CW\*(C`sld\*(C'\fR and \f(CW\*(C`sst\*(C'\fR instructions. The \fB\-mep\fR
6929 option is on by default if you optimize.
6930 .Ip "\fB\-mno-prolog-function\fR" 4
6931 .IX Item "-mno-prolog-function"
6933 .Ip "\fB\-mprolog-function\fR" 4
6934 .IX Item "-mprolog-function"
6936 Do not use (do use) external functions to save and restore registers at
6937 the prolog and epilog of a function. The external functions are slower,
6938 but use less code space if more than one function saves the same number
6939 of registers. The \fB\-mprolog-function\fR option is on by default if
6941 .Ip "\fB\-mspace\fR" 4
6943 Try to make the code as small as possible. At present, this just turns
6944 on the \fB\-mep\fR and \fB\-mprolog-function\fR options.
6945 .Ip "\fB\-mtda=\fR\fIn\fR" 4
6947 Put static or global variables whose size is \fIn\fR bytes or less into
6948 the tiny data area that register \f(CW\*(C`ep\*(C'\fR points to. The tiny data
6949 area can hold up to 256 bytes in total (128 bytes for byte references).
6950 .Ip "\fB\-msda=\fR\fIn\fR" 4
6952 Put static or global variables whose size is \fIn\fR bytes or less into
6953 the small data area that register \f(CW\*(C`gp\*(C'\fR points to. The small data
6954 area can hold up to 64 kilobytes.
6955 .Ip "\fB\-mzda=\fR\fIn\fR" 4
6957 Put static or global variables whose size is \fIn\fR bytes or less into
6958 the first 32 kilobytes of memory.
6959 .Ip "\fB\-mv850\fR" 4
6961 Specify that the target processor is the V850.
6962 .Ip "\fB\-mbig-switch\fR" 4
6963 .IX Item "-mbig-switch"
6964 Generate code suitable for big switch tables. Use this option only if
6965 the assembler/linker complain about out of range branches within a switch
6968 .I "\s-1ARC\s0 Options"
6969 .IX Subsection "ARC Options"
6971 These options are defined for \s-1ARC\s0 implementations:
6974 Compile code for little endian mode. This is the default.
6977 Compile code for big endian mode.
6978 .Ip "\fB\-mmangle-cpu\fR" 4
6979 .IX Item "-mmangle-cpu"
6980 Prepend the name of the cpu to all public symbol names.
6981 In multiple-processor systems, there are many \s-1ARC\s0 variants with different
6982 instruction and register set characteristics. This flag prevents code
6983 compiled for one cpu to be linked with code compiled for another.
6984 No facility exists for handling variants that are \*(L"almost identical\*(R".
6985 This is an all or nothing option.
6986 .Ip "\fB\-mcpu=\fR\fIcpu\fR" 4
6987 .IX Item "-mcpu=cpu"
6988 Compile code for \s-1ARC\s0 variant \fIcpu\fR.
6989 Which variants are supported depend on the configuration.
6990 All variants support \fB\-mcpu=base\fR, this is the default.
6991 .Ip "\fB\-mtext=\fR\fItext section\fR" 4
6992 .IX Item "-mtext=text section"
6994 .Ip "\fB\-mdata=\fR\fIdata section\fR" 4
6995 .IX Item "-mdata=data section"
6996 .Ip "\fB\-mrodata=\fR\fIreadonly data section\fR" 4
6997 .IX Item "-mrodata=readonly data section"
6999 Put functions, data, and readonly data in \fItext section\fR,
7000 \&\fIdata section\fR, and \fIreadonly data section\fR respectively
7001 by default. This can be overridden with the \f(CW\*(C`section\*(C'\fR attribute.
7003 .I "\s-1NS32K\s0 Options"
7004 .IX Subsection "NS32K Options"
7006 These are the \fB\-m\fR options defined for the 32000 series. The default
7007 values for these options depends on which style of 32000 was selected when
7008 the compiler was configured; the defaults for the most common choices are
7010 .Ip "\fB\-m32032\fR" 4
7013 .Ip "\fB\-m32032\fR" 4
7016 Generate output for a 32032. This is the default
7017 when the compiler is configured for 32032 and 32016 based systems.
7018 .Ip "\fB\-m32332\fR" 4
7021 .Ip "\fB\-m32332\fR" 4
7024 Generate output for a 32332. This is the default
7025 when the compiler is configured for 32332\-based systems.
7026 .Ip "\fB\-m32532\fR" 4
7029 .Ip "\fB\-m32532\fR" 4
7032 Generate output for a 32532. This is the default
7033 when the compiler is configured for 32532\-based systems.
7034 .Ip "\fB\-m32081\fR" 4
7036 Generate output containing 32081 instructions for floating point.
7037 This is the default for all systems.
7038 .Ip "\fB\-m32381\fR" 4
7040 Generate output containing 32381 instructions for floating point. This
7041 also implies \fB\-m32081\fR. The 32381 is only compatible with the 32332
7042 and 32532 cpus. This is the default for the pc532\-netbsd configuration.
7043 .Ip "\fB\-mmulti-add\fR" 4
7044 .IX Item "-mmulti-add"
7045 Try and generate multiply-add floating point instructions \f(CW\*(C`polyF\*(C'\fR
7046 and \f(CW\*(C`dotF\*(C'\fR. This option is only available if the \fB\-m32381\fR
7047 option is in effect. Using these instructions requires changes to to
7048 register allocation which generally has a negative impact on
7049 performance. This option should only be enabled when compiling code
7050 particularly likely to make heavy use of multiply-add instructions.
7051 .Ip "\fB\-mnomulti-add\fR" 4
7052 .IX Item "-mnomulti-add"
7053 Do not try and generate multiply-add floating point instructions
7054 \&\f(CW\*(C`polyF\*(C'\fR and \f(CW\*(C`dotF\*(C'\fR. This is the default on all platforms.
7055 .Ip "\fB\-msoft-float\fR" 4
7056 .IX Item "-msoft-float"
7057 Generate output containing library calls for floating point.
7058 \&\fBWarning:\fR the requisite libraries may not be available.
7059 .Ip "\fB\-mnobitfield\fR" 4
7060 .IX Item "-mnobitfield"
7061 Do not use the bit-field instructions. On some machines it is faster to
7062 use shifting and masking operations. This is the default for the pc532.
7063 .Ip "\fB\-mbitfield\fR" 4
7064 .IX Item "-mbitfield"
7065 Do use the bit-field instructions. This is the default for all platforms
7067 .Ip "\fB\-mrtd\fR" 4
7069 Use a different function-calling convention, in which functions
7070 that take a fixed number of arguments return pop their
7071 arguments on return with the \f(CW\*(C`ret\*(C'\fR instruction.
7073 This calling convention is incompatible with the one normally
7074 used on Unix, so you cannot use it if you need to call libraries
7075 compiled with the Unix compiler.
7077 Also, you must provide function prototypes for all functions that
7078 take variable numbers of arguments (including \f(CW\*(C`printf\*(C'\fR);
7079 otherwise incorrect code will be generated for calls to those
7082 In addition, seriously incorrect code will result if you call a
7083 function with too many arguments. (Normally, extra arguments are
7084 harmlessly ignored.)
7086 This option takes its name from the 680x0 \f(CW\*(C`rtd\*(C'\fR instruction.
7087 .Ip "\fB\-mregparam\fR" 4
7088 .IX Item "-mregparam"
7089 Use a different function-calling convention where the first two arguments
7090 are passed in registers.
7092 This calling convention is incompatible with the one normally
7093 used on Unix, so you cannot use it if you need to call libraries
7094 compiled with the Unix compiler.
7095 .Ip "\fB\-mnoregparam\fR" 4
7096 .IX Item "-mnoregparam"
7097 Do not pass any arguments in registers. This is the default for all
7101 It is \s-1OK\s0 to use the sb as an index register which is always loaded with
7102 zero. This is the default for the pc532\-netbsd target.
7103 .Ip "\fB\-mnosb\fR" 4
7105 The sb register is not available for use or has not been initialized to
7106 zero by the run time system. This is the default for all targets except
7107 the pc532\-netbsd. It is also implied whenever \fB\-mhimem\fR or
7108 \&\fB\-fpic\fR is set.
7109 .Ip "\fB\-mhimem\fR" 4
7111 Many ns32000 series addressing modes use displacements of up to 512MB.
7112 If an address is above 512MB then displacements from zero can not be used.
7113 This option causes code to be generated which can be loaded above 512MB.
7114 This may be useful for operating systems or \s-1ROM\s0 code.
7115 .Ip "\fB\-mnohimem\fR" 4
7116 .IX Item "-mnohimem"
7117 Assume code will be loaded in the first 512MB of virtual address space.
7118 This is the default for all platforms.
7120 .I "\s-1AVR\s0 Options"
7121 .IX Subsection "AVR Options"
7123 These options are defined for \s-1AVR\s0 implementations:
7124 .Ip "\fB\-mmcu=\fR\fImcu\fR" 4
7125 .IX Item "-mmcu=mcu"
7126 Specify \s-1ATMEL\s0 \s-1AVR\s0 instruction set or \s-1MCU\s0 type.
7128 Instruction set avr1 is for the minimal \s-1AVR\s0 core, not supported by the C
7129 compiler, only for assembler programs (\s-1MCU\s0 types: at90s1200, attiny10,
7130 attiny11, attiny12, attiny15, attiny28).
7132 Instruction set avr2 (default) is for the classic \s-1AVR\s0 core with up to
7133 8K program memory space (\s-1MCU\s0 types: at90s2313, at90s2323, attiny22,
7134 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
7135 at90c8534, at90s8535).
7137 Instruction set avr3 is for the classic \s-1AVR\s0 core with up to 128K program
7138 memory space (\s-1MCU\s0 types: atmega103, atmega603).
7140 Instruction set avr4 is for the enhanced \s-1AVR\s0 core with up to 8K program
7141 memory space (\s-1MCU\s0 types: atmega83, atmega85).
7143 Instruction set avr5 is for the enhanced \s-1AVR\s0 core with up to 128K program
7144 memory space (\s-1MCU\s0 types: atmega161, atmega163, atmega32, at94k).
7145 .Ip "\fB\-msize\fR" 4
7147 Output instruction sizes to the asm file.
7148 .Ip "\fB\-minit-stack=\fR\fIN\fR" 4
7149 .IX Item "-minit-stack=N"
7150 Specify the initial stack address, which may be a symbol or numeric value,
7151 _\|_stack is the default.
7152 .Ip "\fB\-mno-interrupts\fR" 4
7153 .IX Item "-mno-interrupts"
7154 Generated code is not compatible with hardware interrupts.
7155 Code size will be smaller.
7156 .Ip "\fB\-mcall-prologues\fR" 4
7157 .IX Item "-mcall-prologues"
7158 Functions prologues/epilogues expanded as call to appropriate
7159 subroutines. Code size will be smaller.
7160 .Ip "\fB\-mno-tablejump\fR" 4
7161 .IX Item "-mno-tablejump"
7162 Do not generate tablejump insns which sometimes increase code size.
7163 .Ip "\fB\-mtiny-stack\fR" 4
7164 .IX Item "-mtiny-stack"
7165 Change only the low 8 bits of the stack pointer.
7168 .IX Subsection "MCore Options"
7170 These are the \fB\-m\fR options defined for the Motorola M*Core
7172 .Ip "\fB\-mhardlit\fR" 4
7173 .IX Item "-mhardlit"
7175 .Ip "\fB\-mhardlit\fR" 4
7176 .IX Item "-mhardlit"
7177 .Ip "\fB\-mno-hardlit\fR" 4
7178 .IX Item "-mno-hardlit"
7180 Inline constants into the code stream if it can be done in two
7181 instructions or less.
7182 .Ip "\fB\-mdiv\fR" 4
7185 .Ip "\fB\-mdiv\fR" 4
7187 .Ip "\fB\-mno-div\fR" 4
7190 Use the divide instruction. (Enabled by default).
7191 .Ip "\fB\-mrelax-immediate\fR" 4
7192 .IX Item "-mrelax-immediate"
7194 .Ip "\fB\-mrelax-immediate\fR" 4
7195 .IX Item "-mrelax-immediate"
7196 .Ip "\fB\-mno-relax-immediate\fR" 4
7197 .IX Item "-mno-relax-immediate"
7199 Allow arbitrary sized immediates in bit operations.
7200 .Ip "\fB\-mwide-bitfields\fR" 4
7201 .IX Item "-mwide-bitfields"
7203 .Ip "\fB\-mwide-bitfields\fR" 4
7204 .IX Item "-mwide-bitfields"
7205 .Ip "\fB\-mno-wide-bitfields\fR" 4
7206 .IX Item "-mno-wide-bitfields"
7208 Always treat bitfields as int-sized.
7209 .Ip "\fB\-m4byte-functions\fR" 4
7210 .IX Item "-m4byte-functions"
7212 .Ip "\fB\-m4byte-functions\fR" 4
7213 .IX Item "-m4byte-functions"
7214 .Ip "\fB\-mno-4byte-functions\fR" 4
7215 .IX Item "-mno-4byte-functions"
7217 Force all functions to be aligned to a four byte boundary.
7218 .Ip "\fB\-mcallgraph-data\fR" 4
7219 .IX Item "-mcallgraph-data"
7221 .Ip "\fB\-mcallgraph-data\fR" 4
7222 .IX Item "-mcallgraph-data"
7223 .Ip "\fB\-mno-callgraph-data\fR" 4
7224 .IX Item "-mno-callgraph-data"
7226 Emit callgraph information.
7227 .Ip "\fB\-mslow-bytes\fR" 4
7228 .IX Item "-mslow-bytes"
7230 .Ip "\fB\-mslow-bytes\fR" 4
7231 .IX Item "-mslow-bytes"
7232 .Ip "\fB\-mno-slow-bytes\fR" 4
7233 .IX Item "-mno-slow-bytes"
7235 Prefer word access when reading byte quantities.
7236 .Ip "\fB\-mlittle-endian\fR" 4
7237 .IX Item "-mlittle-endian"
7239 .Ip "\fB\-mlittle-endian\fR" 4
7240 .IX Item "-mlittle-endian"
7241 .Ip "\fB\-mbig-endian\fR" 4
7242 .IX Item "-mbig-endian"
7244 Generate code for a little endian target.
7245 .Ip "\fB\-m210\fR" 4
7248 .Ip "\fB\-m210\fR" 4
7250 .Ip "\fB\-m340\fR" 4
7253 Generate code for the 210 processor.
7255 .I "\s-1IA-64\s0 Options"
7256 .IX Subsection "IA-64 Options"
7258 These are the \fB\-m\fR options defined for the Intel \s-1IA-64\s0 architecture.
7259 .Ip "\fB\-mbig-endian\fR" 4
7260 .IX Item "-mbig-endian"
7261 Generate code for a big endian target. This is the default for \s-1HPUX\s0.
7262 .Ip "\fB\-mlittle-endian\fR" 4
7263 .IX Item "-mlittle-endian"
7264 Generate code for a little endian target. This is the default for \s-1AIX5\s0
7266 .Ip "\fB\-mgnu-as\fR" 4
7269 .Ip "\fB\-mno-gnu-as\fR" 4
7270 .IX Item "-mno-gnu-as"
7272 Generate (or don't) code for the \s-1GNU\s0 assembler. This is the default.
7273 .Ip "\fB\-mgnu-ld\fR" 4
7276 .Ip "\fB\-mno-gnu-ld\fR" 4
7277 .IX Item "-mno-gnu-ld"
7279 Generate (or don't) code for the \s-1GNU\s0 linker. This is the default.
7280 .Ip "\fB\-mno-pic\fR" 4
7282 Generate code that does not use a global pointer register. The result
7283 is not position independent code, and violates the \s-1IA-64\s0 \s-1ABI\s0.
7284 .Ip "\fB\-mvolatile-asm-stop\fR" 4
7285 .IX Item "-mvolatile-asm-stop"
7287 .Ip "\fB\-mno-volatile-asm-stop\fR" 4
7288 .IX Item "-mno-volatile-asm-stop"
7290 Generate (or don't) a stop bit immediately before and after volatile asm
7292 .Ip "\fB\-mb-step\fR" 4
7294 Generate code that works around Itanium B step errata.
7295 .Ip "\fB\-mregister-names\fR" 4
7296 .IX Item "-mregister-names"
7298 .Ip "\fB\-mno-register-names\fR" 4
7299 .IX Item "-mno-register-names"
7301 Generate (or don't) \fBin\fR, \fBloc\fR, and \fBout\fR register names for
7302 the stacked registers. This may make assembler output more readable.
7303 .Ip "\fB\-mno-sdata\fR" 4
7304 .IX Item "-mno-sdata"
7306 .Ip "\fB\-msdata\fR" 4
7309 Disable (or enable) optimizations that use the small data section. This may
7310 be useful for working around optimizer bugs.
7311 .Ip "\fB\-mconstant-gp\fR" 4
7312 .IX Item "-mconstant-gp"
7313 Generate code that uses a single constant global pointer value. This is
7314 useful when compiling kernel code.
7315 .Ip "\fB\-mauto-pic\fR" 4
7316 .IX Item "-mauto-pic"
7317 Generate code that is self-relocatable. This implies \fB\-mconstant-gp\fR.
7318 This is useful when compiling firmware code.
7319 .Ip "\fB\-minline-divide-min-latency\fR" 4
7320 .IX Item "-minline-divide-min-latency"
7321 Generate code for inline divides using the minimum latency algorithm.
7322 .Ip "\fB\-minline-divide-max-throughput\fR" 4
7323 .IX Item "-minline-divide-max-throughput"
7324 Generate code for inline divides using the maximum throughput algorithm.
7325 .Ip "\fB\-mno-dwarf2\-asm\fR" 4
7326 .IX Item "-mno-dwarf2-asm"
7328 .Ip "\fB\-mdwarf2\-asm\fR" 4
7329 .IX Item "-mdwarf2-asm"
7331 Don't (or do) generate assembler code for the \s-1DWARF2\s0 line number debugging
7332 info. This may be useful when not using the \s-1GNU\s0 assembler.
7333 .Ip "\fB\-mfixed-range=\fR\fIregister range\fR" 4
7334 .IX Item "-mfixed-range=register range"
7335 Generate code treating the given register range as fixed registers.
7336 A fixed register is one that the register allocator can not use. This is
7337 useful when compiling kernel code. A register range is specified as
7338 two registers separated by a dash. Multiple register ranges can be
7339 specified separated by a comma.
7342 .IX Subsection "D30V Options"
7344 These \fB\-m\fR options are defined for D30V implementations:
7345 .Ip "\fB\-mextmem\fR" 4
7347 Link the \fB.text\fR, \fB.data\fR, \fB.bss\fR, \fB.strings\fR,
7348 \&\fB.rodata\fR, \fB.rodata1\fR, \fB.data1\fR sections into external
7349 memory, which starts at location \f(CW\*(C`0x80000000\*(C'\fR.
7350 .Ip "\fB\-mextmemory\fR" 4
7351 .IX Item "-mextmemory"
7352 Same as the \fB\-mextmem\fR switch.
7353 .Ip "\fB\-monchip\fR" 4
7355 Link the \fB.text\fR section into onchip text memory, which starts at
7356 location \f(CW\*(C`0x0\*(C'\fR. Also link \fB.data\fR, \fB.bss\fR,
7357 \&\fB.strings\fR, \fB.rodata\fR, \fB.rodata1\fR, \fB.data1\fR sections
7358 into onchip data memory, which starts at location \f(CW\*(C`0x20000000\*(C'\fR.
7359 .Ip "\fB\-mno-asm-optimize\fR" 4
7360 .IX Item "-mno-asm-optimize"
7362 .Ip "\fB\-masm-optimize\fR" 4
7363 .IX Item "-masm-optimize"
7365 Disable (enable) passing \fB\-O\fR to the assembler when optimizing.
7366 The assembler uses the \fB\-O\fR option to automatically parallelize
7367 adjacent short instructions where possible.
7368 .Ip "\fB\-mbranch-cost=\fR\fIn\fR" 4
7369 .IX Item "-mbranch-cost=n"
7370 Increase the internal costs of branches to \fIn\fR. Higher costs means
7371 that the compiler will issue more instructions to avoid doing a branch.
7373 .Ip "\fB\-mcond-exec=\fR\fIn\fR" 4
7374 .IX Item "-mcond-exec=n"
7375 Specify the maximum number of conditionally executed instructions that
7376 replace a branch. The default is 4.
7377 .Sh "Options for Code Generation Conventions"
7378 .IX Subsection "Options for Code Generation Conventions"
7379 These machine-independent options control the interface conventions
7380 used in code generation.
7382 Most of them have both positive and negative forms; the negative form
7383 of \fB\-ffoo\fR would be \fB\-fno-foo\fR. In the table below, only
7384 one of the forms is listed\-\-\-the one which is not the default. You
7385 can figure out the other form by either removing \fBno-\fR or adding
7387 .Ip "\fB\-fexceptions\fR" 4
7388 .IX Item "-fexceptions"
7389 Enable exception handling. Generates extra code needed to propagate
7390 exceptions. For some targets, this implies \s-1GNU\s0 \s-1CC\s0 will generate frame
7391 unwind information for all functions, which can produce significant data
7392 size overhead, although it does not affect execution. If you do not
7393 specify this option, \s-1GNU\s0 \s-1CC\s0 will enable it by default for languages like
7394 \&\*(C+ which normally require exception handling, and disable itfor
7395 languages like C that do not normally require it. However, you may need
7396 to enable this option when compiling C code that needs to interoperate
7397 properly with exception handlers written in \*(C+. You may also wish to
7398 disable this option if you are compiling older \*(C+ programs that don't
7399 use exception handling.
7400 .Ip "\fB\-funwind-tables\fR" 4
7401 .IX Item "-funwind-tables"
7402 Similar to \fB\-fexceptions\fR, except that it will just generate any needed
7403 static data, but will not affect the generated code in any other way.
7404 You will normally not enable this option; instead, a language processor
7405 that needs this handling would enable it on your behalf.
7406 .Ip "\fB\-fpcc-struct-return\fR" 4
7407 .IX Item "-fpcc-struct-return"
7408 Return ``short'' \f(CW\*(C`struct\*(C'\fR and \f(CW\*(C`union\*(C'\fR values in memory like
7409 longer ones, rather than in registers. This convention is less
7410 efficient, but it has the advantage of allowing intercallability between
7411 GCC-compiled files and files compiled with other compilers.
7413 The precise convention for returning structures in memory depends
7414 on the target configuration macros.
7416 Short structures and unions are those whose size and alignment match
7417 that of some integer type.
7418 .Ip "\fB\-freg-struct-return\fR" 4
7419 .IX Item "-freg-struct-return"
7420 Use the convention that \f(CW\*(C`struct\*(C'\fR and \f(CW\*(C`union\*(C'\fR values are
7421 returned in registers when possible. This is more efficient for small
7422 structures than \fB\-fpcc-struct-return\fR.
7424 If you specify neither \fB\-fpcc-struct-return\fR nor its contrary
7425 \&\fB\-freg-struct-return\fR, \s-1GCC\s0 defaults to whichever convention is
7426 standard for the target. If there is no standard convention, \s-1GCC\s0
7427 defaults to \fB\-fpcc-struct-return\fR, except on targets where \s-1GCC\s0
7428 is the principal compiler. In those cases, we can choose the standard,
7429 and we chose the more efficient register return alternative.
7430 .Ip "\fB\-fshort-enums\fR" 4
7431 .IX Item "-fshort-enums"
7432 Allocate to an \f(CW\*(C`enum\*(C'\fR type only as many bytes as it needs for the
7433 declared range of possible values. Specifically, the \f(CW\*(C`enum\*(C'\fR type
7434 will be equivalent to the smallest integer type which has enough room.
7435 .Ip "\fB\-fshort-double\fR" 4
7436 .IX Item "-fshort-double"
7437 Use the same size for \f(CW\*(C`double\*(C'\fR as for \f(CW\*(C`float\*(C'\fR.
7438 .Ip "\fB\-fshared-data\fR" 4
7439 .IX Item "-fshared-data"
7440 Requests that the data and non-\f(CW\*(C`const\*(C'\fR variables of this
7441 compilation be shared data rather than private data. The distinction
7442 makes sense only on certain operating systems, where shared data is
7443 shared between processes running the same program, while private data
7444 exists in one copy per process.
7445 .Ip "\fB\-fno-common\fR" 4
7446 .IX Item "-fno-common"
7447 Allocate even uninitialized global variables in the data section of the
7448 object file, rather than generating them as common blocks. This has the
7449 effect that if the same variable is declared (without \f(CW\*(C`extern\*(C'\fR) in
7450 two different compilations, you will get an error when you link them.
7451 The only reason this might be useful is if you wish to verify that the
7452 program will work on other systems which always work this way.
7453 .Ip "\fB\-fno-ident\fR" 4
7454 .IX Item "-fno-ident"
7455 Ignore the \fB#ident\fR directive.
7456 .Ip "\fB\-fno-gnu-linker\fR" 4
7457 .IX Item "-fno-gnu-linker"
7458 Do not output global initializations (such as \*(C+ constructors and
7459 destructors) in the form used by the \s-1GNU\s0 linker (on systems where the \s-1GNU\s0
7460 linker is the standard method of handling them). Use this option when
7461 you want to use a non-GNU linker, which also requires using the
7462 \&\fBcollect2\fR program to make sure the system linker includes
7463 constructors and destructors. (\fBcollect2\fR is included in the \s-1GCC\s0
7464 distribution.) For systems which \fImust\fR use \fBcollect2\fR, the
7465 compiler driver \fBgcc\fR is configured to do this automatically.
7466 .Ip "\fB\-finhibit-size-directive\fR" 4
7467 .IX Item "-finhibit-size-directive"
7468 Don't output a \f(CW\*(C`.size\*(C'\fR assembler directive, or anything else that
7469 would cause trouble if the function is split in the middle, and the
7470 two halves are placed at locations far apart in memory. This option is
7471 used when compiling \fIcrtstuff.c\fR; you should not need to use it
7473 .Ip "\fB\-fverbose-asm\fR" 4
7474 .IX Item "-fverbose-asm"
7475 Put extra commentary information in the generated assembly code to
7476 make it more readable. This option is generally only of use to those
7477 who actually need to read the generated assembly code (perhaps while
7478 debugging the compiler itself).
7480 \&\fB\-fno-verbose-asm\fR, the default, causes the
7481 extra information to be omitted and is useful when comparing two assembler
7483 .Ip "\fB\-fvolatile\fR" 4
7484 .IX Item "-fvolatile"
7485 Consider all memory references through pointers to be volatile.
7486 .Ip "\fB\-fvolatile-global\fR" 4
7487 .IX Item "-fvolatile-global"
7488 Consider all memory references to extern and global data items to
7489 be volatile. \s-1GCC\s0 does not consider static data items to be volatile
7490 because of this switch.
7491 .Ip "\fB\-fvolatile-static\fR" 4
7492 .IX Item "-fvolatile-static"
7493 Consider all memory references to static data to be volatile.
7494 .Ip "\fB\-fpic\fR" 4
7496 Generate position-independent code (\s-1PIC\s0) suitable for use in a shared
7497 library, if supported for the target machine. Such code accesses all
7498 constant addresses through a global offset table (\s-1GOT\s0). The dynamic
7499 loader resolves the \s-1GOT\s0 entries when the program starts (the dynamic
7500 loader is not part of \s-1GCC\s0; it is part of the operating system). If
7501 the \s-1GOT\s0 size for the linked executable exceeds a machine-specific
7502 maximum size, you get an error message from the linker indicating that
7503 \&\fB\-fpic\fR does not work; in that case, recompile with \fB\-fPIC\fR
7504 instead. (These maximums are 16k on the m88k, 8k on the Sparc, and 32k
7505 on the m68k and \s-1RS/6000\s0. The 386 has no such limit.)
7507 Position-independent code requires special support, and therefore works
7508 only on certain machines. For the 386, \s-1GCC\s0 supports \s-1PIC\s0 for System V
7509 but not for the Sun 386i. Code generated for the \s-1IBM\s0 \s-1RS/6000\s0 is always
7510 position-independent.
7511 .Ip "\fB\-fPIC\fR" 4
7513 If supported for the target machine, emit position-independent code,
7514 suitable for dynamic linking and avoiding any limit on the size of the
7515 global offset table. This option makes a difference on the m68k, m88k,
7518 Position-independent code requires special support, and therefore works
7519 only on certain machines.
7520 .Ip "\fB\-ffixed-\fR\fIreg\fR" 4
7521 .IX Item "-ffixed-reg"
7522 Treat the register named \fIreg\fR as a fixed register; generated code
7523 should never refer to it (except perhaps as a stack pointer, frame
7524 pointer or in some other fixed role).
7526 \&\fIreg\fR must be the name of a register. The register names accepted
7527 are machine-specific and are defined in the \f(CW\*(C`REGISTER_NAMES\*(C'\fR
7528 macro in the machine description macro file.
7530 This flag does not have a negative form, because it specifies a
7532 .Ip "\fB\-fcall-used-\fR\fIreg\fR" 4
7533 .IX Item "-fcall-used-reg"
7534 Treat the register named \fIreg\fR as an allocable register that is
7535 clobbered by function calls. It may be allocated for temporaries or
7536 variables that do not live across a call. Functions compiled this way
7537 will not save and restore the register \fIreg\fR.
7539 It is an error to used this flag with the frame pointer or stack pointer.
7540 Use of this flag for other registers that have fixed pervasive roles in
7541 the machine's execution model will produce disastrous results.
7543 This flag does not have a negative form, because it specifies a
7545 .Ip "\fB\-fcall-saved-\fR\fIreg\fR" 4
7546 .IX Item "-fcall-saved-reg"
7547 Treat the register named \fIreg\fR as an allocable register saved by
7548 functions. It may be allocated even for temporaries or variables that
7549 live across a call. Functions compiled this way will save and restore
7550 the register \fIreg\fR if they use it.
7552 It is an error to used this flag with the frame pointer or stack pointer.
7553 Use of this flag for other registers that have fixed pervasive roles in
7554 the machine's execution model will produce disastrous results.
7556 A different sort of disaster will result from the use of this flag for
7557 a register in which function values may be returned.
7559 This flag does not have a negative form, because it specifies a
7561 .Ip "\fB\-fpack-struct\fR" 4
7562 .IX Item "-fpack-struct"
7563 Pack all structure members together without holes. Usually you would
7564 not want to use this option, since it makes the code suboptimal, and
7565 the offsets of structure members won't agree with system libraries.
7566 .Ip "\fB\-fcheck-memory-usage\fR" 4
7567 .IX Item "-fcheck-memory-usage"
7568 Generate extra code to check each memory access. \s-1GCC\s0 will generate
7569 code that is suitable for a detector of bad memory accesses such as
7572 Normally, you should compile all, or none, of your code with this option.
7574 If you do mix code compiled with and without this option,
7575 you must ensure that all code that has side effects
7576 and that is called by code compiled with this option
7577 is, itself, compiled with this option.
7578 If you do not, you might get erroneous messages from the detector.
7580 If you use functions from a library that have side-effects (such as
7581 \&\f(CW\*(C`read\*(C'\fR), you might not be able to recompile the library and
7582 specify this option. In that case, you can enable the
7583 \&\fB\-fprefix-function-name\fR option, which requests \s-1GCC\s0 to encapsulate
7584 your code and make other functions look as if they were compiled with
7585 \&\fB\-fcheck-memory-usage\fR. This is done by calling ``stubs'',
7586 which are provided by the detector. If you cannot find or build
7587 stubs for every function you call, you might have to specify
7588 \&\fB\-fcheck-memory-usage\fR without \fB\-fprefix-function-name\fR.
7590 If you specify this option, you can not use the \f(CW\*(C`asm\*(C'\fR or
7591 \&\f(CW\*(C`_\|_asm_\|_\*(C'\fR keywords in functions with memory checking enabled. \s-1GNU\s0
7592 \&\s-1CC\s0 cannot understand what the \f(CW\*(C`asm\*(C'\fR statement may do, and therefore
7593 cannot generate the appropriate code, so it will reject it. However, if
7594 you specify the function attribute \f(CW\*(C`no_check_memory_usage\*(C'\fR, \s-1GNU\s0 \s-1CC\s0 will disable memory checking within a
7595 function; you may use \f(CW\*(C`asm\*(C'\fR statements inside such functions. You
7596 may have an inline expansion of a non-checked function within a checked
7597 function; in that case \s-1GNU\s0 \s-1CC\s0 will not generate checks for the inlined
7598 function's memory accesses.
7600 If you move your \f(CW\*(C`asm\*(C'\fR statements to non-checked inline functions
7601 and they do access memory, you can add calls to the support code in your
7602 inline function, to indicate any reads, writes, or copies being done.
7603 These calls would be similar to those done in the stubs described above.
7604 .Ip "\fB\-fprefix-function-name\fR" 4
7605 .IX Item "-fprefix-function-name"
7606 Request \s-1GCC\s0 to add a prefix to the symbols generated for function names.
7607 \&\s-1GCC\s0 adds a prefix to the names of functions defined as well as
7608 functions called. Code compiled with this option and code compiled
7609 without the option can't be linked together, unless stubs are used.
7611 If you compile the following code with \fB\-fprefix-function-name\fR
7614 \& extern void bar (int);
7618 \& return bar (a + 5);
7621 \&\s-1GCC\s0 will compile the code as if it was written:
7624 \& extern void prefix_bar (int);
7626 \& prefix_foo (int a)
7628 \& return prefix_bar (a + 5);
7631 This option is designed to be used with \fB\-fcheck-memory-usage\fR.
7632 .Ip "\fB\-finstrument-functions\fR" 4
7633 .IX Item "-finstrument-functions"
7634 Generate instrumentation calls for entry and exit to functions. Just
7635 after function entry and just before function exit, the following
7636 profiling functions will be called with the address of the current
7637 function and its call site. (On some platforms,
7638 \&\f(CW\*(C`_\|_builtin_return_address\*(C'\fR does not work beyond the current
7639 function, so the call site information may not be available to the
7640 profiling functions otherwise.)
7643 \& void __cyg_profile_func_enter (void *this_fn, void *call_site);
7644 \& void __cyg_profile_func_exit (void *this_fn, void *call_site);
7646 The first argument is the address of the start of the current function,
7647 which may be looked up exactly in the symbol table.
7649 This instrumentation is also done for functions expanded inline in other
7650 functions. The profiling calls will indicate where, conceptually, the
7651 inline function is entered and exited. This means that addressable
7652 versions of such functions must be available. If all your uses of a
7653 function are expanded inline, this may mean an additional expansion of
7654 code size. If you use \fBextern inline\fR in your C code, an
7655 addressable version of such functions must be provided. (This is
7656 normally the case anyways, but if you get lucky and the optimizer always
7657 expands the functions inline, you might have gotten away without
7658 providing static copies.)
7660 A function may be given the attribute \f(CW\*(C`no_instrument_function\*(C'\fR, in
7661 which case this instrumentation will not be done. This can be used, for
7662 example, for the profiling functions listed above, high-priority
7663 interrupt routines, and any functions from which the profiling functions
7664 cannot safely be called (perhaps signal handlers, if the profiling
7665 routines generate output or allocate memory).
7666 .Ip "\fB\-fstack-check\fR" 4
7667 .IX Item "-fstack-check"
7668 Generate code to verify that you do not go beyond the boundary of the
7669 stack. You should specify this flag if you are running in an
7670 environment with multiple threads, but only rarely need to specify it in
7671 a single-threaded environment since stack overflow is automatically
7672 detected on nearly all systems if there is only one stack.
7674 Note that this switch does not actually cause checking to be done; the
7675 operating system must do that. The switch causes generation of code
7676 to ensure that the operating system sees the stack being extended.
7677 .Ip "\fB\-fstack-limit-register=\fR\fIreg\fR" 4
7678 .IX Item "-fstack-limit-register=reg"
7680 .Ip "\fB\-fstack-limit-symbol=\fR\fIsym\fR" 4
7681 .IX Item "-fstack-limit-symbol=sym"
7682 .Ip "\fB\-fno-stack-limit\fR" 4
7683 .IX Item "-fno-stack-limit"
7685 Generate code to ensure that the stack does not grow beyond a certain value,
7686 either the value of a register or the address of a symbol. If the stack
7687 would grow beyond the value, a signal is raised. For most targets,
7688 the signal is raised before the stack overruns the boundary, so
7689 it is possible to catch the signal without taking special precautions.
7691 For instance, if the stack starts at address \fB0x80000000\fR and grows
7692 downwards you can use the flags
7693 \&\fB\-fstack-limit-symbol=_\|_stack_limit\fR
7694 \&\fB\-Wl,\-\-defsym,_\|_stack_limit=0x7ffe0000\fR which will enforce a stack
7696 .Ip "\fB\-fargument-alias\fR" 4
7697 .IX Item "-fargument-alias"
7699 .Ip "\fB\-fargument-noalias\fR" 4
7700 .IX Item "-fargument-noalias"
7701 .Ip "\fB\-fargument-noalias-global\fR" 4
7702 .IX Item "-fargument-noalias-global"
7704 Specify the possible relationships among parameters and between
7705 parameters and global data.
7707 \&\fB\-fargument-alias\fR specifies that arguments (parameters) may
7708 alias each other and may alias global storage.
7709 \&\fB\-fargument-noalias\fR specifies that arguments do not alias
7710 each other, but may alias global storage.
7711 \&\fB\-fargument-noalias-global\fR specifies that arguments do not
7712 alias each other and do not alias global storage.
7714 Each language will automatically use whatever option is required by
7715 the language standard. You should not need to use these options yourself.
7716 .Ip "\fB\-fleading-underscore\fR" 4
7717 .IX Item "-fleading-underscore"
7718 This option and its counterpart, \-fno-leading-underscore, forcibly
7719 change the way C symbols are represented in the object file. One use
7720 is to help link with legacy assembly code.
7722 Be warned that you should know what you are doing when invoking this
7723 option, and that not all targets provide complete support for it.
7725 .IX Header "ENVIRONMENT"
7726 This section describes several environment variables that affect how \s-1GCC\s0
7727 operates. Some of them work by specifying directories or prefixes to use
7728 when searching for various kinds of files. Some are used to specify other
7729 aspects of the compilation environment.
7731 Note that you can also specify places to search using options such as
7732 \&\fB\-B\fR, \fB\-I\fR and \fB\-L\fR. These
7733 take precedence over places specified using environment variables, which
7734 in turn take precedence over those specified by the configuration of \s-1GCC\s0.
7735 .Ip "\fB\s-1LANG\s0\fR" 4
7738 .Ip "\fB\s-1LC_CTYPE\s0\fR" 4
7740 .Ip "\fB\s-1LC_MESSAGES\s0\fR" 4
7741 .IX Item "LC_MESSAGES"
7742 .Ip "\fB\s-1LC_ALL\s0\fR" 4
7745 These environment variables control the way that \s-1GCC\s0 uses
7746 localization information that allow \s-1GCC\s0 to work with different
7747 national conventions. \s-1GCC\s0 inspects the locale categories
7748 \&\fB\s-1LC_CTYPE\s0\fR and \fB\s-1LC_MESSAGES\s0\fR if it has been configured to do
7749 so. These locale categories can be set to any value supported by your
7750 installation. A typical value is \fBen_UK\fR for English in the United
7753 The \fB\s-1LC_CTYPE\s0\fR environment variable specifies character
7754 classification. \s-1GCC\s0 uses it to determine the character boundaries in
7755 a string; this is needed for some multibyte encodings that contain quote
7756 and escape characters that would otherwise be interpreted as a string
7759 The \fB\s-1LC_MESSAGES\s0\fR environment variable specifies the language to
7760 use in diagnostic messages.
7762 If the \fB\s-1LC_ALL\s0\fR environment variable is set, it overrides the value
7763 of \fB\s-1LC_CTYPE\s0\fR and \fB\s-1LC_MESSAGES\s0\fR; otherwise, \fB\s-1LC_CTYPE\s0\fR
7764 and \fB\s-1LC_MESSAGES\s0\fR default to the value of the \fB\s-1LANG\s0\fR
7765 environment variable. If none of these variables are set, \s-1GCC\s0
7766 defaults to traditional C English behavior.
7767 .Ip "\fB\s-1TMPDIR\s0\fR" 4
7769 If \fB\s-1TMPDIR\s0\fR is set, it specifies the directory to use for temporary
7770 files. \s-1GCC\s0 uses temporary files to hold the output of one stage of
7771 compilation which is to be used as input to the next stage: for example,
7772 the output of the preprocessor, which is the input to the compiler
7774 .Ip "\fB\s-1GCC_EXEC_PREFIX\s0\fR" 4
7775 .IX Item "GCC_EXEC_PREFIX"
7776 If \fB\s-1GCC_EXEC_PREFIX\s0\fR is set, it specifies a prefix to use in the
7777 names of the subprograms executed by the compiler. No slash is added
7778 when this prefix is combined with the name of a subprogram, but you can
7779 specify a prefix that ends with a slash if you wish.
7781 If \fB\s-1GCC_EXEC_PREFIX\s0\fR is not set, \s-1GNU\s0 \s-1CC\s0 will attempt to figure out
7782 an appropriate prefix to use based on the pathname it was invoked with.
7784 If \s-1GCC\s0 cannot find the subprogram using the specified prefix, it
7785 tries looking in the usual places for the subprogram.
7787 The default value of \fB\s-1GCC_EXEC_PREFIX\s0\fR is
7788 \&\fI\fIprefix\fI/lib/gcc-lib/\fR where \fIprefix\fR is the value
7789 of \f(CW\*(C`prefix\*(C'\fR when you ran the \fIconfigure\fR script.
7791 Other prefixes specified with \fB\-B\fR take precedence over this prefix.
7793 This prefix is also used for finding files such as \fIcrt0.o\fR that are
7796 In addition, the prefix is used in an unusual way in finding the
7797 directories to search for header files. For each of the standard
7798 directories whose name normally begins with \fB/usr/local/lib/gcc-lib\fR
7799 (more precisely, with the value of \fB\s-1GCC_INCLUDE_DIR\s0\fR), \s-1GCC\s0 tries
7800 replacing that beginning with the specified prefix to produce an
7801 alternate directory name. Thus, with \fB\-Bfoo/\fR, \s-1GCC\s0 will search
7802 \&\fIfoo/bar\fR where it would normally search \fI/usr/local/lib/bar\fR.
7803 These alternate directories are searched first; the standard directories
7805 .Ip "\fB\s-1COMPILER_PATH\s0\fR" 4
7806 .IX Item "COMPILER_PATH"
7807 The value of \fB\s-1COMPILER_PATH\s0\fR is a colon-separated list of
7808 directories, much like \fB\s-1PATH\s0\fR. \s-1GCC\s0 tries the directories thus
7809 specified when searching for subprograms, if it can't find the
7810 subprograms using \fB\s-1GCC_EXEC_PREFIX\s0\fR.
7811 .Ip "\fB\s-1LIBRARY_PATH\s0\fR" 4
7812 .IX Item "LIBRARY_PATH"
7813 The value of \fB\s-1LIBRARY_PATH\s0\fR is a colon-separated list of
7814 directories, much like \fB\s-1PATH\s0\fR. When configured as a native compiler,
7815 \&\s-1GCC\s0 tries the directories thus specified when searching for special
7816 linker files, if it can't find them using \fB\s-1GCC_EXEC_PREFIX\s0\fR. Linking
7817 using \s-1GCC\s0 also uses these directories when searching for ordinary
7818 libraries for the \fB\-l\fR option (but directories specified with
7819 \&\fB\-L\fR come first).
7820 .Ip "\fBC_INCLUDE_PATH\fR" 4
7821 .IX Item "C_INCLUDE_PATH"
7823 .Ip "\fB\s-1CPLUS_INCLUDE_PATH\s0\fR" 4
7824 .IX Item "CPLUS_INCLUDE_PATH"
7825 .Ip "\fB\s-1OBJC_INCLUDE_PATH\s0\fR" 4
7826 .IX Item "OBJC_INCLUDE_PATH"
7828 These environment variables pertain to particular languages. Each
7829 variable's value is a colon-separated list of directories, much like
7830 \&\fB\s-1PATH\s0\fR. When \s-1GCC\s0 searches for header files, it tries the
7831 directories listed in the variable for the language you are using, after
7832 the directories specified with \fB\-I\fR but before the standard header
7834 .Ip "\fB\s-1DEPENDENCIES_OUTPUT\s0\fR" 4
7835 .IX Item "DEPENDENCIES_OUTPUT"
7836 If this variable is set, its value specifies how to output dependencies
7837 for Make based on the header files processed by the compiler. This
7838 output looks much like the output from the \fB\-M\fR option, but it goes to a separate file, and is
7839 in addition to the usual results of compilation.
7841 The value of \fB\s-1DEPENDENCIES_OUTPUT\s0\fR can be just a file name, in
7842 which case the Make rules are written to that file, guessing the target
7843 name from the source file name. Or the value can have the form
7844 \&\fIfile\fR\fB \fR\fItarget\fR, in which case the rules are written to
7845 file \fIfile\fR using \fItarget\fR as the target name.
7846 .Ip "\fB\s-1LANG\s0\fR" 4
7848 This variable is used to pass locale information to the compiler. One way in
7849 which this information is used is to determine the character set to be used
7850 when character literals, string literals and comments are parsed in C and \*(C+.
7851 When the compiler is configured to allow multibyte characters,
7852 the following values for \fB\s-1LANG\s0\fR are recognized:
7856 Recognize \s-1JIS\s0 characters.
7857 .Ip "\fBC-SJIS\fR" 4
7859 Recognize \s-1SJIS\s0 characters.
7860 .Ip "\fBC-EUCJP\fR" 4
7862 Recognize \s-1EUCJP\s0 characters.
7866 If \fB\s-1LANG\s0\fR is not defined, or if it has some other value, then the
7867 compiler will use mblen and mbtowc as defined by the default locale to
7868 recognize and translate multibyte characters.
7872 For instructions on reporting bugs, see
7873 <\fBhttp://gcc.gnu.org/bugs.html\fR>. Use of the \fBgccbug\fR
7874 script to report bugs is recommended.
7876 .IX Header "FOOTNOTES"
7878 On some systems, \fBgcc \-shared\fR
7879 needs to build supplementary stub code for constructors to work. On
7880 multi-libbed systems, \fBgcc \-shared\fR must select the correct support
7881 libraries to link against. Failing to supply the correct flags may lead
7882 to subtle defects. Supplying them in cases where they are not necessary
7885 .IX Header "SEE ALSO"
7886 \&\fIcpp\fR\|(1), \fIgcov\fR\|(1), \fIg77\fR\|(1), \fIas\fR\|(1), \fIld\fR\|(1), \fIgdb\fR\|(1), \fIadb\fR\|(1), \fIdbx\fR\|(1), \fIsdb\fR\|(1)
7887 and the Info entries for \fIgcc\fR, \fIcpp\fR, \fIg77\fR, \fIas\fR,
7888 \&\fIld\fR, \fIbinutils\fR and \fIgdb\fR.
7891 See the Info entry for \fIgcc\fR, or
7892 <\fBhttp://gcc.gnu.org/thanks.html\fR>, for contributors to \s-1GCC\s0.
7894 .IX Header "COPYRIGHT"
7895 Copyright (c) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
7896 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
7898 Permission is granted to make and distribute verbatim copies of this
7899 manual provided the copyright notice and this permission notice are
7900 preserved on all copies.
7902 Permission is granted to copy and distribute modified versions of this
7903 manual under the conditions for verbatim copying, provided also that the
7904 entire resulting derived work is distributed under the terms of a
7905 permission notice identical to this one.
7907 Permission is granted to copy and distribute translations of this manual
7908 into another language, under the above conditions for modified versions,
7909 except that this permission notice may be included in translations
7910 approved by the Free Software Foundation instead of in the original