]> gcc.gnu.org Git - gcc.git/blame - gcc/doc/invoke.texi
cfgcleanup.c (try_forward_edges): Avoid infinite loop at infinite threaded loop.
[gcc.git] / gcc / doc / invoke.texi
CommitLineData
d0a5eb32 1@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4dd57c18 2@c 2000, 2001, 2002 Free Software Foundation, Inc.
74291a4b
MM
3@c This is part of the GCC manual.
4@c For copying conditions, see the file gcc.texi.
5
9d86bffc
JM
6@ignore
7@c man begin COPYRIGHT
8Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
4dd57c18 91998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
9d86bffc 10
77bd67cb
JM
11Permission is granted to copy, distribute and/or modify this document
12under the terms of the GNU Free Documentation License, Version 1.1 or
13any later version published by the Free Software Foundation; with the
14Invariant Sections being ``GNU General Public License'' and ``Funding
15Free Software'', the Front-Cover texts being (a) (see below), and with
16the Back-Cover Texts being (b) (see below). A copy of the license is
17included in the gfdl(7) man page.
9d86bffc 18
77bd67cb 19(a) The FSF's Front-Cover Text is:
9d86bffc 20
77bd67cb
JM
21 A GNU Manual
22
23(b) The FSF's Back-Cover Text is:
24
25 You have freedom to copy and modify this GNU Manual, like GNU
26 software. Copies published by the Free Software Foundation raise
27 funds for GNU development.
9d86bffc
JM
28@c man end
29@c Set file name and title for the man page.
30@setfilename gcc
31@settitle GNU project C and C++ compiler
32@c man begin SYNOPSIS
630d3d5a
JM
33gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
34 [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
35 [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
36 [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
37 [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
38 [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
39 [@option{-o} @var{outfile}] @var{infile}@dots{}
9d86bffc
JM
40
41Only the most useful options are listed here; see below for the
42remainder. @samp{g++} accepts mostly the same options as @samp{gcc}.
43@c man end
44@c man begin SEEALSO
77bd67cb 45gpl(7), gfdl(7), fsf-funding(7),
9d86bffc
JM
46cpp(1), gcov(1), g77(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
47and the Info entries for @file{gcc}, @file{cpp}, @file{g77}, @file{as},
48@file{ld}, @file{binutils} and @file{gdb}.
49@c man end
2642624b
JM
50@c man begin BUGS
51For instructions on reporting bugs, see
bedc7537 52@w{@uref{http://gcc.gnu.org/bugs.html}}. Use of the @command{gccbug}
2642624b
JM
53script to report bugs is recommended.
54@c man end
55@c man begin AUTHOR
24dbb440
GP
56See the Info entry for @command{gcc}, or
57@w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
58for contributors to GCC@.
2642624b 59@c man end
9d86bffc
JM
60@end ignore
61
74291a4b 62@node Invoking GCC
0c2d1a2a
JB
63@chapter GCC Command Options
64@cindex GCC command options
74291a4b 65@cindex command options
0c2d1a2a 66@cindex options, GCC command
74291a4b 67
9d86bffc
JM
68@c man begin DESCRIPTION
69
0c2d1a2a 70When you invoke GCC, it normally does preprocessing, compilation,
74291a4b 71assembly and linking. The ``overall options'' allow you to stop this
630d3d5a 72process at an intermediate stage. For example, the @option{-c} option
74291a4b
MM
73says not to run the linker. Then the output consists of object files
74output by the assembler.
75
76Other options are passed on to one stage of processing. Some options
77control the preprocessor and others the compiler itself. Yet other
78options control the assembler and linker; most of these are not
79documented here, since you rarely need to use any of them.
80
81@cindex C compilation options
0c2d1a2a 82Most of the command line options that you can use with GCC are useful
74291a4b
MM
83for C programs; when an option is only useful with another language
84(usually C++), the explanation says so explicitly. If the description
85for a particular option does not mention a source language, you can use
86that option with all supported languages.
87
88@cindex C++ compilation options
89@xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
90options for compiling C++ programs.
91
92@cindex grouping options
93@cindex options, grouping
bedc7537 94The @command{gcc} program accepts options and file names as operands. Many
b192711e 95options have multi-letter names; therefore multiple single-letter options
630d3d5a 96may @emph{not} be grouped: @option{-dr} is very different from @w{@samp{-d
74291a4b
MM
97-r}}.
98
99@cindex order of options
100@cindex options, order
101You can mix options and other arguments. For the most part, the order
102you use doesn't matter. Order does matter when you use several options
630d3d5a 103of the same kind; for example, if you specify @option{-L} more than once,
74291a4b
MM
104the directories are searched in the order specified.
105
106Many options have long names starting with @samp{-f} or with
630d3d5a
JM
107@samp{-W}---for example, @option{-fforce-mem},
108@option{-fstrength-reduce}, @option{-Wformat} and so on. Most of
74291a4b 109these have both positive and negative forms; the negative form of
630d3d5a 110@option{-ffoo} would be @option{-fno-foo}. This manual documents
74291a4b
MM
111only one of these two forms, whichever one is not the default.
112
9d86bffc
JM
113@c man end
114
cd3bb277
JM
115@xref{Option Index}, for an index to GCC's options.
116
74291a4b
MM
117@menu
118* Option Summary:: Brief list of all options, without explanations.
119* Overall Options:: Controlling the kind of output:
120 an executable, object files, assembler files,
121 or preprocessed source.
122* Invoking G++:: Compiling C++ programs.
123* C Dialect Options:: Controlling the variant of C language compiled.
124* C++ Dialect Options:: Variations on C++.
60de6385 125* Objective-C Dialect Options:: Variations on Objective-C.
764dbbf2 126* Language Independent Options:: Controlling how diagnostics should be
02f52e19 127 formatted.
74291a4b
MM
128* Warning Options:: How picky should the compiler be?
129* Debugging Options:: Symbol tables, measurements, and debugging dumps.
130* Optimize Options:: How much optimization?
131* Preprocessor Options:: Controlling header files and macro definitions.
132 Also, getting dependency information for Make.
133* Assembler Options:: Passing options to the assembler.
134* Link Options:: Specifying libraries and so on.
135* Directory Options:: Where to find header files and libraries.
136 Where to find the compiler executable files.
a743d340 137* Spec Files:: How to pass switches to sub-processes.
0c2d1a2a 138* Target Options:: Running a cross-compiler, or an old version of GCC.
74291a4b
MM
139* Submodel Options:: Specifying minor hardware or convention variations,
140 such as 68010 vs 68020.
141* Code Gen Options:: Specifying conventions for function calls, data layout
142 and register usage.
0c2d1a2a 143* Environment Variables:: Env vars that affect GCC.
74291a4b
MM
144* Running Protoize:: Automatically adding or removing function prototypes.
145@end menu
146
4bc1997b
JM
147@c man begin OPTIONS
148
74291a4b
MM
149@node Option Summary
150@section Option Summary
151
152Here is a summary of all the options, grouped by type. Explanations are
153in the following sections.
154
155@table @emph
156@item Overall Options
157@xref{Overall Options,,Options Controlling the Kind of Output}.
4bc1997b
JM
158@gccoptlist{
159-c -S -E -o @var{file} -pipe -pass-exit-codes -x @var{language} @gol
160-v --target-help --help}
74291a4b
MM
161
162@item C Language Options
163@xref{C Dialect Options,,Options Controlling C Dialect}.
4bc1997b 164@gccoptlist{
b1018de6 165-ansi -std=@var{standard} -aux-info @var{filename} @gol
7d14c755 166-fno-asm -fno-builtin -fno-builtin-@var{function} @gol
4bc1997b
JM
167-fhosted -ffreestanding @gol
168-trigraphs -traditional -traditional-cpp @gol
169-fallow-single-precision -fcond-mismatch @gol
170-fsigned-bitfields -fsigned-char @gol
171-funsigned-bitfields -funsigned-char @gol
172-fwritable-strings -fshort-wchar}
74291a4b
MM
173
174@item C++ Language Options
175@xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
4bc1997b
JM
176@gccoptlist{
177-fno-access-control -fcheck-new -fconserve-space @gol
aa0cc562
JM
178-fno-const-strings -fdollars-in-identifiers @gol
179-fno-elide-constructors @gol
4bc1997b
JM
180-fno-enforce-eh-specs -fexternal-templates @gol
181-falt-external-templates @gol
1dbb6023 182-ffor-scope -fno-for-scope -fno-gnu-keywords @gol
90ecce3e 183-fno-implicit-templates @gol
4bc1997b
JM
184-fno-implicit-inline-templates @gol
185-fno-implement-inlines -fms-extensions @gol
aa0cc562 186-fno-nonansi-builtins -fno-operator-names @gol
4bc1997b 187-fno-optional-diags -fpermissive @gol
aa0cc562 188-frepo -fno-rtti -fstats -ftemplate-depth-@var{n} @gol
90ecce3e 189-fuse-cxa-atexit -fvtable-gc -fno-weak -nostdinc++ @gol
4bc1997b
JM
190-fno-default-inline -Wctor-dtor-privacy @gol
191-Wnon-virtual-dtor -Wreorder @gol
192-Weffc++ -Wno-deprecated @gol
193-Wno-non-template-friend -Wold-style-cast @gol
194-Woverloaded-virtual -Wno-pmf-conversions @gol
195-Wsign-promo -Wsynth}
74291a4b 196
60de6385
SS
197@item Objective-C Language Options
198@xref{Objective-C Dialect Options,,Options Controlling Objective-C Dialect}.
199@gccoptlist{
630d3d5a 200-fconstant-string-class=@var{class-name} @gol
310668e8 201-fgnu-runtime -fnext-runtime -gen-decls @gol
60de6385
SS
202-Wno-protocol -Wselector}
203
764dbbf2
GDR
204@item Language Independent Options
205@xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
4bc1997b
JM
206@gccoptlist{
207-fmessage-length=@var{n} @gol
208-fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}}
764dbbf2 209
74291a4b
MM
210@item Warning Options
211@xref{Warning Options,,Options to Request or Suppress Warnings}.
4bc1997b
JM
212@gccoptlist{
213-fsyntax-only -pedantic -pedantic-errors @gol
214-w -W -Wall -Waggregate-return @gol
215-Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment @gol
e23bd218
IR
216-Wconversion -Wno-deprecated-declarations @gol
217-Wdisabled-optimization -Wdiv-by-zero -Werror @gol
4bc1997b 218-Wfloat-equal -Wformat -Wformat=2 @gol
feb48bde
JM
219-Wformat-nonliteral -Wformat-security @gol
220-Wimplicit -Wimplicit-int @gol
4bc1997b
JM
221-Wimplicit-function-declaration @gol
222-Werror-implicit-function-declaration @gol
223-Wimport -Winline @gol
224-Wlarger-than-@var{len} -Wlong-long @gol
1f0c3120 225-Wmain -Wmissing-braces -Wmissing-declarations @gol
4bc1997b 226-Wmissing-format-attribute -Wmissing-noreturn @gol
feb48bde 227-Wmultichar -Wno-format-extra-args -Wno-format-y2k @gol
4bc1997b 228-Wno-import -Wpacked -Wpadded @gol
310668e8 229-Wparentheses -Wpointer-arith -Wredundant-decls @gol
4bc1997b
JM
230-Wreturn-type -Wsequence-point -Wshadow @gol
231-Wsign-compare -Wswitch -Wsystem-headers @gol
232-Wtrigraphs -Wundef -Wuninitialized @gol
233-Wunknown-pragmas -Wunreachable-code @gol
234-Wunused -Wunused-function -Wunused-label -Wunused-parameter @gol
235-Wunused-value -Wunused-variable -Wwrite-strings}
74291a4b 236
fe50c0eb 237@item C-only Warning Options
4bc1997b 238@gccoptlist{
310668e8
JM
239-Wbad-function-cast -Wmissing-prototypes -Wnested-externs @gol
240-Wstrict-prototypes -Wtraditional}
fe50c0eb 241
74291a4b
MM
242@item Debugging Options
243@xref{Debugging Options,,Options for Debugging Your Program or GCC}.
4bc1997b 244@gccoptlist{
8456b95a 245-d@var{letters} -dumpspecs -dumpmachine -dumpversion @gol
92989aed 246-fdump-unnumbered
aee96fe9 247-fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
22367161
NS
248-fdump-tree-original@r{[}-@var{n}@r{]} -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
249-fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
e76b4820 250-fmem-report -fpretend-float @gol
1f0c3120 251-fprofile-arcs -ftest-coverage -ftime-report @gol
4bc1997b 252-g -g@var{level} -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2 @gol
5f98259a 253-ggdb -gstabs -gstabs+ -gvms -gxcoff -gxcoff+ @gol
4bc1997b 254-p -pg -print-file-name=@var{library} -print-libgcc-file-name @gol
b1018de6 255-print-multi-directory -print-multi-lib @gol
4bc1997b
JM
256-print-prog-name=@var{program} -print-search-dirs -Q @gol
257-save-temps -time}
74291a4b
MM
258
259@item Optimization Options
260@xref{Optimize Options,,Options that Control Optimization}.
4bc1997b
JM
261@gccoptlist{
262-falign-functions=@var{n} -falign-jumps=@var{n} @gol
263-falign-labels=@var{n} -falign-loops=@var{n} @gol
8582c27b 264-fbranch-probabilities -fcaller-saves -fcprop-registers @gol
62d285ff 265-fcse-follow-jumps -fcse-skip-blocks -fdata-sections @gol
4bc1997b
JM
266-fdelayed-branch -fdelete-null-pointer-checks @gol
267-fexpensive-optimizations -ffast-math -ffloat-store @gol
feb48bde
JM
268-fforce-addr -fforce-mem -ffunction-sections @gol
269-fgcse -fgcse-lm -fgcse-sm @gol
4bc1997b 270-finline-functions -finline-limit=@var{n} -fkeep-inline-functions @gol
201556f0
JJ
271-fkeep-static-consts -fmerge-constants -fmerge-all-constants @gol
272-fmove-all-movables -fno-default-inline -fno-defer-pop @gol
feb48bde 273-fno-function-cse -fno-guess-branch-probability @gol
6cfc0341 274-fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
de6c5979 275-funsafe-math-optimizations -fno-trapping-math @gol
4bc1997b 276-fomit-frame-pointer -foptimize-register-move @gol
5d22c1a5
JM
277-foptimize-sibling-calls -fprefetch-loop-arrays @gol
278-freduce-all-givs -fregmove -frename-registers @gol
4bc1997b
JM
279-frerun-cse-after-loop -frerun-loop-opt @gol
280-fschedule-insns -fschedule-insns2 @gol
0b47e4c1 281-fsingle-precision-constant -fssa -fssa-ccp -fssa-dce @gol
4bc1997b 282-fstrength-reduce -fstrict-aliasing -fthread-jumps -ftrapv @gol
86be733d 283-funroll-all-loops -funroll-loops @gol
3af64fd6 284--param @var{name}=@var{value}
4bc1997b 285-O -O0 -O1 -O2 -O3 -Os}
74291a4b
MM
286
287@item Preprocessor Options
288@xref{Preprocessor Options,,Options Controlling the Preprocessor}.
4bc1997b
JM
289@gccoptlist{
290-$ -A@var{question}=@var{answer} -A-@var{question}@r{[}=@var{answer}@r{]} @gol
291-C -dD -dI -dM -dN @gol
292-D@var{macro}@r{[}=@var{defn}@r{]} -E -H @gol
293-idirafter @var{dir} @gol
294-include @var{file} -imacros @var{file} @gol
295-iprefix @var{file} -iwithprefix @var{dir} @gol
bdd42dd9 296-iwithprefixbefore @var{dir} -isystem @var{dir} @gol
4bc1997b 297-M -MM -MF -MG -MP -MQ -MT -nostdinc -P -remap @gol
aee96fe9 298-trigraphs -undef -U@var{macro} -Wp,@var{option}}
74291a4b
MM
299
300@item Assembler Option
301@xref{Assembler Options,,Passing Options to the Assembler}.
4bc1997b 302@gccoptlist{
aee96fe9 303-Wa,@var{option}}
74291a4b
MM
304
305@item Linker Options
306@xref{Link Options,,Options for Linking}.
4bc1997b
JM
307@gccoptlist{
308@var{object-file-name} -l@var{library} @gol
309-nostartfiles -nodefaultlibs -nostdlib @gol
310-s -static -static-libgcc -shared -shared-libgcc -symbolic @gol
aee96fe9 311-Wl,@var{option} -Xlinker @var{option} @gol
4bc1997b 312-u @var{symbol}}
74291a4b
MM
313
314@item Directory Options
315@xref{Directory Options,,Options for Directory Search}.
4bc1997b
JM
316@gccoptlist{
317-B@var{prefix} -I@var{dir} -I- -L@var{dir} -specs=@var{file}}
74291a4b
MM
318
319@item Target Options
320@c I wrote this xref this way to avoid overfull hbox. -- rms
321@xref{Target Options}.
4bc1997b
JM
322@gccoptlist{
323-b @var{machine} -V @var{version}}
74291a4b
MM
324
325@item Machine Dependent Options
326@xref{Submodel Options,,Hardware Models and Configurations}.
5d22c1a5 327
74291a4b 328@emph{M680x0 Options}
4bc1997b
JM
329@gccoptlist{
330-m68000 -m68020 -m68020-40 -m68020-60 -m68030 -m68040 @gol
feb48bde 331-m68060 -mcpu32 -m5200 -m68881 -mbitfield -mc68000 -mc68020 @gol
310668e8
JM
332-mfpa -mnobitfield -mrtd -mshort -msoft-float -mpcrel @gol
333-malign-int -mstrict-align}
74291a4b 334
2856c3e3 335@emph{M68hc1x Options}
4bc1997b
JM
336@gccoptlist{
337-m6811 -m6812 -m68hc11 -m68hc12 @gol
338-mauto-incdec -mshort -msoft-reg-count=@var{count}}
2856c3e3 339
74291a4b 340@emph{VAX Options}
4bc1997b
JM
341@gccoptlist{
342-mg -mgnu -munix}
74291a4b
MM
343
344@emph{SPARC Options}
4bc1997b 345@gccoptlist{
630d3d5a
JM
346-mcpu=@var{cpu-type} @gol
347-mtune=@var{cpu-type} @gol
348-mcmodel=@var{code-model} @gol
4bc1997b
JM
349-m32 -m64 @gol
350-mapp-regs -mbroken-saverestore -mcypress @gol
feb48bde 351-mepilogue -mfaster-structs -mflat @gol
4bc1997b
JM
352-mfpu -mhard-float -mhard-quad-float @gol
353-mimpure-text -mlive-g0 -mno-app-regs @gol
310668e8
JM
354-mno-epilogue -mno-faster-structs -mno-flat -mno-fpu @gol
355-mno-impure-text -mno-stack-bias -mno-unaligned-doubles @gol
4bc1997b
JM
356-msoft-float -msoft-quad-float -msparclite -mstack-bias @gol
357-msupersparc -munaligned-doubles -mv8}
74291a4b
MM
358
359@emph{Convex Options}
4bc1997b
JM
360@gccoptlist{
361-mc1 -mc2 -mc32 -mc34 -mc38 @gol
362-margcount -mnoargcount @gol
363-mlong32 -mlong64 @gol
364-mvolatile-cache -mvolatile-nocache}
74291a4b
MM
365
366@emph{AMD29K Options}
4bc1997b
JM
367@gccoptlist{
368-m29000 -m29050 -mbw -mnbw -mdw -mndw @gol
369-mlarge -mnormal -msmall @gol
370-mkernel-registers -mno-reuse-arg-regs @gol
371-mno-stack-check -mno-storem-bug @gol
372-mreuse-arg-regs -msoft-float -mstack-check @gol
373-mstorem-bug -muser-registers}
74291a4b
MM
374
375@emph{ARM Options}
4bc1997b 376@gccoptlist{
310668e8
JM
377-mapcs-frame -mno-apcs-frame @gol
378-mapcs-26 -mapcs-32 @gol
379-mapcs-stack-check -mno-apcs-stack-check @gol
380-mapcs-float -mno-apcs-float @gol
381-mapcs-reentrant -mno-apcs-reentrant @gol
382-msched-prolog -mno-sched-prolog @gol
383-mlittle-endian -mbig-endian -mwords-little-endian @gol
384-malignment-traps -mno-alignment-traps @gol
385-msoft-float -mhard-float -mfpe @gol
386-mthumb-interwork -mno-thumb-interwork @gol
387-mcpu=@var{name} -march=@var{name} -mfpe=@var{name} @gol
247f8561 388-mstructure-size-boundary=@var{n} @gol
310668e8 389-mbsd -mxopen -mno-symrename @gol
4bc1997b 390-mabort-on-noreturn @gol
310668e8
JM
391-mlong-calls -mno-long-calls @gol
392-msingle-pic-base -mno-single-pic-base @gol
247f8561
PB
393-mpic-register=@var{reg} @gol
394-mnop-fun-dllimport @gol
395-mpoke-function-name @gol
310668e8
JM
396-mthumb -marm @gol
397-mtpcs-frame -mtpcs-leaf-frame @gol
398-mcaller-super-interworking -mcallee-super-interworking }
74291a4b 399
ecff22ab 400@emph{MN10200 Options}
4bc1997b
JM
401@gccoptlist{
402-mrelax}
ecff22ab 403
6d6d0fa0 404@emph{MN10300 Options}
4bc1997b 405@gccoptlist{
c474f76b
AO
406-mmult-bug -mno-mult-bug @gol
407-mam33 -mno-am33 @gol
408-mno-crt0 -mrelax}
6d6d0fa0 409
861bb6c1 410@emph{M32R/D Options}
4bc1997b 411@gccoptlist{
98180123 412-m32rx -m32r -mcode-model=@var{model-type} -msdata=@var{sdata-type} @gol
4bc1997b 413-G @var{num}}
861bb6c1 414
74291a4b 415@emph{M88K Options}
4bc1997b
JM
416@gccoptlist{
417-m88000 -m88100 -m88110 -mbig-pic @gol
418-mcheck-zero-division -mhandle-large-shift @gol
419-midentify-revision -mno-check-zero-division @gol
420-mno-ocs-debug-info -mno-ocs-frame-position @gol
421-mno-optimize-arg-area -mno-serialize-volatile @gol
422-mno-underscores -mocs-debug-info @gol
423-mocs-frame-position -moptimize-arg-area @gol
424-mserialize-volatile -mshort-data-@var{num} -msvr3 @gol
425-msvr4 -mtrap-large-shift -muse-div-instruction @gol
426-mversion-03.00 -mwarn-passed-structs}
74291a4b
MM
427
428@emph{RS/6000 and PowerPC Options}
4bc1997b 429@gccoptlist{
630d3d5a
JM
430-mcpu=@var{cpu-type} @gol
431-mtune=@var{cpu-type} @gol
4bc1997b
JM
432-mpower -mno-power -mpower2 -mno-power2 @gol
433-mpowerpc -mpowerpc64 -mno-powerpc @gol
0ac081f6 434-maltivec -mno-altivec @gol
4bc1997b
JM
435-mpowerpc-gpopt -mno-powerpc-gpopt @gol
436-mpowerpc-gfxopt -mno-powerpc-gfxopt @gol
437-mnew-mnemonics -mold-mnemonics @gol
438-mfull-toc -mminimal-toc -mno-fop-in-toc -mno-sum-in-toc @gol
0a379b7a 439-m64 -m32 -mxl-call -mno-xl-call -mpe @gol
4bc1997b
JM
440-msoft-float -mhard-float -mmultiple -mno-multiple @gol
441-mstring -mno-string -mupdate -mno-update @gol
442-mfused-madd -mno-fused-madd -mbit-align -mno-bit-align @gol
443-mstrict-align -mno-strict-align -mrelocatable @gol
444-mno-relocatable -mrelocatable-lib -mno-relocatable-lib @gol
445-mtoc -mno-toc -mlittle -mlittle-endian -mbig -mbig-endian @gol
9c34dbbf 446-mcall-aix -mcall-sysv -mcall-netbsd @gol
9904592e 447-maix-struct-return -msvr4-struct-return
0ac081f6 448-mabi=altivec @gol
9c34dbbf 449-mprototype -mno-prototype @gol
4bc1997b 450-msim -mmvme -mads -myellowknife -memb -msdata @gol
0a379b7a 451-msdata=@var{opt} -mvxworks -G @var{num} -pthread}
74291a4b
MM
452
453@emph{RT Options}
4bc1997b
JM
454@gccoptlist{
455-mcall-lib-mul -mfp-arg-in-fpregs -mfp-arg-in-gregs @gol
456-mfull-fp-blocks -mhc-struct-return -min-line-mul @gol
457-mminimum-fp-blocks -mnohc-struct-return}
74291a4b
MM
458
459@emph{MIPS Options}
4bc1997b 460@gccoptlist{
7dac2f89
EC
461-mabicalls -march=@var{cpu-type} -mtune=@var{cpu=type} @gol
462-mcpu=@var{cpu-type} -membedded-data -muninit-const-in-rodata @gol
13fac94a
GK
463-membedded-pic -mfp32 -mfp64 -mfused-madd -mno-fused-madd @gol
464-mgas -mgp32 -mgp64 @gol
4bc1997b 465-mgpopt -mhalf-pic -mhard-float -mint64 -mips1 @gol
feb48bde 466-mips2 -mips3 -mips4 -mlong64 -mlong32 -mlong-calls -mmemcpy @gol
4bc1997b 467-mmips-as -mmips-tfile -mno-abicalls @gol
feb48bde
JM
468-mno-embedded-data -mno-uninit-const-in-rodata @gol
469-mno-embedded-pic -mno-gpopt -mno-long-calls @gol
4bc1997b
JM
470-mno-memcpy -mno-mips-tfile -mno-rnames -mno-stats @gol
471-mrnames -msoft-float @gol
472-m4650 -msingle-float -mmad @gol
473-mstats -EL -EB -G @var{num} -nocpp @gol
feb48bde 474-mabi=32 -mabi=n32 -mabi=64 -mabi=eabi @gol
d490e8ad 475-mfix7000 -mno-crt0 -mflush-func=@var{func} -mno-flush-func}
74291a4b 476
14f73b5a 477@emph{i386 and x86-64 Options}
4bc1997b 478@gccoptlist{
965f5423 479-mcpu=@var{cpu-type} -march=@var{cpu-type} -mfpmath=@var{unit} @gol
c93e80a5 480-masm=@var{dialect} -mno-fancy-math-387 @gol
4bc1997b
JM
481-mno-fp-ret-in-387 -msoft-float -msvr3-shlib @gol
482-mno-wide-multiply -mrtd -malign-double @gol
3e18fdf6 483-mpreferred-stack-boundary=@var{num} @gol
965f5423 484-mmmx -msse -msse2 -msse-math -m3dnow @gol
feb48bde
JM
485-mthreads -mno-align-stringops -minline-all-stringops @gol
486-mpush-args -maccumulate-outgoing-args -m128bit-long-double @gol
14f73b5a
JH
487-m96bit-long-double -mregparm=@var{num} -momit-leaf-frame-pointer @gol
488-mno-red-zone@gol
489-m32 -m64}
74291a4b
MM
490
491@emph{HPPA Options}
4bc1997b 492@gccoptlist{
630d3d5a 493-march=@var{architecture-type} @gol
feb48bde
JM
494-mbig-switch -mdisable-fpregs -mdisable-indexing @gol
495-mfast-indirect-calls -mgas -mjump-in-delay @gol
4bc1997b
JM
496-mlong-load-store -mno-big-switch -mno-disable-fpregs @gol
497-mno-disable-indexing -mno-fast-indirect-calls -mno-gas @gol
feb48bde 498-mno-jump-in-delay -mno-long-load-store @gol
4bc1997b 499-mno-portable-runtime -mno-soft-float @gol
feb48bde
JM
500-mno-space-regs -msoft-float -mpa-risc-1-0 @gol
501-mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime @gol
630d3d5a 502-mschedule=@var{cpu-type} -mspace-regs}
74291a4b
MM
503
504@emph{Intel 960 Options}
4bc1997b 505@gccoptlist{
630d3d5a 506-m@var{cpu-type} -masm-compat -mclean-linkage @gol
4bc1997b
JM
507-mcode-align -mcomplex-addr -mleaf-procedures @gol
508-mic-compat -mic2.0-compat -mic3.0-compat @gol
509-mintel-asm -mno-clean-linkage -mno-code-align @gol
510-mno-complex-addr -mno-leaf-procedures @gol
511-mno-old-align -mno-strict-align -mno-tail-call @gol
512-mnumerics -mold-align -msoft-float -mstrict-align @gol
513-mtail-call}
74291a4b
MM
514
515@emph{DEC Alpha Options}
4bc1997b 516@gccoptlist{
58605ba0 517-mno-fp-regs -msoft-float -malpha-as -mgas @gol
4bc1997b
JM
518-mieee -mieee-with-inexact -mieee-conformant @gol
519-mfp-trap-mode=@var{mode} -mfp-rounding-mode=@var{mode} @gol
520-mtrap-precision=@var{mode} -mbuild-constants @gol
58605ba0
RH
521-mcpu=@var{cpu-type} -mtune=@var{cpu-type} @gol
522-mbwx -mmax -mfix -mcix @gol
523-mfloat-vax -mfloat-ieee @gol
524-mexplicit-relocs -msmall-data -mlarge-data @gol
4bc1997b 525-mmemory-latency=@var{time}}
74291a4b 526
d7c23cdc
DR
527@emph{DEC Alpha/VMS Options}
528@gccoptlist{
529-mvms-return-codes}
530
74291a4b 531@emph{Clipper Options}
4bc1997b
JM
532@gccoptlist{
533-mc300 -mc400}
74291a4b
MM
534
535@emph{H8/300 Options}
4bc1997b 536@gccoptlist{
310668e8 537-mrelax -mh -ms -mint32 -malign-300}
74291a4b
MM
538
539@emph{SH Options}
4bc1997b
JM
540@gccoptlist{
541-m1 -m2 -m3 -m3e @gol
542-m4-nofpu -m4-single-only -m4-single -m4 @gol
543-mb -ml -mdalign -mrelax @gol
544-mbigtable -mfmovd -mhitachi -mnomacsave @gol
c474f76b
AO
545-mieee -misize -mpadstruct -mspace @gol
546-mprefergot -musermode}
74291a4b
MM
547
548@emph{System V Options}
4bc1997b 549@gccoptlist{
aee96fe9 550-Qy -Qn -YP,@var{paths} -Ym,@var{dir}}
74291a4b 551
56b2d7a7 552@emph{ARC Options}
4bc1997b
JM
553@gccoptlist{
554-EB -EL @gol
630d3d5a
JM
555-mmangle-cpu -mcpu=@var{cpu} -mtext=@var{text-section} @gol
556-mdata=@var{data-section} -mrodata=@var{readonly-data-section}}
56b2d7a7 557
282a61e6 558@emph{TMS320C3x/C4x Options}
4bc1997b 559@gccoptlist{
310668e8
JM
560-mcpu=@var{cpu} -mbig -msmall -mregparm -mmemparm @gol
561-mfast-fix -mmpyi -mbk -mti -mdp-isr-reload @gol
562-mrpts=@var{count} -mrptb -mdb -mloop-unsigned @gol
563-mparallel-insns -mparallel-mpy -mpreserve-float}
282a61e6 564
f84271d9 565@emph{V850 Options}
4bc1997b 566@gccoptlist{
310668e8
JM
567-mlong-calls -mno-long-calls -mep -mno-ep @gol
568-mprolog-function -mno-prolog-function -mspace @gol
569-mtda=@var{n} -msda=@var{n} -mzda=@var{n} @gol
570-mv850 -mbig-switch}
83575957
ID
571
572@emph{NS32K Options}
4bc1997b 573@gccoptlist{
310668e8 574-m32032 -m32332 -m32532 -m32081 -m32381 @gol
feb48bde 575-mmult-add -mnomult-add -msoft-float -mrtd -mnortd @gol
310668e8
JM
576-mregparam -mnoregparam -msb -mnosb @gol
577-mbitfield -mnobitfield -mhimem -mnohimem}
789a3090 578
052a4b28 579@emph{AVR Options}
4bc1997b 580@gccoptlist{
310668e8
JM
581-mmcu=@var{mcu} -msize -minit-stack=@var{n} -mno-interrupts @gol
582-mcall-prologues -mno-tablejump -mtiny-stack}
052a4b28 583
789a3090 584@emph{MCore Options}
4bc1997b 585@gccoptlist{
feb48bde 586-mhardlit -mno-hardlit -mdiv -mno-div -mrelax-immediates @gol
310668e8
JM
587-mno-relax-immediates -mwide-bitfields -mno-wide-bitfields @gol
588-m4byte-functions -mno-4byte-functions -mcallgraph-data @gol
589-mno-callgraph-data -mslow-bytes -mno-slow-bytes -mno-lsim @gol
590-mlittle-endian -mbig-endian -m210 -m340 -mstack-increment}
f84271d9 591
bcf684c7
HPN
592@emph{MMIX Options}
593@gccoptlist{
594-mlibfuncs -mno-libfuncs -mepsilon -mno-epsilon -mabi=gnu @gol
595-mabi=mmixware -mzero-extend -mknuthdiv -mtoplevel-symbols @gol
3e0f61ac
HPN
596-melf -mbranch-predict -mreg-stack-fill-bug-workaround @gol
597-mno-branch-predict -mno-reg-stack-fill-bug-workaround}
bcf684c7 598
df6194d4
JW
599@emph{IA-64 Options}
600@gccoptlist{
310668e8
JM
601-mbig-endian -mlittle-endian -mgnu-as -mgnu-ld -mno-pic @gol
602-mvolatile-asm-stop -mb-step -mregister-names -mno-sdata @gol
603-mconstant-gp -mauto-pic -minline-divide-min-latency @gol
604-minline-divide-max-throughput -mno-dwarf2-asm @gol
630d3d5a 605-mfixed-range=@var{register-range}}
df6194d4 606
5d22c1a5
JM
607@emph{D30V Options}
608@gccoptlist{
609-mextmem -mextmemory -monchip -mno-asm-optimize -masm-optimize @gol
610-mbranch-cost=@var{n} -mcond-exec=@var{n}}
611
91abf72d
HP
612@emph{S/390 and zSeries Options}
613@gccoptlist{
614-mhard-float -msoft-float -mbackchain -mno-backchain @gol
615-msmall-exec -mno-small-exec -mmvcle -mno-mvcle @gol
616-m64 -m31 -mdebug -mno-debug}
617
0b85d816
HPN
618@emph{CRIS Options}
619@gccoptlist{
620-mcpu=@var{cpu} -march=@var{cpu} -mtune=@var{cpu} @gol
621-mmax-stack-frame=@var{n} -melinux-stacksize=@var{n} @gol
622-metrax4 -metrax100 -mpdebug -mcc-init -mno-side-effects @gol
623-mstack-align -mdata-align -mconst-align @gol
624-m32-bit -m16-bit -m8-bit -mno-prologue-epilogue -mno-gotplt @gol
625-melf -maout -melinux -mlinux -sim -sim2}
626
9f85bca7
JM
627@emph{PDP-11 Options}
628@gccoptlist{
629-mfpu -msoft-float -mac0 -mno-ac0 -m40 -m45 -m10 @gol
630-mbcopy -mbcopy-builtin -mint32 -mno-int16 @gol
631-mint16 -mno-int32 -mfloat32 -mno-float64 @gol
632-mfloat64 -mno-float32 -mabshi -mno-abshi @gol
633-mbranch-expensive -mbranch-cheap @gol
634-msplit -mno-split -munix-asm -mdec-asm}
635
74291a4b
MM
636@item Code Generation Options
637@xref{Code Gen Options,,Options for Code Generation Conventions}.
4bc1997b
JM
638@gccoptlist{
639-fcall-saved-@var{reg} -fcall-used-@var{reg} @gol
6cfc0341 640-ffixed-@var{reg} -fexceptions @gol
5d22c1a5
JM
641-fnon-call-exceptions -funwind-tables @gol
642-fasynchronous-unwind-tables @gol
4bc1997b 643-finhibit-size-directive -finstrument-functions @gol
4bc1997b
JM
644-fno-common -fno-ident -fno-gnu-linker @gol
645-fpcc-struct-return -fpic -fPIC @gol
646-freg-struct-return -fshared-data -fshort-enums @gol
310668e8
JM
647-fshort-double -fvolatile @gol
648-fvolatile-global -fvolatile-static @gol
4bc1997b
JM
649-fverbose-asm -fpack-struct -fstack-check @gol
650-fstack-limit-register=@var{reg} -fstack-limit-symbol=@var{sym} @gol
651-fargument-alias -fargument-noalias @gol
310668e8 652-fargument-noalias-global -fleading-underscore}
74291a4b
MM
653@end table
654
655@menu
656* Overall Options:: Controlling the kind of output:
657 an executable, object files, assembler files,
658 or preprocessed source.
659* C Dialect Options:: Controlling the variant of C language compiled.
660* C++ Dialect Options:: Variations on C++.
60de6385 661* Objective-C Dialect Options:: Variations on Objective-C.
764dbbf2 662* Language Independent Options:: Controlling how diagnostics should be
02f52e19 663 formatted.
74291a4b
MM
664* Warning Options:: How picky should the compiler be?
665* Debugging Options:: Symbol tables, measurements, and debugging dumps.
666* Optimize Options:: How much optimization?
667* Preprocessor Options:: Controlling header files and macro definitions.
668 Also, getting dependency information for Make.
669* Assembler Options:: Passing options to the assembler.
670* Link Options:: Specifying libraries and so on.
671* Directory Options:: Where to find header files and libraries.
672 Where to find the compiler executable files.
a743d340 673* Spec Files:: How to pass switches to sub-processes.
0c2d1a2a 674* Target Options:: Running a cross-compiler, or an old version of GCC.
74291a4b
MM
675@end menu
676
677@node Overall Options
678@section Options Controlling the Kind of Output
679
680Compilation can involve up to four stages: preprocessing, compilation
681proper, assembly and linking, always in that order. The first three
682stages apply to an individual source file, and end by producing an
683object file; linking combines all the object files (those newly
684compiled, and those specified as input) into an executable file.
685
686@cindex file name suffix
687For any given input file, the file name suffix determines what kind of
688compilation is done:
689
2642624b 690@table @gcctabopt
74291a4b
MM
691@item @var{file}.c
692C source code which must be preprocessed.
693
694@item @var{file}.i
695C source code which should not be preprocessed.
696
697@item @var{file}.ii
698C++ source code which should not be preprocessed.
699
700@item @var{file}.m
701Objective-C source code. Note that you must link with the library
702@file{libobjc.a} to make an Objective-C program work.
703
b9265ec1
JM
704@item @var{file}.mi
705Objective-C source code which should not be preprocessed.
706
74291a4b
MM
707@item @var{file}.h
708C header file (not to be compiled or linked).
709
710@item @var{file}.cc
b9265ec1 711@itemx @var{file}.cp
74291a4b
MM
712@itemx @var{file}.cxx
713@itemx @var{file}.cpp
b9265ec1 714@itemx @var{file}.c++
74291a4b
MM
715@itemx @var{file}.C
716C++ source code which must be preprocessed. Note that in @samp{.cxx},
717the last two letters must both be literally @samp{x}. Likewise,
161d7b59 718@samp{.C} refers to a literal capital C@.
74291a4b 719
b9265ec1
JM
720@item @var{file}.f
721@itemx @var{file}.for
722@itemx @var{file}.FOR
723Fortran source code which should not be preprocessed.
724
725@item @var{file}.F
726@itemx @var{file}.fpp
727@itemx @var{file}.FPP
728Fortran source code which must be preprocessed (with the traditional
729preprocessor).
730
731@item @var{file}.r
732Fortran source code which must be preprocessed with a RATFOR
161d7b59 733preprocessor (not included with GCC)@.
b9265ec1
JM
734
735@xref{Overall Options,,Options Controlling the Kind of Output, g77,
736Using and Porting GNU Fortran}, for more details of the handling of
737Fortran input files.
738
739@c FIXME: Descriptions of Java file types.
740@c @var{file}.java
741@c @var{file}.class
742@c @var{file}.zip
743@c @var{file}.jar
744
e23381df
GB
745@item @var{file}.ads
746Ada source code file which contains a library unit declaration (a
747declaration of a package, subprogram, or generic, or a generic
748instantiation), or a library unit renaming declaration (a package,
749generic, or subprogram renaming declaration). Such files are also
750called @dfn{specs}.
751
752@itemx @var{file}.adb
753Ada source code file containing a library unit body (a subprogram or
754package body). Such files are also called @dfn{bodies}.
755
b9265ec1 756@c GCC also knows about some suffixes for languages not yet included:
b9265ec1
JM
757@c Pascal:
758@c @var{file}.p
759@c @var{file}.pas
760
761@item @var{file}.ch
762@itemx @var{file}.chi
763CHILL source code (preprocessed with the traditional preprocessor).
764
74291a4b
MM
765@item @var{file}.s
766Assembler code.
767
768@item @var{file}.S
769Assembler code which must be preprocessed.
770
771@item @var{other}
772An object file to be fed straight into linking.
773Any file name with no recognized suffix is treated this way.
774@end table
775
cd3bb277 776@opindex x
630d3d5a 777You can specify the input language explicitly with the @option{-x} option:
74291a4b 778
2642624b 779@table @gcctabopt
74291a4b
MM
780@item -x @var{language}
781Specify explicitly the @var{language} for the following input files
782(rather than letting the compiler choose a default based on the file
783name suffix). This option applies to all following input files until
630d3d5a 784the next @option{-x} option. Possible values for @var{language} are:
74291a4b 785@example
b9265ec1
JM
786c c-header cpp-output
787c++ c++-cpp-output
788objective-c objc-cpp-output
74291a4b 789assembler assembler-with-cpp
e23381df
GB
790ada
791chill
b9265ec1 792f77 f77-cpp-input ratfor
e23381df 793java
74291a4b
MM
794@end example
795
796@item -x none
797Turn off any specification of a language, so that subsequent files are
630d3d5a 798handled according to their file name suffixes (as they are if @option{-x}
74291a4b 799has not been used at all).
14a774a9
RK
800
801@item -pass-exit-codes
cd3bb277 802@opindex pass-exit-codes
bedc7537 803Normally the @command{gcc} program will exit with the code of 1 if any
14a774a9 804phase of the compiler returns a non-success return code. If you specify
630d3d5a 805@option{-pass-exit-codes}, the @command{gcc} program will instead return with
14a774a9
RK
806numerically highest error produced by any phase that returned an error
807indication.
74291a4b
MM
808@end table
809
810If you only want some of the stages of compilation, you can use
630d3d5a
JM
811@option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
812one of the options @option{-c}, @option{-S}, or @option{-E} to say where
bedc7537
NC
813@command{gcc} is to stop. Note that some combinations (for example,
814@samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
74291a4b 815
2642624b 816@table @gcctabopt
74291a4b 817@item -c
cd3bb277 818@opindex c
74291a4b
MM
819Compile or assemble the source files, but do not link. The linking
820stage simply is not done. The ultimate output is in the form of an
821object file for each source file.
822
823By default, the object file name for a source file is made by replacing
824the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
825
826Unrecognized input files, not requiring compilation or assembly, are
827ignored.
828
829@item -S
cd3bb277 830@opindex S
74291a4b
MM
831Stop after the stage of compilation proper; do not assemble. The output
832is in the form of an assembler code file for each non-assembler input
833file specified.
834
835By default, the assembler file name for a source file is made by
836replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
837
838Input files that don't require compilation are ignored.
839
840@item -E
cd3bb277 841@opindex E
74291a4b
MM
842Stop after the preprocessing stage; do not run the compiler proper. The
843output is in the form of preprocessed source code, which is sent to the
844standard output.
845
846Input files which don't require preprocessing are ignored.
847
848@cindex output file option
849@item -o @var{file}
cd3bb277 850@opindex o
74291a4b
MM
851Place output in file @var{file}. This applies regardless to whatever
852sort of output is being produced, whether it be an executable file,
853an object file, an assembler file or preprocessed C code.
854
855Since only one output file can be specified, it does not make sense to
630d3d5a 856use @option{-o} when compiling more than one input file, unless you are
74291a4b
MM
857producing an executable file as output.
858
630d3d5a 859If @option{-o} is not specified, the default is to put an executable file
74291a4b
MM
860in @file{a.out}, the object file for @file{@var{source}.@var{suffix}} in
861@file{@var{source}.o}, its assembler file in @file{@var{source}.s}, and
bd819a4a 862all preprocessed C source on standard output.
74291a4b
MM
863
864@item -v
cd3bb277 865@opindex v
74291a4b
MM
866Print (on standard error output) the commands executed to run the stages
867of compilation. Also print the version number of the compiler driver
868program and of the preprocessor and the compiler proper.
869
870@item -pipe
cd3bb277 871@opindex pipe
74291a4b
MM
872Use pipes rather than temporary files for communication between the
873various stages of compilation. This fails to work on some systems where
874the assembler is unable to read from a pipe; but the GNU assembler has
875no trouble.
844642e6
NC
876
877@item --help
cd3bb277 878@opindex help
844642e6 879Print (on the standard output) a description of the command line options
bedc7537
NC
880understood by @command{gcc}. If the @option{-v} option is also specified
881then @option{--help} will also be passed on to the various processes
882invoked by @command{gcc}, so that they can display the command line options
883they accept. If the @option{-W} option is also specified then command
844642e6
NC
884line options which have no documentation associated with them will also
885be displayed.
10501d8f
CC
886
887@item --target-help
cd3bb277 888@opindex target-help
10501d8f
CC
889Print (on the standard output) a description of target specific command
890line options for each tool.
74291a4b
MM
891@end table
892
893@node Invoking G++
894@section Compiling C++ Programs
895
896@cindex suffixes for C++ source
897@cindex C++ source file suffixes
898C++ source files conventionally use one of the suffixes @samp{.C},
bba975d4 899@samp{.cc}, @samp{.cpp}, @samp{.c++}, @samp{.cp}, or @samp{.cxx};
0c2d1a2a 900preprocessed C++ files use the suffix @samp{.ii}. GCC recognizes
bba975d4
JM
901files with these names and compiles them as C++ programs even if you
902call the compiler the same way as for compiling C programs (usually with
bedc7537 903the name @command{gcc}).
74291a4b
MM
904
905@findex g++
906@findex c++
907However, C++ programs often require class libraries as well as a
908compiler that understands the C++ language---and under some
909circumstances, you might want to compile programs from standard input,
910or otherwise without a suffix that flags them as C++ programs.
bedc7537 911@command{g++} is a program that calls GCC with the default language
e5e809f4 912set to C++, and automatically specifies linking against the C++
bedc7537
NC
913library. On many systems, @command{g++} is also
914installed with the name @command{c++}.
74291a4b 915
bedc7537 916@cindex invoking @command{g++}
74291a4b
MM
917When you compile C++ programs, you may specify many of the same
918command-line options that you use for compiling programs in any
919language; or command-line options meaningful for C and related
920languages; or options that are meaningful only for C++ programs.
921@xref{C Dialect Options,,Options Controlling C Dialect}, for
161d7b59 922explanations of options for languages related to C@.
74291a4b
MM
923@xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
924explanations of options that are meaningful only for C++ programs.
925
926@node C Dialect Options
927@section Options Controlling C Dialect
928@cindex dialect options
929@cindex language dialect options
930@cindex options, dialect
931
932The following options control the dialect of C (or languages derived
2147b154 933from C, such as C++ and Objective-C) that the compiler accepts:
74291a4b 934
2642624b 935@table @gcctabopt
74291a4b 936@cindex ANSI support
c1030c7c 937@cindex ISO support
74291a4b 938@item -ansi
cd3bb277 939@opindex ansi
c1030c7c 940In C mode, support all ISO C89 programs. In C++ mode,
775afb25 941remove GNU extensions that conflict with ISO C++.
74291a4b 942
c1030c7c 943This turns off certain features of GCC that are incompatible with ISO
aee96fe9 944C89 (when compiling C code), or of standard C++ (when compiling C++ code),
0c2d1a2a 945such as the @code{asm} and @code{typeof} keywords, and
74291a4b
MM
946predefined macros such as @code{unix} and @code{vax} that identify the
947type of system you are using. It also enables the undesirable and
02f52e19 948rarely used ISO trigraph feature. For the C compiler,
0c2d1a2a 949it disables recognition of C++ style @samp{//} comments as well as
775afb25 950the @code{inline} keyword.
74291a4b
MM
951
952The alternate keywords @code{__asm__}, @code{__extension__},
953@code{__inline__} and @code{__typeof__} continue to work despite
630d3d5a 954@option{-ansi}. You would not want to use them in an ISO C program, of
74291a4b 955course, but it is useful to put them in header files that might be included
630d3d5a 956in compilations done with @option{-ansi}. Alternate predefined macros
74291a4b 957such as @code{__unix__} and @code{__vax__} are also available, with or
630d3d5a 958without @option{-ansi}.
74291a4b 959
630d3d5a
JM
960The @option{-ansi} option does not cause non-ISO programs to be
961rejected gratuitously. For that, @option{-pedantic} is required in
962addition to @option{-ansi}. @xref{Warning Options}.
74291a4b 963
630d3d5a 964The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
74291a4b
MM
965option is used. Some header files may notice this macro and refrain
966from declaring certain functions or defining certain macros that the
c1030c7c 967ISO standard doesn't call for; this is to avoid interfering with any
74291a4b
MM
968programs that might use these names for other things.
969
c771326b
JM
970Functions which would normally be built in but do not have semantics
971defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
630d3d5a 972functions with @option{-ansi} is used. @xref{Other Builtins,,Other
f0523f02 973built-in functions provided by GCC}, for details of the functions
01702459 974affected.
74291a4b 975
49419c8f 976@item -std=
cd3bb277 977@opindex std
aee96fe9
JM
978Determine the language standard. This option is currently only
979supported when compiling C@. A value for this option must be provided;
02f52e19 980possible values are
3932261a 981
ee457005 982@table @samp
aee96fe9
JM
983@item c89
984@itemx iso9899:1990
985ISO C89 (same as @option{-ansi}).
3043b30e
ML
986
987@item iso9899:199409
aee96fe9 988ISO C89 as modified in amendment 1.
3043b30e 989
49419c8f 990@item c99
aee96fe9
JM
991@itemx c9x
992@itemx iso9899:1999
993@itemx iso9899:199x
994ISO C99. Note that this standard is not yet fully supported; see
995@w{@uref{http://gcc.gnu.org/c99status.html}} for more information. The
996names @samp{c9x} and @samp{iso9899:199x} are deprecated.
3043b30e
ML
997
998@item gnu89
aee96fe9 999Default, ISO C89 plus GNU extensions (including some C99 features).
3043b30e 1000
49419c8f 1001@item gnu99
7dac2f89 1002@item gnu9x
d15a05b3
EC
1003ISO C99 plus GNU extensions. When ISO C99 is fully implemented in GCC,
1004this will become the default. The name @samp{gnu9x} is deprecated.
49419c8f 1005
ee457005 1006@end table
3043b30e
ML
1007
1008Even when this option is not specified, you can still use some of the
1009features of newer standards in so far as they do not conflict with
1010previous C standards. For example, you may use @code{__restrict__} even
bedc7537 1011when @option{-std=c99} is not specified.
3932261a 1012
5490d604
JM
1013The @option{-std} options specifying some version of ISO C have the same
1014effects as @option{-ansi}, except that features that were not in ISO C89
1015but are in the specified version (for example, @samp{//} comments and
1016the @code{inline} keyword in ISO C99) are not disabled.
1017
c1030c7c
JM
1018@xref{Standards,,Language Standards Supported by GCC}, for details of
1019these standard versions.
1020
b1018de6
AO
1021@item -aux-info @var{filename}
1022@opindex aux-info
1023Output to the given filename prototyped declarations for all functions
1024declared and/or defined in a translation unit, including those in header
161d7b59 1025files. This option is silently ignored in any language other than C@.
b1018de6
AO
1026
1027Besides declarations, the file indicates, in comments, the origin of
1028each declaration (source file and line), whether the declaration was
1029implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1030@samp{O} for old, respectively, in the first character after the line
1031number and the colon), and whether it came from a declaration or a
1032definition (@samp{C} or @samp{F}, respectively, in the following
1033character). In the case of function definitions, a K&R-style list of
1034arguments followed by their declarations is also provided, inside
1035comments, after the declaration.
1036
74291a4b 1037@item -fno-asm
cd3bb277 1038@opindex fno-asm
74291a4b
MM
1039Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1040keyword, so that code can use these words as identifiers. You can use
1041the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
630d3d5a 1042instead. @option{-ansi} implies @option{-fno-asm}.
74291a4b
MM
1043
1044In C++, this switch only affects the @code{typeof} keyword, since
1045@code{asm} and @code{inline} are standard keywords. You may want to
630d3d5a 1046use the @option{-fno-gnu-keywords} flag instead, which has the same
5490d604
JM
1047effect. In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1048switch only affects the @code{asm} and @code{typeof} keywords, since
1049@code{inline} is a standard keyword in ISO C99.
74291a4b
MM
1050
1051@item -fno-builtin
7d14c755 1052@itemx -fno-builtin-@var{function} @r{(C and Objective-C only)}
cd3bb277 1053@opindex fno-builtin
c771326b
JM
1054@cindex built-in functions
1055Don't recognize built-in functions that do not begin with
01702459 1056@samp{__builtin_} as prefix. @xref{Other Builtins,,Other built-in
f0523f02 1057functions provided by GCC}, for details of the functions affected,
c771326b 1058including those which are not built-in functions when @option{-ansi} or
5490d604
JM
1059@option{-std} options for strict ISO C conformance are used because they
1060do not have an ISO standard meaning.
74291a4b 1061
c771326b 1062GCC normally generates special code to handle certain built-in functions
74291a4b
MM
1063more efficiently; for instance, calls to @code{alloca} may become single
1064instructions that adjust the stack directly, and calls to @code{memcpy}
1065may become inline copy loops. The resulting code is often both smaller
1066and faster, but since the function calls no longer appear as such, you
1067cannot set a breakpoint on those calls, nor can you change the behavior
1068of the functions by linking with a different library.
1069
630d3d5a 1070In C++, @option{-fno-builtin} is always in effect. The @option{-fbuiltin}
0b1161fc 1071option has no effect. Therefore, in C++, the only way to get the
c771326b 1072optimization benefits of built-in functions is to call the function
0b1161fc 1073using the @samp{__builtin_} prefix. The GNU C++ Standard Library uses
c771326b 1074built-in functions to implement many functions (like
0b1161fc
MM
1075@code{std::strchr}), so that you automatically get efficient code.
1076
7d14c755
JM
1077With the @option{-fno-builtin-@var{function}} option, not available
1078when compiling C++, only the built-in function @var{function} is
1079disabled. @var{function} must not begin with @samp{__builtin_}. If a
1080function is named this is not built-in in this version of GCC, this
1081option is ignored. There is no corresponding
1082@option{-fbuiltin-@var{function}} option; if you wish to enable
1083built-in functions selectively when using @option{-fno-builtin} or
1084@option{-ffreestanding}, you may define macros such as:
1085
1086@smallexample
1087#define abs(n) __builtin_abs ((n))
1088#define strcpy(d, s) __builtin_strcpy ((d), (s))
1089@end smallexample
1090
861bb6c1 1091@item -fhosted
cd3bb277 1092@opindex fhosted
861bb6c1
JL
1093@cindex hosted environment
1094
1095Assert that compilation takes place in a hosted environment. This implies
630d3d5a 1096@option{-fbuiltin}. A hosted environment is one in which the
861bb6c1
JL
1097entire standard library is available, and in which @code{main} has a return
1098type of @code{int}. Examples are nearly everything except a kernel.
630d3d5a 1099This is equivalent to @option{-fno-freestanding}.
861bb6c1
JL
1100
1101@item -ffreestanding
cd3bb277 1102@opindex ffreestanding
861bb6c1
JL
1103@cindex hosted environment
1104
1105Assert that compilation takes place in a freestanding environment. This
630d3d5a 1106implies @option{-fno-builtin}. A freestanding environment
861bb6c1
JL
1107is one in which the standard library may not exist, and program startup may
1108not necessarily be at @code{main}. The most obvious example is an OS kernel.
630d3d5a 1109This is equivalent to @option{-fno-hosted}.
861bb6c1 1110
c1030c7c
JM
1111@xref{Standards,,Language Standards Supported by GCC}, for details of
1112freestanding and hosted environments.
1113
74291a4b 1114@item -trigraphs
cd3bb277 1115@opindex trigraphs
3bce8a01
NB
1116Support ISO C trigraphs. The @option{-ansi} option (and @option{-std}
1117options for strict ISO C conformance) implies @option{-trigraphs}.
74291a4b
MM
1118
1119@cindex traditional C language
1120@cindex C language, traditional
1121@item -traditional
cd3bb277 1122@opindex traditional
74291a4b
MM
1123Attempt to support some aspects of traditional C compilers.
1124Specifically:
1125
1126@itemize @bullet
1127@item
1128All @code{extern} declarations take effect globally even if they
1129are written inside of a function definition. This includes implicit
1130declarations of functions.
1131
1132@item
1133The newer keywords @code{typeof}, @code{inline}, @code{signed}, @code{const}
1134and @code{volatile} are not recognized. (You can still use the
1135alternative keywords such as @code{__typeof__}, @code{__inline__}, and
1136so on.)
1137
1138@item
1139Comparisons between pointers and integers are always allowed.
1140
1141@item
1142Integer types @code{unsigned short} and @code{unsigned char} promote
1143to @code{unsigned int}.
1144
1145@item
1146Out-of-range floating point literals are not an error.
1147
1148@item
c1030c7c 1149Certain constructs which ISO regards as a single invalid preprocessing
74291a4b
MM
1150number, such as @samp{0xe-0xd}, are treated as expressions instead.
1151
1152@item
1153String ``constants'' are not necessarily constant; they are stored in
1154writable space, and identical looking constants are allocated
1155separately. (This is the same as the effect of
630d3d5a 1156@option{-fwritable-strings}.)
74291a4b
MM
1157
1158@cindex @code{longjmp} and automatic variables
1159@item
1160All automatic variables not declared @code{register} are preserved by
c1030c7c 1161@code{longjmp}. Ordinarily, GNU C follows ISO C: automatic variables
74291a4b
MM
1162not declared @code{volatile} may be clobbered.
1163
1164@item
cd3bb277
JM
1165@cindex @samp{\x}
1166@cindex @samp{\a}
74291a4b
MM
1167@cindex escape sequences, traditional
1168The character escape sequences @samp{\x} and @samp{\a} evaluate as the
1169literal characters @samp{x} and @samp{a} respectively. Without
630d3d5a 1170@w{@option{-traditional}}, @samp{\x} is a prefix for the hexadecimal
74291a4b 1171representation of a character, and @samp{\a} produces a bell.
ad299d9b 1172@end itemize
74291a4b 1173
aa99bd09
JM
1174This option is deprecated and may be removed.
1175
630d3d5a 1176You may wish to use @option{-fno-builtin} as well as @option{-traditional}
c771326b 1177if your program uses names that are normally GNU C built-in functions for
74291a4b
MM
1178other purposes of its own.
1179
630d3d5a 1180You cannot use @option{-traditional} if you include any header files that
c1030c7c 1181rely on ISO C features. Some vendors are starting to ship systems with
630d3d5a 1182ISO C header files and you cannot use @option{-traditional} on such
74291a4b
MM
1183systems to compile files that include any system headers.
1184
9c34dbbf 1185The @option{-traditional} option also enables @option{-traditional-cpp}.
74291a4b
MM
1186
1187@item -traditional-cpp
cd3bb277 1188@opindex traditional-cpp
74291a4b 1189Attempt to support some aspects of traditional C preprocessors.
9c34dbbf 1190See the GNU CPP manual for details.
74291a4b
MM
1191
1192@item -fcond-mismatch
cd3bb277 1193@opindex fcond-mismatch
74291a4b 1194Allow conditional expressions with mismatched types in the second and
a7537031
JM
1195third arguments. The value of such an expression is void. This option
1196is not supported for C++.
74291a4b
MM
1197
1198@item -funsigned-char
cd3bb277 1199@opindex funsigned-char
74291a4b
MM
1200Let the type @code{char} be unsigned, like @code{unsigned char}.
1201
1202Each kind of machine has a default for what @code{char} should
1203be. It is either like @code{unsigned char} by default or like
1204@code{signed char} by default.
1205
1206Ideally, a portable program should always use @code{signed char} or
1207@code{unsigned char} when it depends on the signedness of an object.
1208But many programs have been written to use plain @code{char} and
1209expect it to be signed, or expect it to be unsigned, depending on the
1210machines they were written for. This option, and its inverse, let you
1211make such a program work with the opposite default.
1212
1213The type @code{char} is always a distinct type from each of
1214@code{signed char} or @code{unsigned char}, even though its behavior
1215is always just like one of those two.
1216
1217@item -fsigned-char
cd3bb277 1218@opindex fsigned-char
74291a4b
MM
1219Let the type @code{char} be signed, like @code{signed char}.
1220
630d3d5a
JM
1221Note that this is equivalent to @option{-fno-unsigned-char}, which is
1222the negative form of @option{-funsigned-char}. Likewise, the option
1223@option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
74291a4b 1224
74291a4b
MM
1225@item -fsigned-bitfields
1226@itemx -funsigned-bitfields
1227@itemx -fno-signed-bitfields
1228@itemx -fno-unsigned-bitfields
cd3bb277
JM
1229@opindex fsigned-bitfields
1230@opindex funsigned-bitfields
1231@opindex fno-signed-bitfields
1232@opindex fno-unsigned-bitfields
c771326b 1233These options control whether a bit-field is signed or unsigned, when the
74291a4b 1234declaration does not use either @code{signed} or @code{unsigned}. By
c771326b 1235default, such a bit-field is signed, because this is consistent: the
74291a4b
MM
1236basic integer types such as @code{int} are signed types.
1237
c771326b 1238However, when @option{-traditional} is used, bit-fields are all unsigned
74291a4b
MM
1239no matter what.
1240
1241@item -fwritable-strings
cd3bb277 1242@opindex fwritable-strings
74291a4b
MM
1243Store string constants in the writable data segment and don't uniquize
1244them. This is for compatibility with old programs which assume they can
630d3d5a 1245write into string constants. The option @option{-traditional} also has
74291a4b
MM
1246this effect.
1247
1248Writing into string constants is a very bad idea; ``constants'' should
1249be constant.
1250
1251@item -fallow-single-precision
cd3bb277 1252@opindex fallow-single-precision
74291a4b 1253Do not promote single precision math operations to double precision,
630d3d5a 1254even when compiling with @option{-traditional}.
74291a4b
MM
1255
1256Traditional K&R C promotes all floating point operations to double
1257precision, regardless of the sizes of the operands. On the
1258architecture for which you are compiling, single precision may be faster
630d3d5a 1259than double precision. If you must use @option{-traditional}, but want
74291a4b
MM
1260to use single precision operations when the operands are single
1261precision, use this option. This option has no effect when compiling
c1030c7c 1262with ISO or GNU C conventions (the default).
74291a4b 1263
3e37bef5 1264@item -fshort-wchar
cd3bb277 1265@opindex fshort-wchar
3e37bef5
JM
1266Override the underlying type for @samp{wchar_t} to be @samp{short
1267unsigned int} instead of the default for the target. This option is
161d7b59 1268useful for building programs to run under WINE@.
74291a4b
MM
1269@end table
1270
1271@node C++ Dialect Options
1272@section Options Controlling C++ Dialect
1273
1274@cindex compiler options, C++
1275@cindex C++ options, command line
1276@cindex options, C++
1277This section describes the command-line options that are only meaningful
1278for C++ programs; but you can also use most of the GNU compiler options
1279regardless of what language your program is in. For example, you
1280might compile a file @code{firstClass.C} like this:
1281
1282@example
1dc5fc4b 1283g++ -g -frepo -O -c firstClass.C
74291a4b
MM
1284@end example
1285
1286@noindent
630d3d5a 1287In this example, only @option{-frepo} is an option meant
74291a4b 1288only for C++ programs; you can use the other options with any
161d7b59 1289language supported by GCC@.
74291a4b
MM
1290
1291Here is a list of options that are @emph{only} for compiling C++ programs:
1292
2642624b 1293@table @gcctabopt
74291a4b 1294@item -fno-access-control
cd3bb277 1295@opindex fno-access-control
74291a4b
MM
1296Turn off all access checking. This switch is mainly useful for working
1297around bugs in the access control code.
1298
74291a4b 1299@item -fcheck-new
cd3bb277 1300@opindex fcheck-new
74291a4b
MM
1301Check that the pointer returned by @code{operator new} is non-null
1302before attempting to modify the storage allocated. The current Working
1303Paper requires that @code{operator new} never return a null pointer, so
1304this check is normally unnecessary.
1305
1dc5fc4b
JM
1306An alternative to using this option is to specify that your
1307@code{operator new} does not throw any exceptions; if you declare it
aee96fe9 1308@samp{throw()}, G++ will check the return value. See also @samp{new
1dc5fc4b
JM
1309(nothrow)}.
1310
74291a4b 1311@item -fconserve-space
cd3bb277 1312@opindex fconserve-space
74291a4b
MM
1313Put uninitialized or runtime-initialized global variables into the
1314common segment, as C does. This saves space in the executable at the
1315cost of not diagnosing duplicate definitions. If you compile with this
1316flag and your program mysteriously crashes after @code{main()} has
1317completed, you may have an object that is being destroyed twice because
1318two definitions were merged.
1319
1dc5fc4b
JM
1320This option is no longer useful on most targets, now that support has
1321been added for putting variables into BSS without making them common.
1322
02f52e19 1323@item -fno-const-strings
cd3bb277 1324@opindex fno-const-strings
fcca588c
MM
1325Give string constants type @code{char *} instead of type @code{const
1326char *}. By default, G++ uses type @code{const char *} as required by
630d3d5a 1327the standard. Even if you use @option{-fno-const-strings}, you cannot
fcca588c 1328actually modify the value of a string constant, unless you also use
630d3d5a 1329@option{-fwritable-strings}.
fcca588c
MM
1330
1331This option might be removed in a future release of G++. For maximum
1332portability, you should structure your code so that it works with
1333string constants that have type @code{const char *}.
1334
74291a4b 1335@item -fdollars-in-identifiers
cd3bb277 1336@opindex fdollars-in-identifiers
74291a4b 1337Accept @samp{$} in identifiers. You can also explicitly prohibit use of
630d3d5a 1338@samp{$} with the option @option{-fno-dollars-in-identifiers}. (GNU C allows
eb795509 1339@samp{$} by default on most target systems, but there are a few exceptions.)
74291a4b 1340Traditional C allowed the character @samp{$} to form part of
c1030c7c 1341identifiers. However, ISO C and C++ forbid @samp{$} in identifiers.
74291a4b 1342
1dc5fc4b 1343@item -fno-elide-constructors
cd3bb277 1344@opindex fno-elide-constructors
1dc5fc4b
JM
1345The C++ standard allows an implementation to omit creating a temporary
1346which is only used to initialize another object of the same type.
aee96fe9 1347Specifying this option disables that optimization, and forces G++ to
1dc5fc4b 1348call the copy constructor in all cases.
74291a4b 1349
dd1ba632 1350@item -fno-enforce-eh-specs
cd3bb277 1351@opindex fno-enforce-eh-specs
dd1ba632
JM
1352Don't check for violation of exception specifications at runtime. This
1353option violates the C++ standard, but may be useful for reducing code
1354size in production builds, much like defining @samp{NDEBUG}. The compiler
1355will still optimize based on the exception specifications.
1356
74291a4b 1357@item -fexternal-templates
cd3bb277 1358@opindex fexternal-templates
9c34dbbf
ZW
1359
1360Cause @samp{#pragma interface} and @samp{implementation} to apply to
1361template instantiation; template instances are emitted or not according
74291a4b
MM
1362to the location of the template definition. @xref{Template
1363Instantiation}, for more information.
1364
37f6b6bf
MM
1365This option is deprecated.
1366
74291a4b 1367@item -falt-external-templates
cd3bb277 1368@opindex falt-external-templates
9c34dbbf
ZW
1369Similar to @option{-fexternal-templates}, but template instances are
1370emitted or not according to the place where they are first instantiated.
74291a4b
MM
1371@xref{Template Instantiation}, for more information.
1372
37f6b6bf
MM
1373This option is deprecated.
1374
74291a4b 1375@item -ffor-scope
8c81598d 1376@itemx -fno-for-scope
cd3bb277
JM
1377@opindex ffor-scope
1378@opindex fno-for-scope
695ac33f 1379If @option{-ffor-scope} is specified, the scope of variables declared in
74291a4b 1380a @i{for-init-statement} is limited to the @samp{for} loop itself,
34527c47 1381as specified by the C++ standard.
695ac33f 1382If @option{-fno-for-scope} is specified, the scope of variables declared in
74291a4b 1383a @i{for-init-statement} extends to the end of the enclosing scope,
aee96fe9 1384as was the case in old versions of G++, and other (traditional)
74291a4b
MM
1385implementations of C++.
1386
1387The default if neither flag is given to follow the standard,
1388but to allow and give a warning for old-style code that would
1389otherwise be invalid, or have different behavior.
1390
1391@item -fno-gnu-keywords
cd3bb277 1392@opindex fno-gnu-keywords
9762e8a4 1393Do not recognize @code{typeof} as a keyword, so that code can use this
767094dd 1394word as an identifier. You can use the keyword @code{__typeof__} instead.
630d3d5a 1395@option{-ansi} implies @option{-fno-gnu-keywords}.
74291a4b 1396
1dc5fc4b 1397@item -fno-implicit-templates
cd3bb277 1398@opindex fno-implicit-templates
bba975d4 1399Never emit code for non-inline templates which are instantiated
e979f9e8 1400implicitly (i.e.@: by use); only emit code for explicit instantiations.
bba975d4
JM
1401@xref{Template Instantiation}, for more information.
1402
1403@item -fno-implicit-inline-templates
cd3bb277 1404@opindex fno-implicit-inline-templates
bba975d4
JM
1405Don't emit code for implicit instantiations of inline templates, either.
1406The default is to handle inlines differently so that compiles with and
1407without optimization will need the same set of explicit instantiations.
1dc5fc4b 1408
74291a4b 1409@item -fno-implement-inlines
cd3bb277 1410@opindex fno-implement-inlines
74291a4b
MM
1411To save space, do not emit out-of-line copies of inline functions
1412controlled by @samp{#pragma implementation}. This will cause linker
1413errors if these functions are not inlined everywhere they are called.
1414
631cf95d 1415@item -fms-extensions
cd3bb277 1416@opindex fms-extensions
32fb1fb2
PE
1417Disable pedantic warnings about constructs used in MFC, such as implicit
1418int and getting a pointer to member function via non-standard syntax.
631cf95d 1419
fcca588c 1420@item -fno-nonansi-builtins
cd3bb277 1421@opindex fno-nonansi-builtins
c771326b 1422Disable built-in declarations of functions that are not mandated by
161d7b59 1423ANSI/ISO C@. These include @code{ffs}, @code{alloca}, @code{_exit},
fcca588c
MM
1424@code{index}, @code{bzero}, @code{conjf}, and other related functions.
1425
775afb25 1426@item -fno-operator-names
cd3bb277 1427@opindex fno-operator-names
775afb25 1428Do not treat the operator name keywords @code{and}, @code{bitand},
74291a4b 1429@code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
775afb25 1430synonyms as keywords.
74291a4b 1431
4f8b4fd9 1432@item -fno-optional-diags
cd3bb277 1433@opindex fno-optional-diags
4f8b4fd9 1434Disable diagnostics that the standard says a compiler does not need to
aee96fe9 1435issue. Currently, the only such diagnostic issued by G++ is the one for
bba975d4 1436a name having multiple meanings within a class.
4f8b4fd9 1437
8c7707b0 1438@item -fpermissive
cd3bb277 1439@opindex fpermissive
8c7707b0 1440Downgrade messages about nonconformant code from errors to warnings. By
aee96fe9 1441default, G++ effectively sets @option{-pedantic-errors} without
630d3d5a 1442@option{-pedantic}; this option reverses that. This behavior and this
161d7b59 1443option are superseded by @option{-pedantic}, which works as it does for GNU C@.
8c7707b0 1444
8c81598d 1445@item -frepo
cd3bb277 1446@opindex frepo
9c34dbbf
ZW
1447Enable automatic template instantiation at link time. This option also
1448implies @option{-fno-implicit-templates}. @xref{Template
1449Instantiation}, for more information.
8c81598d 1450
8c7707b0 1451@item -fno-rtti
cd3bb277 1452@opindex fno-rtti
a7fbfcf9
JM
1453Disable generation of information about every class with virtual
1454functions for use by the C++ runtime type identification features
1455(@samp{dynamic_cast} and @samp{typeid}). If you don't use those parts
1456of the language, you can save some space by using this flag. Note that
1457exception handling uses the same information, but it will generate it as
1458needed.
8c7707b0 1459
fcca588c 1460@item -fstats
cd3bb277 1461@opindex fstats
fcca588c
MM
1462Emit statistics about front-end processing at the end of the compilation.
1463This information is generally only useful to the G++ development team.
1464
1dc5fc4b 1465@item -ftemplate-depth-@var{n}
cd3bb277 1466@opindex ftemplate-depth
1dc5fc4b
JM
1467Set the maximum instantiation depth for template classes to @var{n}.
1468A limit on the template instantiation depth is needed to detect
767094dd 1469endless recursions during template class instantiation. ANSI/ISO C++
1dc5fc4b
JM
1470conforming programs must not rely on a maximum depth greater than 17.
1471
fc693822 1472@item -fuse-cxa-atexit
cd3bb277 1473@opindex fuse-cxa-atexit
fc693822
MM
1474Register destructors for objects with static storage duration with the
1475@code{__cxa_atexit} function rather than the @code{atexit} function.
1476This option is required for fully standards-compliant handling of static
1477destructors, but will only work if your C library supports
1478@code{__cxa_atexit}.
1479
90ecce3e 1480@item -fvtable-gc
cd3bb277 1481@opindex fvtable-gc
90ecce3e
JM
1482Emit special relocations for vtables and virtual function references
1483so that the linker can identify unused virtual functions and zero out
1484vtable slots that refer to them. This is most useful with
630d3d5a 1485@option{-ffunction-sections} and @option{-Wl,--gc-sections}, in order to
90ecce3e 1486also discard the functions themselves.
f5a1b0d2 1487
90ecce3e 1488This optimization requires GNU as and GNU ld. Not all systems support
630d3d5a 1489this option. @option{-Wl,--gc-sections} is ignored without @option{-static}.
861bb6c1 1490
02f52e19 1491@item -fno-weak
cd3bb277 1492@opindex fno-weak
90ecce3e 1493Do not use weak symbol support, even if it is provided by the linker.
fcca588c
MM
1494By default, G++ will use weak symbols if they are available. This
1495option exists only for testing, and should not be used by end-users;
1496it will result in inferior code and has no benefits. This option may
1497be removed in a future release of G++.
1498
74291a4b 1499@item -nostdinc++
cd3bb277 1500@opindex nostdinc++
74291a4b
MM
1501Do not search for header files in the standard directories specific to
1502C++, but do still search the other standard directories. (This option
e5e809f4 1503is used when building the C++ library.)
74291a4b
MM
1504@end table
1505
1506In addition, these optimization, warning, and code generation options
1507have meanings only for C++ programs:
1508
2642624b 1509@table @gcctabopt
74291a4b 1510@item -fno-default-inline
cd3bb277 1511@opindex fno-default-inline
74291a4b 1512Do not assume @samp{inline} for functions defined inside a class scope.
1dc5fc4b
JM
1513@xref{Optimize Options,,Options That Control Optimization}. Note that these
1514functions will have linkage like inline functions; they just won't be
1515inlined by default.
74291a4b 1516
aee96fe9 1517@item -Wctor-dtor-privacy @r{(C++ only)}
cd3bb277 1518@opindex Wctor-dtor-privacy
bba975d4
JM
1519Warn when a class seems unusable, because all the constructors or
1520destructors in a class are private and the class has no friends or
1521public static member functions.
1522
aee96fe9 1523@item -Wnon-virtual-dtor @r{(C++ only)}
cd3bb277 1524@opindex Wnon-virtual-dtor
bba975d4
JM
1525Warn when a class declares a non-virtual destructor that should probably
1526be virtual, because it looks like the class will be used polymorphically.
1527
aee96fe9 1528@item -Wreorder @r{(C++ only)}
cd3bb277 1529@opindex Wreorder
bba975d4
JM
1530@cindex reordering, warning
1531@cindex warning for reordering of member initializers
1532Warn when the order of member initializers given in the code does not
1533match the order in which they must be executed. For instance:
1534
1535@smallexample
1536struct A @{
1537 int i;
1538 int j;
1539 A(): j (0), i (1) @{ @}
1540@};
1541@end smallexample
1542
1543Here the compiler will warn that the member initializers for @samp{i}
1544and @samp{j} will be rearranged to match the declaration order of the
1545members.
1546@end table
1547
630d3d5a 1548The following @option{-W@dots{}} options are not affected by @option{-Wall}.
bba975d4 1549
2642624b 1550@table @gcctabopt
aee96fe9 1551@item -Weffc++ @r{(C++ only)}
cd3bb277 1552@opindex Weffc++
bba975d4
JM
1553Warn about violations of various style guidelines from Scott Meyers'
1554@cite{Effective C++} books. If you use this option, you should be aware
1555that the standard library headers do not obey all of these guidelines;
1556you can use @samp{grep -v} to filter out those warnings.
1557
aee96fe9 1558@item -Wno-deprecated @r{(C++ only)}
cd3bb277 1559@opindex Wno-deprecated
767094dd 1560Do not warn about usage of deprecated features. @xref{Deprecated Features}.
2de45c06 1561
aee96fe9 1562@item -Wno-non-template-friend @r{(C++ only)}
cd3bb277 1563@opindex Wno-non-template-friend
bba975d4 1564Disable warnings when non-templatized friend functions are declared
767094dd 1565within a template. With the advent of explicit template specification
aee96fe9 1566support in G++, if the name of the friend is an unqualified-id (i.e.,
bba975d4 1567@samp{friend foo(int)}), the C++ language specification demands that the
767094dd 1568friend declare or define an ordinary, nontemplate function. (Section
aee96fe9 156914.5.3). Before G++ implemented explicit specification, unqualified-ids
bba975d4 1570could be interpreted as a particular specialization of a templatized
767094dd 1571function. Because this non-conforming behavior is no longer the default
aee96fe9 1572behavior for G++, @option{-Wnon-template-friend} allows the compiler to
bba975d4 1573check existing code for potential trouble spots, and is on by default.
2228d450 1574This new compiler behavior can be turned off with
630d3d5a 1575@option{-Wno-non-template-friend} which keeps the conformant compiler code
2228d450 1576but disables the helpful warning.
bba975d4 1577
aee96fe9 1578@item -Wold-style-cast @r{(C++ only)}
cd3bb277 1579@opindex Wold-style-cast
323728aa
NS
1580Warn if an old-style (C-style) cast to a non-void type is used within
1581a C++ program. The new-style casts (@samp{static_cast},
1582@samp{reinterpret_cast}, and @samp{const_cast}) are less vulnerable to
1583unintended effects, and much easier to grep for.
bba975d4 1584
aee96fe9 1585@item -Woverloaded-virtual @r{(C++ only)}
cd3bb277 1586@opindex Woverloaded-virtual
bba975d4
JM
1587@cindex overloaded virtual fn, warning
1588@cindex warning for overloaded virtual fn
3747f3dc
MM
1589Warn when a function declaration hides virtual functions from a
1590base class. For example, in:
1591
1592@smallexample
1593struct A @{
1594 virtual void f();
1595@};
1596
1597struct B: public A @{
1598 void f(int);
1599@};
1600@end smallexample
1601
1602the @code{A} class version of @code{f} is hidden in @code{B}, and code
1603like this:
1604
1605@smallexample
1606B* b;
1607b->f();
1608@end smallexample
1609
1610will fail to compile.
bba975d4 1611
aee96fe9 1612@item -Wno-pmf-conversions @r{(C++ only)}
cd3bb277 1613@opindex Wno-pmf-conversions
bba975d4
JM
1614Disable the diagnostic for converting a bound pointer to member function
1615to a plain pointer.
1616
aee96fe9 1617@item -Wsign-promo @r{(C++ only)}
cd3bb277 1618@opindex Wsign-promo
bba975d4
JM
1619Warn when overload resolution chooses a promotion from unsigned or
1620enumeral type to a signed type over a conversion to an unsigned type of
aee96fe9 1621the same size. Previous versions of G++ would try to preserve
bba975d4
JM
1622unsignedness, but the standard mandates the current behavior.
1623
aee96fe9 1624@item -Wsynth @r{(C++ only)}
cd3bb277 1625@opindex Wsynth
bba975d4
JM
1626@cindex warning for synthesized methods
1627@cindex synthesized methods, warning
aee96fe9 1628Warn when G++'s synthesis behavior does not match that of cfront. For
bba975d4
JM
1629instance:
1630
1631@smallexample
1632struct A @{
1633 operator int ();
1634 A& operator = (int);
1635@};
1636
1637main ()
1638@{
1639 A a,b;
1640 a = b;
1641@}
1642@end smallexample
74291a4b 1643
aee96fe9 1644In this example, G++ will synthesize a default @samp{A& operator =
bba975d4 1645(const A&);}, while cfront will use the user-defined @samp{operator =}.
74291a4b
MM
1646@end table
1647
60de6385
SS
1648@node Objective-C Dialect Options
1649@section Options Controlling Objective-C Dialect
1650
1651@cindex compiler options, Objective-C
1652@cindex Objective-C options, command line
1653@cindex options, Objective-C
1654This section describes the command-line options that are only meaningful
1655for Objective-C programs; but you can also use most of the GNU compiler
1656options regardless of what language your program is in. For example,
1657you might compile a file @code{some_class.m} like this:
1658
1659@example
1660gcc -g -fgnu-runtime -O -c some_class.m
1661@end example
1662
1663@noindent
630d3d5a 1664In this example, only @option{-fgnu-runtime} is an option meant only for
60de6385 1665Objective-C programs; you can use the other options with any language
161d7b59 1666supported by GCC@.
60de6385
SS
1667
1668Here is a list of options that are @emph{only} for compiling Objective-C
1669programs:
1670
1671@table @gcctabopt
630d3d5a 1672@item -fconstant-string-class=@var{class-name}
cd3bb277 1673@opindex fconstant-string-class
630d3d5a 1674Use @var{class-name} as the name of the class to instantiate for each
695ac33f 1675literal string specified with the syntax @code{@@"@dots{}"}. The default
60de6385
SS
1676class name is @code{NXConstantString}.
1677
1678@item -fgnu-runtime
cd3bb277 1679@opindex fgnu-runtime
60de6385
SS
1680Generate object code compatible with the standard GNU Objective-C
1681runtime. This is the default for most types of systems.
1682
1683@item -fnext-runtime
cd3bb277 1684@opindex fnext-runtime
60de6385 1685Generate output compatible with the NeXT runtime. This is the default
161d7b59 1686for NeXT-based systems, including Darwin and Mac OS X@.
60de6385
SS
1687
1688@item -gen-decls
cd3bb277 1689@opindex gen-decls
60de6385
SS
1690Dump interface declarations for all classes seen in the source file to a
1691file named @file{@var{sourcename}.decl}.
1692
1693@item -Wno-protocol
cd3bb277 1694@opindex Wno-protocol
60de6385
SS
1695Do not warn if methods required by a protocol are not implemented
1696in the class adopting it.
1697
1698@item -Wselector
cd3bb277 1699@opindex Wselector
60de6385
SS
1700Warn if a selector has multiple methods of different types defined.
1701
1702@c not documented because only avail via -Wp
1703@c @item -print-objc-runtime-info
1704
1705@end table
1706
764dbbf2
GDR
1707@node Language Independent Options
1708@section Options to Control Diagnostic Messages Formatting
1709@cindex options to control diagnostics formatting
1710@cindex diagnostic messages
1711@cindex message formatting
1712
b192711e 1713Traditionally, diagnostic messages have been formatted irrespective of
e979f9e8 1714the output device's aspect (e.g.@: its width, @dots{}). The options described
764dbbf2 1715below can be used to control the diagnostic messages formatting
e979f9e8 1716algorithm, e.g.@: how many characters per line, how often source location
6c0a4eab 1717information should be reported. Right now, only the C++ front end can
764dbbf2 1718honor these options. However it is expected, in the near future, that
6c0a4eab 1719the remaining front ends would be able to digest them correctly.
764dbbf2 1720
2642624b 1721@table @gcctabopt
764dbbf2 1722@item -fmessage-length=@var{n}
cd3bb277 1723@opindex fmessage-length
764dbbf2 1724Try to format error messages so that they fit on lines of about @var{n}
aee96fe9 1725characters. The default is 72 characters for @command{g++} and 0 for the rest of
161d7b59 1726the front ends supported by GCC@. If @var{n} is zero, then no
02f52e19 1727line-wrapping will be done; each error message will appear on a single
764dbbf2
GDR
1728line.
1729
cd3bb277 1730@opindex fdiagnostics-show-location
764dbbf2 1731@item -fdiagnostics-show-location=once
b192711e 1732Only meaningful in line-wrapping mode. Instructs the diagnostic messages
764dbbf2
GDR
1733reporter to emit @emph{once} source location information; that is, in
1734case the message is too long to fit on a single physical line and has to
1735be wrapped, the source location won't be emitted (as prefix) again,
1736over and over, in subsequent continuation lines. This is the default
c21cd8b1 1737behavior.
764dbbf2
GDR
1738
1739@item -fdiagnostics-show-location=every-line
1740Only meaningful in line-wrapping mode. Instructs the diagnostic
1741messages reporter to emit the same source location information (as
4fe9b91c 1742prefix) for physical lines that result from the process of breaking
b192711e 1743a message which is too long to fit on a single line.
764dbbf2
GDR
1744
1745@end table
1746
74291a4b
MM
1747@node Warning Options
1748@section Options to Request or Suppress Warnings
1749@cindex options to control warnings
1750@cindex warning messages
1751@cindex messages, warning
1752@cindex suppressing warnings
1753
1754Warnings are diagnostic messages that report constructions which
1755are not inherently erroneous but which are risky or suggest there
1756may have been an error.
1757
1758You can request many specific warnings with options beginning @samp{-W},
630d3d5a 1759for example @option{-Wimplicit} to request warnings on implicit
74291a4b
MM
1760declarations. Each of these specific warning options also has a
1761negative form beginning @samp{-Wno-} to turn off warnings;
630d3d5a 1762for example, @option{-Wno-implicit}. This manual lists only one of the
74291a4b
MM
1763two forms, whichever is not the default.
1764
0c2d1a2a 1765These options control the amount and kinds of warnings produced by GCC:
74291a4b 1766
2642624b 1767@table @gcctabopt
74291a4b
MM
1768@cindex syntax checking
1769@item -fsyntax-only
cd3bb277 1770@opindex fsyntax-only
74291a4b
MM
1771Check the code for syntax errors, but don't do anything beyond that.
1772
1773@item -pedantic
cd3bb277 1774@opindex pedantic
074e95e3
JM
1775Issue all the warnings demanded by strict ISO C and ISO C++;
1776reject all programs that use forbidden extensions, and some other
1777programs that do not follow ISO C and ISO C++. For ISO C, follows the
630d3d5a 1778version of the ISO C standard specified by any @option{-std} option used.
74291a4b 1779
074e95e3 1780Valid ISO C and ISO C++ programs should compile properly with or without
5490d604 1781this option (though a rare few will require @option{-ansi} or a
161d7b59 1782@option{-std} option specifying the required version of ISO C)@. However,
b1d16193
JL
1783without this option, certain GNU extensions and traditional C and C++
1784features are supported as well. With this option, they are rejected.
74291a4b 1785
630d3d5a 1786@option{-pedantic} does not cause warning messages for use of the
74291a4b
MM
1787alternate keywords whose names begin and end with @samp{__}. Pedantic
1788warnings are also disabled in the expression that follows
1789@code{__extension__}. However, only system header files should use
1790these escape routes; application programs should avoid them.
1791@xref{Alternate Keywords}.
1792
630d3d5a 1793Some users try to use @option{-pedantic} to check programs for strict ISO
74291a4b 1794C conformance. They soon find that it does not do quite what they want:
c1030c7c 1795it finds some non-ISO practices, but not all---only those for which
074e95e3
JM
1796ISO C @emph{requires} a diagnostic, and some others for which
1797diagnostics have been added.
74291a4b 1798
074e95e3 1799A feature to report any failure to conform to ISO C might be useful in
74291a4b 1800some instances, but would require considerable additional work and would
630d3d5a 1801be quite different from @option{-pedantic}. We don't have plans to
892d0a6d 1802support such a feature in the near future.
74291a4b 1803
91ea548a
JM
1804Where the standard specified with @option{-std} represents a GNU
1805extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
1806corresponding @dfn{base standard}, the version of ISO C on which the GNU
1807extended dialect is based. Warnings from @option{-pedantic} are given
1808where they are required by the base standard. (It would not make sense
1809for such warnings to be given only for features not in the specified GNU
1810C dialect, since by definition the GNU dialects of C include all
1811features the compiler supports with the given option, and there would be
1812nothing to warn about.)
1813
74291a4b 1814@item -pedantic-errors
cd3bb277 1815@opindex pedantic-errors
630d3d5a 1816Like @option{-pedantic}, except that errors are produced rather than
74291a4b
MM
1817warnings.
1818
1819@item -w
cd3bb277 1820@opindex w
74291a4b
MM
1821Inhibit all warning messages.
1822
1823@item -Wno-import
cd3bb277 1824@opindex Wno-import
74291a4b
MM
1825Inhibit warning messages about the use of @samp{#import}.
1826
1827@item -Wchar-subscripts
cd3bb277 1828@opindex Wchar-subscripts
74291a4b
MM
1829Warn if an array subscript has type @code{char}. This is a common cause
1830of error, as programmers often forget that this type is signed on some
1831machines.
1832
1833@item -Wcomment
cd3bb277 1834@opindex Wcomment
74291a4b
MM
1835Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
1836comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
1837
1838@item -Wformat
cd3bb277 1839@opindex Wformat
74291a4b
MM
1840Check calls to @code{printf} and @code{scanf}, etc., to make sure that
1841the arguments supplied have types appropriate to the format string
26f6672d
JM
1842specified, and that the conversions specified in the format string make
1843sense. This includes standard functions, and others specified by format
1844attributes (@pxref{Function Attributes}), in the @code{printf},
1845@code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
1846not in the C standard) families.
74291a4b 1847
8308e0b7
JM
1848The formats are checked against the format features supported by GNU
1849libc version 2.2. These include all ISO C89 and C99 features, as well
1850as features from the Single Unix Specification and some BSD and GNU
1851extensions. Other library implementations may not support all these
1852features; GCC does not support warning about features that go beyond a
630d3d5a
JM
1853particular library's limitations. However, if @option{-pedantic} is used
1854with @option{-Wformat}, warnings will be given about format features not
26f6672d
JM
1855in the selected standard version (but not for @code{strfmon} formats,
1856since those are not in any version of the C standard). @xref{C Dialect
1857Options,,Options Controlling C Dialect}.
8308e0b7 1858
630d3d5a
JM
1859@option{-Wformat} is included in @option{-Wall}. For more control over some
1860aspects of format checking, the options @option{-Wno-format-y2k},
1861@option{-Wno-format-extra-args}, @option{-Wformat-nonliteral},
1862@option{-Wformat-security} and @option{-Wformat=2} are available, but are
1863not included in @option{-Wall}.
4d808927
JM
1864
1865@item -Wno-format-y2k
cd3bb277 1866@opindex Wno-format-y2k
630d3d5a 1867If @option{-Wformat} is specified, do not warn about @code{strftime}
4d808927
JM
1868formats which may yield only a two-digit year.
1869
1870@item -Wno-format-extra-args
cd3bb277 1871@opindex Wno-format-extra-args
630d3d5a 1872If @option{-Wformat} is specified, do not warn about excess arguments to a
4d808927
JM
1873@code{printf} or @code{scanf} format function. The C standard specifies
1874that such arguments are ignored.
1875
7e5fb12f
JM
1876Where the unused arguments lie between used arguments that are
1877specified with @samp{$} operand number specifications, normally
1878warnings are still given, since the implementation could not know what
1879type to pass to @code{va_arg} to skip the unused arguments. However,
1880in the case of @code{scanf} formats, this option will suppress the
1881warning if the unused arguments are all pointers, since the Single
1882Unix Specification says that such unused arguments are allowed.
1883
4d808927 1884@item -Wformat-nonliteral
cd3bb277 1885@opindex Wformat-nonliteral
630d3d5a 1886If @option{-Wformat} is specified, also warn if the format string is not a
4d808927
JM
1887string literal and so cannot be checked, unless the format function
1888takes its format arguments as a @code{va_list}.
1889
c907e684 1890@item -Wformat-security
cd3bb277 1891@opindex Wformat-security
630d3d5a 1892If @option{-Wformat} is specified, also warn about uses of format
c907e684
JM
1893functions that represent possible security problems. At present, this
1894warns about calls to @code{printf} and @code{scanf} functions where the
1895format string is not a string literal and there are no format arguments,
1896as in @code{printf (foo);}. This may be a security hole if the format
1897string came from untrusted input and contains @samp{%n}. (This is
630d3d5a
JM
1898currently a subset of what @option{-Wformat-nonliteral} warns about, but
1899in future warnings may be added to @option{-Wformat-security} that are not
1900included in @option{-Wformat-nonliteral}.)
c907e684 1901
4d808927 1902@item -Wformat=2
cd3bb277 1903@opindex Wformat=2
630d3d5a
JM
1904Enable @option{-Wformat} plus format checks not included in
1905@option{-Wformat}. Currently equivalent to @samp{-Wformat
c907e684 1906-Wformat-nonliteral -Wformat-security}.
4d808927 1907
e9a25f70 1908@item -Wimplicit-int
cd3bb277 1909@opindex Wimplicit-int
e9a25f70
JL
1910Warn when a declaration does not specify a type.
1911
f5963e61
JL
1912@item -Wimplicit-function-declaration
1913@itemx -Werror-implicit-function-declaration
cd3bb277
JM
1914@opindex Wimplicit-function-declaration
1915@opindex Werror-implicit-function-declaration
f5963e61
JL
1916Give a warning (or error) whenever a function is used before being
1917declared.
e9a25f70 1918
74291a4b 1919@item -Wimplicit
cd3bb277 1920@opindex Wimplicit
630d3d5a 1921Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
861bb6c1
JL
1922
1923@item -Wmain
cd3bb277 1924@opindex Wmain
861bb6c1
JL
1925Warn if the type of @samp{main} is suspicious. @samp{main} should be a
1926function with external linkage, returning int, taking either zero
1927arguments, two, or three arguments of appropriate types.
4a870dba 1928
1f0c3120 1929@item -Wmissing-braces
cd3bb277 1930@opindex Wmissing-braces
1f0c3120
JM
1931Warn if an aggregate or union initializer is not fully bracketed. In
1932the following example, the initializer for @samp{a} is not fully
1933bracketed, but that for @samp{b} is fully bracketed.
1934
1935@smallexample
1936int a[2][2] = @{ 0, 1, 2, 3 @};
1937int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
1938@end smallexample
1939
74291a4b 1940@item -Wparentheses
cd3bb277 1941@opindex Wparentheses
74291a4b
MM
1942Warn if parentheses are omitted in certain contexts, such
1943as when there is an assignment in a context where a truth value
1944is expected, or when operators are nested whose precedence people
1945often get confused about.
1946
e9a25f70
JL
1947Also warn about constructions where there may be confusion to which
1948@code{if} statement an @code{else} branch belongs. Here is an example of
1949such a case:
1950
1951@smallexample
aee96fe9 1952@group
e9a25f70
JL
1953@{
1954 if (a)
1955 if (b)
1956 foo ();
1957 else
1958 bar ();
1959@}
aee96fe9 1960@end group
e9a25f70
JL
1961@end smallexample
1962
1963In C, every @code{else} branch belongs to the innermost possible @code{if}
1964statement, which in this example is @code{if (b)}. This is often not
1965what the programmer expected, as illustrated in the above example by
1966indentation the programmer chose. When there is the potential for this
f0523f02 1967confusion, GCC will issue a warning when this flag is specified.
e9a25f70
JL
1968To eliminate the warning, add explicit braces around the innermost
1969@code{if} statement so there is no way the @code{else} could belong to
1970the enclosing @code{if}. The resulting code would look like this:
1971
1972@smallexample
aee96fe9 1973@group
e9a25f70
JL
1974@{
1975 if (a)
1976 @{
1977 if (b)
1978 foo ();
1979 else
1980 bar ();
1981 @}
1982@}
aee96fe9 1983@end group
e9a25f70
JL
1984@end smallexample
1985
bb58bec5 1986@item -Wsequence-point
cd3bb277 1987@opindex Wsequence-point
bb58bec5
JM
1988Warn about code that may have undefined semantics because of violations
1989of sequence point rules in the C standard.
1990
1991The C standard defines the order in which expressions in a C program are
1992evaluated in terms of @dfn{sequence points}, which represent a partial
1993ordering between the execution of parts of the program: those executed
1994before the sequence point, and those executed after it. These occur
1995after the evaluation of a full expression (one which is not part of a
1996larger expression), after the evaluation of the first operand of a
1997@code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
1998function is called (but after the evaluation of its arguments and the
1999expression denoting the called function), and in certain other places.
2000Other than as expressed by the sequence point rules, the order of
2001evaluation of subexpressions of an expression is not specified. All
2002these rules describe only a partial order rather than a total order,
2003since, for example, if two functions are called within one expression
2004with no sequence point between them, the order in which the functions
2005are called is not specified. However, the standards committee have
2006ruled that function calls do not overlap.
2007
2008It is not specified when between sequence points modifications to the
2009values of objects take effect. Programs whose behavior depends on this
2010have undefined behavior; the C standard specifies that ``Between the
2011previous and next sequence point an object shall have its stored value
2012modified at most once by the evaluation of an expression. Furthermore,
2013the prior value shall be read only to determine the value to be
2014stored.''. If a program breaks these rules, the results on any
2015particular implementation are entirely unpredictable.
2016
2017Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
2018= b[n++]} and @code{a[i++] = i;}. Some more complicated cases are not
2019diagnosed by this option, and it may give an occasional false positive
2020result, but in general it has been found fairly effective at detecting
2021this sort of problem in programs.
2022
2023The present implementation of this option only works for C programs. A
2024future implementation may also work for C++ programs.
2025
9c34dbbf
ZW
2026The C standard is worded confusingly, therefore there is some debate
2027over the precise meaning of the sequence point rules in subtle cases.
2028Links to discussions of the problem, including proposed formal
2029definitions, may be found on our readings page, at
c5122d75 2030@w{@uref{http://gcc.gnu.org/readings.html}}.
bb58bec5 2031
74291a4b 2032@item -Wreturn-type
cd3bb277 2033@opindex Wreturn-type
32c4c36c
ML
2034Warn whenever a function is defined with a return-type that defaults to
2035@code{int}. Also warn about any @code{return} statement with no
02f52e19 2036return-value in a function whose return-type is not @code{void}.
32c4c36c
ML
2037
2038For C++, a function without return type always produces a diagnostic
767094dd 2039message, even when @option{-Wno-return-type} is specified. The only
32c4c36c 2040exceptions are @samp{main} and functions defined in system headers.
74291a4b
MM
2041
2042@item -Wswitch
cd3bb277 2043@opindex Wswitch
74291a4b
MM
2044Warn whenever a @code{switch} statement has an index of enumeral type
2045and lacks a @code{case} for one or more of the named codes of that
2046enumeration. (The presence of a @code{default} label prevents this
2047warning.) @code{case} labels outside the enumeration range also
2048provoke warnings when this option is used.
2049
2050@item -Wtrigraphs
cd3bb277 2051@opindex Wtrigraphs
f2ecb02d
JM
2052Warn if any trigraphs are encountered that might change the meaning of
2053the program (trigraphs within comments are not warned about).
74291a4b 2054
078721e1 2055@item -Wunused-function
cd3bb277 2056@opindex Wunused-function
078721e1
AC
2057Warn whenever a static function is declared but not defined or a
2058non\-inline static function is unused.
74291a4b 2059
078721e1 2060@item -Wunused-label
cd3bb277 2061@opindex Wunused-label
078721e1
AC
2062Warn whenever a label is declared but not used.
2063
2064To suppress this warning use the @samp{unused} attribute
2065(@pxref{Variable Attributes}).
2066
2067@item -Wunused-parameter
cd3bb277 2068@opindex Wunused-parameter
078721e1
AC
2069Warn whenever a function parameter is unused aside from its declaration.
2070
2071To suppress this warning use the @samp{unused} attribute
2072(@pxref{Variable Attributes}).
956d6950 2073
078721e1 2074@item -Wunused-variable
cd3bb277 2075@opindex Wunused-variable
078721e1
AC
2076Warn whenever a local variable or non-constant static variable is unused
2077aside from its declaration
2078
2079To suppress this warning use the @samp{unused} attribute
74291a4b
MM
2080(@pxref{Variable Attributes}).
2081
078721e1 2082@item -Wunused-value
cd3bb277 2083@opindex Wunused-value
078721e1
AC
2084Warn whenever a statement computes a result that is explicitly not used.
2085
2086To suppress this warning cast the expression to @samp{void}.
2087
2088@item -Wunused
cd3bb277 2089@opindex Wunused
630d3d5a 2090All all the above @option{-Wunused} options combined.
078721e1
AC
2091
2092In order to get a warning about an unused function parameter, you must
b192711e 2093either specify @samp{-W -Wunused} or separately specify
630d3d5a 2094@option{-Wunused-parameter}.
078721e1 2095
74291a4b 2096@item -Wuninitialized
cd3bb277 2097@opindex Wuninitialized
c5c76735
JL
2098Warn if an automatic variable is used without first being initialized or
2099if a variable may be clobbered by a @code{setjmp} call.
74291a4b
MM
2100
2101These warnings are possible only in optimizing compilation,
2102because they require data flow information that is computed only
630d3d5a 2103when optimizing. If you don't specify @option{-O}, you simply won't
74291a4b
MM
2104get these warnings.
2105
2106These warnings occur only for variables that are candidates for
2107register allocation. Therefore, they do not occur for a variable that
2108is declared @code{volatile}, or whose address is taken, or whose size
2109is other than 1, 2, 4 or 8 bytes. Also, they do not occur for
2110structures, unions or arrays, even when they are in registers.
2111
2112Note that there may be no warning about a variable that is used only
2113to compute a value that itself is never used, because such
2114computations may be deleted by data flow analysis before the warnings
2115are printed.
2116
0c2d1a2a 2117These warnings are made optional because GCC is not smart
74291a4b
MM
2118enough to see all the reasons why the code might be correct
2119despite appearing to have an error. Here is one example of how
2120this can happen:
2121
2122@smallexample
aee96fe9 2123@group
74291a4b
MM
2124@{
2125 int x;
2126 switch (y)
2127 @{
2128 case 1: x = 1;
2129 break;
2130 case 2: x = 4;
2131 break;
2132 case 3: x = 5;
2133 @}
2134 foo (x);
2135@}
aee96fe9 2136@end group
74291a4b
MM
2137@end smallexample
2138
2139@noindent
2140If the value of @code{y} is always 1, 2 or 3, then @code{x} is
0c2d1a2a 2141always initialized, but GCC doesn't know this. Here is
74291a4b
MM
2142another common case:
2143
2144@smallexample
2145@{
2146 int save_y;
2147 if (change_y) save_y = y, y = new_y;
2148 @dots{}
2149 if (change_y) y = save_y;
2150@}
2151@end smallexample
2152
2153@noindent
2154This has no bug because @code{save_y} is used only if it is set.
2155
20300b05 2156@cindex @code{longjmp} warnings
b192711e 2157This option also warns when a non-volatile automatic variable might be
c5c76735
JL
2158changed by a call to @code{longjmp}. These warnings as well are possible
2159only in optimizing compilation.
20300b05
GK
2160
2161The compiler sees only the calls to @code{setjmp}. It cannot know
2162where @code{longjmp} will be called; in fact, a signal handler could
2163call it at any point in the code. As a result, you may get a warning
2164even when there is in fact no problem because @code{longjmp} cannot
2165in fact be called at the place which would cause a problem.
2166
74291a4b
MM
2167Some spurious warnings can be avoided if you declare all the functions
2168you use that never return as @code{noreturn}. @xref{Function
2169Attributes}.
2170
aee96fe9 2171@item -Wreorder @r{(C++ only)}
cd3bb277 2172@opindex Wreorder
c5c76735
JL
2173@cindex reordering, warning
2174@cindex warning for reordering of member initializers
2175Warn when the order of member initializers given in the code does not
2176match the order in which they must be executed. For instance:
2177
d300e551 2178@item -Wunknown-pragmas
cd3bb277 2179@opindex Wunknown-pragmas
d300e551
NC
2180@cindex warning for unknown pragmas
2181@cindex unknown pragmas, warning
2182@cindex pragmas, warning of unknown
2183Warn when a #pragma directive is encountered which is not understood by
161d7b59 2184GCC@. If this command line option is used, warnings will even be issued
d300e551 2185for unknown pragmas in system header files. This is not the case if
630d3d5a 2186the warnings were only enabled by the @option{-Wall} command line option.
d300e551 2187
74291a4b 2188@item -Wall
cd3bb277 2189@opindex Wall
74291a4b
MM
2190All of the above @samp{-W} options combined. This enables all the
2191warnings about constructions that some users consider questionable, and
2192that are easy to avoid (or modify to prevent the warning), even in
2193conjunction with macros.
317639a8 2194
6c36d76b
NB
2195@item -Wdiv-by-zero
2196@opindex Wno-div-by-zero
2197@opindex Wdiv-by-zero
2198Warn about compile-time integer division by zero. This is default. To
2199inhibit the warning messages, use @option{-Wno-div-by-zero}. Floating
2200point division by zero is not warned about, as it can be a legitimate
2201way of obtaining infinities and NaNs.
2202
2203@item -Wmultichar
2204@opindex Wno-multichar
2205@opindex Wmultichar
2206Warn if a multicharacter constant (@samp{'FOOF'}) is used. This is
2207default. To inhibit the warning messages, use @option{-Wno-multichar}.
2208Usually they indicate a typo in the user's code, as they have
2209implementation-defined values, and should not be used in portable code.
2210
317639a8 2211@item -Wsystem-headers
cd3bb277 2212@opindex Wsystem-headers
317639a8
BC
2213@cindex warnings from system headers
2214@cindex system headers, warnings from
2215Print warning messages for constructs found in system header files.
2216Warnings from system headers are normally suppressed, on the assumption
2217that they usually do not indicate real problems and would only make the
2218compiler output harder to read. Using this command line option tells
2219GCC to emit warnings from system headers as if they occurred in user
630d3d5a 2220code. However, note that using @option{-Wall} in conjunction with this
317639a8 2221option will @emph{not} warn about unknown pragmas in system
630d3d5a 2222headers---for that, @option{-Wunknown-pragmas} must also be used.
74291a4b
MM
2223@end table
2224
630d3d5a 2225The following @option{-W@dots{}} options are not implied by @option{-Wall}.
74291a4b
MM
2226Some of them warn about constructions that users generally do not
2227consider questionable, but which occasionally you might wish to check
2228for; others warn about constructions that are necessary or hard to avoid
2229in some cases, and there is no simple way to modify the code to suppress
2230the warning.
2231
2642624b 2232@table @gcctabopt
74291a4b 2233@item -W
cd3bb277 2234@opindex W
74291a4b
MM
2235Print extra warning messages for these events:
2236
2237@itemize @bullet
74291a4b
MM
2238@item
2239A function can return either with or without a value. (Falling
2240off the end of the function body is considered returning without
2241a value.) For example, this function would evoke such a
2242warning:
2243
2244@smallexample
2245@group
2246foo (a)
2247@{
2248 if (a > 0)
2249 return a;
2250@}
2251@end group
2252@end smallexample
2253
2254@item
2255An expression-statement or the left-hand side of a comma expression
2256contains no side effects.
2257To suppress the warning, cast the unused expression to void.
2258For example, an expression such as @samp{x[i,j]} will cause a warning,
2259but @samp{x[(void)i,j]} will not.
2260
2261@item
2262An unsigned value is compared against zero with @samp{<} or @samp{<=}.
2263
2264@item
2265A comparison like @samp{x<=y<=z} appears; this is equivalent to
2266@samp{(x<=y ? 1 : 0) <= z}, which is a different interpretation from
2267that of ordinary mathematical notation.
2268
2269@item
2270Storage-class specifiers like @code{static} are not the first things in
2271a declaration. According to the C Standard, this usage is obsolescent.
2272
e0c9fbb7
JM
2273@item
2274The return type of a function has a type qualifier such as @code{const}.
2275Such a type qualifier has no effect, since the value returned by a
2276function is not an lvalue. (But don't warn about the GNU extension of
2277@code{volatile void} return types. That extension will be warned about
630d3d5a 2278if @option{-pedantic} is specified.)
e0c9fbb7 2279
74291a4b 2280@item
630d3d5a 2281If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
74291a4b
MM
2282arguments.
2283
e9a25f70
JL
2284@item
2285A comparison between signed and unsigned values could produce an
2286incorrect result when the signed value is converted to unsigned.
630d3d5a 2287(But don't warn if @option{-Wno-sign-compare} is also specified.)
e9a25f70 2288
74291a4b
MM
2289@item
2290An aggregate has a partly bracketed initializer.
2291For example, the following code would evoke such a warning,
2292because braces are missing around the initializer for @code{x.h}:
2293
2294@smallexample
2295struct s @{ int f, g; @};
2296struct t @{ struct s h; int i; @};
2297struct t x = @{ 1, 2, 3 @};
2298@end smallexample
dbde0d5d
BH
2299
2300@item
2301An aggregate has an initializer which does not initialize all members.
2302For example, the following code would cause such a warning, because
2303@code{x.h} would be implicitly initialized to zero:
2304
2305@smallexample
2306struct s @{ int f, g, h; @};
2307struct s x = @{ 3, 4 @};
2308@end smallexample
74291a4b
MM
2309@end itemize
2310
f793a95e 2311@item -Wfloat-equal
cd3bb277 2312@opindex Wfloat-equal
f793a95e
JL
2313Warn if floating point values are used in equality comparisons.
2314
488d3985
GK
2315The idea behind this is that sometimes it is convenient (for the
2316programmer) to consider floating-point values as approximations to
2317infinitely precise real numbers. If you are doing this, then you need
2318to compute (by analysing the code, or in some other way) the maximum or
2319likely maximum error that the computation introduces, and allow for it
2320when performing comparisons (and when producing output, but that's a
2321different problem). In particular, instead of testing for equality, you
2322would check to see whether the two values have ranges that overlap; and
2323this is done with the relational operators, so equality comparisons are
2324probably mistaken.
2325
aee96fe9 2326@item -Wtraditional @r{(C only)}
cd3bb277 2327@opindex Wtraditional
74291a4b 2328Warn about certain constructs that behave differently in traditional and
161d7b59 2329ISO C@. Also warn about ISO C constructs that have no traditional C
c8abc684 2330equivalent, and/or problematic constructs which should be avoided.
74291a4b
MM
2331
2332@itemize @bullet
2333@item
da312b55
NB
2334Macro parameters that appear within string literals in the macro body.
2335In traditional C macro replacement takes place within string literals,
161d7b59 2336but does not in ISO C@.
da312b55
NB
2337
2338@item
2339In traditional C, some preprocessor directives did not exist.
2340Traditional preprocessors would only consider a line to be a directive
2341if the @samp{#} appeared in column 1 on the line. Therefore
630d3d5a 2342@option{-Wtraditional} warns about directives that traditional C
da312b55
NB
2343understands but would ignore because the @samp{#} does not appear as the
2344first character on the line. It also suggests you hide directives like
2345@samp{#pragma} not understood by traditional C by indenting them. Some
c21cd8b1 2346traditional implementations would not recognize @samp{#elif}, so it
da312b55
NB
2347suggests avoiding it altogether.
2348
2349@item
2350A function-like macro that appears without arguments.
2351
2352@item
2353The unary plus operator.
2354
2355@item
c771326b
JM
2356The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
2357constant suffixes. (Traditional C does support the @samp{L} suffix on integer
da312b55 2358constants.) Note, these suffixes appear in macros defined in the system
e979f9e8 2359headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
c8abc684
KG
2360Use of these macros in user code might normally lead to spurious
2361warnings, however gcc's integrated preprocessor has enough context to
2362avoid warning in these cases.
74291a4b
MM
2363
2364@item
2365A function declared external in one block and then used after the end of
2366the block.
2367
2368@item
2369A @code{switch} statement has an operand of type @code{long}.
db838bb8
KG
2370
2371@item
2372A non-@code{static} function declaration follows a @code{static} one.
2373This construct is not accepted by some traditional C compilers.
48776cde
KG
2374
2375@item
c1030c7c 2376The ISO type of an integer constant has a different width or
48776cde 2377signedness from its traditional type. This warning is only issued if
e979f9e8 2378the base of the constant is ten. I.e.@: hexadecimal or octal values, which
48776cde 2379typically represent bit patterns, are not warned about.
bb66adca
KG
2380
2381@item
c1030c7c 2382Usage of ISO string concatenation is detected.
7f094a94 2383
895ea614
KG
2384@item
2385Initialization of automatic aggregates.
2386
2387@item
2388Identifier conflicts with labels. Traditional C lacks a separate
2389namespace for labels.
253b6b82
KG
2390
2391@item
2392Initialization of unions. If the initializer is zero, the warning is
2393omitted. This is done under the assumption that the zero initializer in
e979f9e8 2394user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
253b6b82
KG
2395initializer warnings and relies on default initialization to zero in the
2396traditional C case.
03829ad2
KG
2397
2398@item
3ed56f8a
KG
2399Conversions by prototypes between fixed/floating point values and vice
2400versa. The absence of these prototypes when compiling with traditional
2401C would cause serious problems. This is a subset of the possible
630d3d5a 2402conversion warnings, for the full set use @option{-Wconversion}.
74291a4b
MM
2403@end itemize
2404
861bb6c1 2405@item -Wundef
cd3bb277 2406@opindex Wundef
861bb6c1
JL
2407Warn if an undefined identifier is evaluated in an @samp{#if} directive.
2408
74291a4b 2409@item -Wshadow
cd3bb277 2410@opindex Wshadow
d773df5a
DB
2411Warn whenever a local variable shadows another local variable, parameter or
2412global variable or whenever a built-in function is shadowed.
74291a4b 2413
74291a4b 2414@item -Wlarger-than-@var{len}
cd3bb277 2415@opindex Wlarger-than
74291a4b
MM
2416Warn whenever an object of larger than @var{len} bytes is defined.
2417
2418@item -Wpointer-arith
cd3bb277 2419@opindex Wpointer-arith
74291a4b
MM
2420Warn about anything that depends on the ``size of'' a function type or
2421of @code{void}. GNU C assigns these types a size of 1, for
2422convenience in calculations with @code{void *} pointers and pointers
2423to functions.
2424
aee96fe9 2425@item -Wbad-function-cast @r{(C only)}
cd3bb277 2426@opindex Wbad-function-cast
74291a4b
MM
2427Warn whenever a function call is cast to a non-matching type.
2428For example, warn if @code{int malloc()} is cast to @code{anything *}.
2429
2430@item -Wcast-qual
cd3bb277 2431@opindex Wcast-qual
74291a4b
MM
2432Warn whenever a pointer is cast so as to remove a type qualifier from
2433the target type. For example, warn if a @code{const char *} is cast
2434to an ordinary @code{char *}.
2435
2436@item -Wcast-align
cd3bb277 2437@opindex Wcast-align
74291a4b
MM
2438Warn whenever a pointer is cast such that the required alignment of the
2439target is increased. For example, warn if a @code{char *} is cast to
2440an @code{int *} on machines where integers can only be accessed at
2441two- or four-byte boundaries.
2442
2443@item -Wwrite-strings
cd3bb277 2444@opindex Wwrite-strings
aee96fe9
JM
2445When compiling C, give string constants the type @code{const
2446char[@var{length}]} so that
74291a4b 2447copying the address of one into a non-@code{const} @code{char *}
aee96fe9
JM
2448pointer will get a warning; when compiling C++, warn about the
2449deprecated conversion from string constants to @code{char *}.
2450These warnings will help you find at
74291a4b
MM
2451compile time code that can try to write into a string constant, but
2452only if you have been very careful about using @code{const} in
2453declarations and prototypes. Otherwise, it will just be a nuisance;
630d3d5a 2454this is why we did not make @option{-Wall} request these warnings.
74291a4b
MM
2455
2456@item -Wconversion
cd3bb277 2457@opindex Wconversion
74291a4b
MM
2458Warn if a prototype causes a type conversion that is different from what
2459would happen to the same argument in the absence of a prototype. This
2460includes conversions of fixed point to floating and vice versa, and
2461conversions changing the width or signedness of a fixed point argument
2462except when the same as the default promotion.
2463
2464Also, warn if a negative integer constant expression is implicitly
2465converted to an unsigned type. For example, warn about the assignment
2466@code{x = -1} if @code{x} is unsigned. But do not warn about explicit
2467casts like @code{(unsigned) -1}.
2468
e9a25f70 2469@item -Wsign-compare
cd3bb277 2470@opindex Wsign-compare
e9a25f70
JL
2471@cindex warning for comparison of signed and unsigned values
2472@cindex comparison of signed and unsigned values, warning
2473@cindex signed and unsigned values, comparison warning
2474Warn when a comparison between signed and unsigned values could produce
2475an incorrect result when the signed value is converted to unsigned.
630d3d5a
JM
2476This warning is also enabled by @option{-W}; to get the other warnings
2477of @option{-W} without this warning, use @samp{-W -Wno-sign-compare}.
e9a25f70 2478
74291a4b 2479@item -Waggregate-return
cd3bb277 2480@opindex Waggregate-return
74291a4b
MM
2481Warn if any functions that return structures or unions are defined or
2482called. (In languages where you can return an array, this also elicits
2483a warning.)
2484
aee96fe9 2485@item -Wstrict-prototypes @r{(C only)}
cd3bb277 2486@opindex Wstrict-prototypes
74291a4b
MM
2487Warn if a function is declared or defined without specifying the
2488argument types. (An old-style function definition is permitted without
2489a warning if preceded by a declaration which specifies the argument
2490types.)
2491
aee96fe9 2492@item -Wmissing-prototypes @r{(C only)}
cd3bb277 2493@opindex Wmissing-prototypes
74291a4b
MM
2494Warn if a global function is defined without a previous prototype
2495declaration. This warning is issued even if the definition itself
2496provides a prototype. The aim is to detect global functions that fail
2497to be declared in header files.
2498
2499@item -Wmissing-declarations
cd3bb277 2500@opindex Wmissing-declarations
74291a4b
MM
2501Warn if a global function is defined without a previous declaration.
2502Do so even if the definition itself provides a prototype.
2503Use this option to detect global functions that are not declared in
2504header files.
2505
0ca3fb0a 2506@item -Wmissing-noreturn
cd3bb277 2507@opindex Wmissing-noreturn
0ca3fb0a
KG
2508Warn about functions which might be candidates for attribute @code{noreturn}.
2509Note these are only possible candidates, not absolute ones. Care should
2510be taken to manually verify functions actually do not ever return before
2511adding the @code{noreturn} attribute, otherwise subtle code generation
21c7361e
AJ
2512bugs could be introduced. You will not get a warning for @code{main} in
2513hosted C environments.
0ca3fb0a 2514
74ff4629 2515@item -Wmissing-format-attribute
cd3bb277
JM
2516@opindex Wmissing-format-attribute
2517@opindex Wformat
630d3d5a 2518If @option{-Wformat} is enabled, also warn about functions which might be
74ff4629
JM
2519candidates for @code{format} attributes. Note these are only possible
2520candidates, not absolute ones. GCC will guess that @code{format}
2521attributes might be appropriate for any function that calls a function
2522like @code{vprintf} or @code{vscanf}, but this might not always be the
2523case, and some functions for which @code{format} attributes are
2524appropriate may not be detected. This option has no effect unless
630d3d5a 2525@option{-Wformat} is enabled (possibly by @option{-Wall}).
74ff4629 2526
e23bd218
IR
2527@item -Wno-deprecated-declarations
2528@opindex Wno-deprecated-declarations
2529Do not warn about uses of functions, variables, and types marked as
2530deprecated by using the @code{deprecated} attribute.
2531(@pxref{Function Attributes}, @pxref{Variable Attributes},
2532@pxref{Type Attributes}.)
2533
3c12fcc2 2534@item -Wpacked
cd3bb277 2535@opindex Wpacked
3c12fcc2 2536Warn if a structure is given the packed attribute, but the packed
02f52e19 2537attribute has no effect on the layout or size of the structure.
3c12fcc2
GM
2538Such structures may be mis-aligned for little benefit. For
2539instance, in this code, the variable @code{f.x} in @code{struct bar}
2540will be misaligned even though @code{struct bar} does not itself
2541have the packed attribute:
2542
2543@smallexample
2544@group
2545struct foo @{
2546 int x;
2547 char a, b, c, d;
2548@} __attribute__((packed));
2549struct bar @{
2550 char z;
2551 struct foo f;
2552@};
2553@end group
2554@end smallexample
2555
2556@item -Wpadded
cd3bb277 2557@opindex Wpadded
3c12fcc2
GM
2558Warn if padding is included in a structure, either to align an element
2559of the structure or to align the whole structure. Sometimes when this
2560happens it is possible to rearrange the fields of the structure to
2561reduce the padding and so make the structure smaller.
2562
74291a4b 2563@item -Wredundant-decls
cd3bb277 2564@opindex Wredundant-decls
74291a4b
MM
2565Warn if anything is declared more than once in the same scope, even in
2566cases where multiple declaration is valid and changes nothing.
2567
aee96fe9 2568@item -Wnested-externs @r{(C only)}
cd3bb277 2569@opindex Wnested-externs
252215a7 2570Warn if an @code{extern} declaration is encountered within a function.
74291a4b 2571
312f6255 2572@item -Wunreachable-code
cd3bb277 2573@opindex Wunreachable-code
312f6255
GK
2574Warn if the compiler detects that code will never be executed.
2575
2576This option is intended to warn when the compiler detects that at
2577least a whole line of source code will never be executed, because
2578some condition is never satisfied or because it is after a
2579procedure that never returns.
2580
2581It is possible for this option to produce a warning even though there
2582are circumstances under which part of the affected line can be executed,
2583so care should be taken when removing apparently-unreachable code.
2584
2585For instance, when a function is inlined, a warning may mean that the
02f52e19 2586line is unreachable in only one inlined copy of the function.
312f6255 2587
630d3d5a 2588This option is not made part of @option{-Wall} because in a debugging
312f6255
GK
2589version of a program there is often substantial code which checks
2590correct functioning of the program and is, hopefully, unreachable
2591because the program does work. Another common use of unreachable
c21cd8b1 2592code is to provide behavior which is selectable at compile-time.
312f6255 2593
74291a4b 2594@item -Winline
cd3bb277 2595@opindex Winline
c5c76735 2596Warn if a function can not be inlined and it was declared as inline.
74291a4b 2597
795add94 2598@item -Wlong-long
cd3bb277
JM
2599@opindex Wlong-long
2600@opindex Wno-long-long
795add94 2601Warn if @samp{long long} type is used. This is default. To inhibit
630d3d5a
JM
2602the warning messages, use @option{-Wno-long-long}. Flags
2603@option{-Wlong-long} and @option{-Wno-long-long} are taken into account
2604only when @option{-pedantic} flag is used.
795add94 2605
18424ae1 2606@item -Wdisabled-optimization
cd3bb277 2607@opindex Wdisabled-optimization
18424ae1
BL
2608Warn if a requested optimization pass is disabled. This warning does
2609not generally indicate that there is anything wrong with your code; it
2610merely indicates that GCC's optimizers were unable to handle the code
2611effectively. Often, the problem is that your code is too big or too
2612complex; GCC will refuse to optimize programs when the optimization
2613itself is likely to take inordinate amounts of time.
2614
74291a4b 2615@item -Werror
cd3bb277 2616@opindex Werror
74291a4b
MM
2617Make all warnings into errors.
2618@end table
2619
2620@node Debugging Options
0c2d1a2a 2621@section Options for Debugging Your Program or GCC
74291a4b
MM
2622@cindex options, debugging
2623@cindex debugging information options
2624
0c2d1a2a 2625GCC has various special options that are used for debugging
74291a4b
MM
2626either your program or GCC:
2627
2642624b 2628@table @gcctabopt
74291a4b 2629@item -g
cd3bb277 2630@opindex g
74291a4b 2631Produce debugging information in the operating system's native format
161d7b59 2632(stabs, COFF, XCOFF, or DWARF)@. GDB can work with this debugging
74291a4b
MM
2633information.
2634
630d3d5a 2635On most systems that use stabs format, @option{-g} enables use of extra
74291a4b
MM
2636debugging information that only GDB can use; this extra information
2637makes debugging work better in GDB but will probably make other debuggers
2638crash or
2639refuse to read the program. If you want to control for certain whether
630d3d5a 2640to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
5f98259a
RK
2641@option{-gxcoff+}, @option{-gxcoff}, @option{-gdwarf-1+}, @option{-gdwarf-1},
2642or @option{-gvms} (see below).
74291a4b 2643
630d3d5a
JM
2644Unlike most other C compilers, GCC allows you to use @option{-g} with
2645@option{-O}. The shortcuts taken by optimized code may occasionally
74291a4b
MM
2646produce surprising results: some variables you declared may not exist
2647at all; flow of control may briefly move where you did not expect it;
2648some statements may not be executed because they compute constant
2649results or their values were already at hand; some statements may
2650execute in different places because they were moved out of loops.
2651
2652Nevertheless it proves possible to debug optimized output. This makes
2653it reasonable to use the optimizer for programs that might have bugs.
2654
0c2d1a2a 2655The following options are useful when GCC is generated with the
74291a4b
MM
2656capability for more than one debugging format.
2657
2658@item -ggdb
cd3bb277 2659@opindex ggdb
161d7b59 2660Produce debugging information for use by GDB@. This means to use the
861bb6c1
JL
2661most expressive format available (DWARF 2, stabs, or the native format
2662if neither of those are supported), including GDB extensions if at all
2663possible.
74291a4b
MM
2664
2665@item -gstabs
cd3bb277 2666@opindex gstabs
74291a4b
MM
2667Produce debugging information in stabs format (if that is supported),
2668without GDB extensions. This is the format used by DBX on most BSD
2669systems. On MIPS, Alpha and System V Release 4 systems this option
161d7b59 2670produces stabs debugging output which is not understood by DBX or SDB@.
74291a4b
MM
2671On System V Release 4 systems this option requires the GNU assembler.
2672
2673@item -gstabs+
cd3bb277 2674@opindex gstabs+
74291a4b 2675Produce debugging information in stabs format (if that is supported),
161d7b59 2676using GNU extensions understood only by the GNU debugger (GDB)@. The
74291a4b
MM
2677use of these extensions is likely to make other debuggers crash or
2678refuse to read the program.
2679
2680@item -gcoff
cd3bb277 2681@opindex gcoff
74291a4b
MM
2682Produce debugging information in COFF format (if that is supported).
2683This is the format used by SDB on most System V systems prior to
2684System V Release 4.
2685
2686@item -gxcoff
cd3bb277 2687@opindex gxcoff
74291a4b
MM
2688Produce debugging information in XCOFF format (if that is supported).
2689This is the format used by the DBX debugger on IBM RS/6000 systems.
2690
2691@item -gxcoff+
cd3bb277 2692@opindex gxcoff+
74291a4b 2693Produce debugging information in XCOFF format (if that is supported),
161d7b59 2694using GNU extensions understood only by the GNU debugger (GDB)@. The
74291a4b
MM
2695use of these extensions is likely to make other debuggers crash or
2696refuse to read the program, and may cause assemblers other than the GNU
2697assembler (GAS) to fail with an error.
2698
2699@item -gdwarf
cd3bb277 2700@opindex gdwarf
861bb6c1
JL
2701Produce debugging information in DWARF version 1 format (if that is
2702supported). This is the format used by SDB on most System V Release 4
2703systems.
74291a4b
MM
2704
2705@item -gdwarf+
cd3bb277 2706@opindex gdwarf+
861bb6c1
JL
2707Produce debugging information in DWARF version 1 format (if that is
2708supported), using GNU extensions understood only by the GNU debugger
161d7b59 2709(GDB)@. The use of these extensions is likely to make other debuggers
861bb6c1
JL
2710crash or refuse to read the program.
2711
2712@item -gdwarf-2
cd3bb277 2713@opindex gdwarf-2
861bb6c1
JL
2714Produce debugging information in DWARF version 2 format (if that is
2715supported). This is the format used by DBX on IRIX 6.
74291a4b 2716
5f98259a
RK
2717@item -gvms
2718@opindex gvms
2719Produce debugging information in VMS debug format (if that is
2720supported). This is the format used by DEBUG on VMS systems.
2721
74291a4b
MM
2722@item -g@var{level}
2723@itemx -ggdb@var{level}
2724@itemx -gstabs@var{level}
2725@itemx -gcoff@var{level}
2726@itemx -gxcoff@var{level}
2727@itemx -gdwarf@var{level}
861bb6c1 2728@itemx -gdwarf-2@var{level}
5f98259a 2729@itemx -gvms@var{level}
74291a4b
MM
2730Request debugging information and also use @var{level} to specify how
2731much information. The default level is 2.
2732
2733Level 1 produces minimal information, enough for making backtraces in
2734parts of the program that you don't plan to debug. This includes
2735descriptions of functions and external variables, but no information
2736about local variables and no line numbers.
2737
2738Level 3 includes extra information, such as all the macro definitions
2739present in the program. Some debuggers support macro expansion when
630d3d5a 2740you use @option{-g3}.
74291a4b
MM
2741
2742@cindex @code{prof}
2743@item -p
cd3bb277 2744@opindex p
74291a4b
MM
2745Generate extra code to write profile information suitable for the
2746analysis program @code{prof}. You must use this option when compiling
2747the source files you want data about, and you must also use it when
2748linking.
2749
2750@cindex @code{gprof}
2751@item -pg
cd3bb277 2752@opindex pg
74291a4b
MM
2753Generate extra code to write profile information suitable for the
2754analysis program @code{gprof}. You must use this option when compiling
2755the source files you want data about, and you must also use it when
2756linking.
2757
2758@cindex @code{tcov}
2759@item -a
cd3bb277 2760@opindex a
74291a4b
MM
2761Generate extra code to write profile information for basic blocks, which will
2762record the number of times each basic block is executed, the basic block start
630d3d5a 2763address, and the function name containing the basic block. If @option{-g} is
74291a4b
MM
2764used, the line number and filename of the start of the basic block will also be
2765recorded. If not overridden by the machine description, the default action is
2766to append to the text file @file{bb.out}.
2767
2768This data could be analyzed by a program like @code{tcov}. Note,
2769however, that the format of the data is not what @code{tcov} expects.
2770Eventually GNU @code{gprof} should be extended to process this data.
2771
898f531b 2772@item -Q
cd3bb277 2773@opindex Q
898f531b
JL
2774Makes the compiler print out each function name as it is compiled, and
2775print some statistics about each pass when it finishes.
2776
1f0c3120 2777@item -ftime-report
cd3bb277 2778@opindex ftime-report
1f0c3120
JM
2779Makes the compiler print some statistics about the time consumed by each
2780pass when it finishes.
2781
2782@item -fmem-report
cd3bb277 2783@opindex fmem-report
1f0c3120
JM
2784Makes the compiler print some statistics about permanent memory
2785allocation when it finishes.
2786
861bb6c1 2787@item -fprofile-arcs
cd3bb277 2788@opindex fprofile-arcs
3de87bf2
JJ
2789Instrument @dfn{arcs} during compilation to generate coverage data
2790or for profile-directed block ordering. During execution the program
2791records how many times each branch is executed and how many times it is
2792taken. When the compiled program exits it saves this data to a file
2793called @file{@var{sourcename}.da} for each source file.
2794
2795For profile-directed block ordering, compile the program with
2796@option{-fprofile-arcs} plus optimization and code generation options,
2797generate the arc profile information by running the program on a
2798selected workload, and then compile the program again with the same
2799optimization and code generation options plus
630d3d5a 2800@option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
3de87bf2
JJ
2801Control Optimization}).
2802
2803The other use of @option{-fprofile-arcs} is for use with @code{gcov},
2804when it is used with the @option{-ftest-coverage} option. GCC
2805supports two methods of determining code coverage: the options that
2806support @code{gcov}, and options @option{-a} and @option{-ax}, which
2807write information to text files. The options that support @code{gcov}
2808do not need to instrument every arc in the program, so a program compiled
2809with them runs faster than a program compiled with @option{-a}, which
2810adds instrumentation code to every basic block in the program. The
2811tradeoff: since @code{gcov} does not have execution counts for all
2812branches, it must start with the execution counts for the instrumented
2813branches, and then iterate over the program flow graph until the entire
2814graph has been solved. Hence, @code{gcov} runs a little more slowly than
2815a program which uses information from @option{-a} and @option{-ax}.
2816
2817With @option{-fprofile-arcs}, for each function of your program GCC
2818creates a program flow graph, then finds a spanning tree for the graph.
2819Only arcs that are not on the spanning tree have to be instrumented: the
2820compiler adds code to count the number of times that these arcs are
2821executed. When an arc is the only exit or only entrance to a block, the
2822instrumentation code can be added to the block; otherwise, a new basic
2823block must be created to hold the instrumentation code.
2824
2825This option makes it possible to estimate branch probabilities and to
2826calculate basic block execution counts. In general, basic block
2827execution counts as provided by @option{-a} do not give enough
2828information to estimate all branch probabilities.
861bb6c1
JL
2829
2830@need 2000
2831@item -ftest-coverage
cd3bb277 2832@opindex ftest-coverage
861bb6c1 2833Create data files for the @code{gcov} code-coverage utility
0c2d1a2a 2834(@pxref{Gcov,, @code{gcov}: a GCC Test Coverage Program}).
861bb6c1
JL
2835The data file names begin with the name of your source file:
2836
2642624b 2837@table @gcctabopt
861bb6c1
JL
2838@item @var{sourcename}.bb
2839A mapping from basic blocks to line numbers, which @code{gcov} uses to
2840associate basic block execution counts with line numbers.
2841
2842@item @var{sourcename}.bbg
2843A list of all arcs in the program flow graph. This allows @code{gcov}
2844to reconstruct the program flow graph, so that it can compute all basic
2845block and arc execution counts from the information in the
3de87bf2 2846@code{@var{sourcename}.da} file.
861bb6c1
JL
2847@end table
2848
3de87bf2
JJ
2849Use @option{-ftest-coverage} with @option{-fprofile-arcs}; the latter
2850option adds instrumentation to the program, which then writes
2851execution counts to another data file:
2852
2853@table @gcctabopt
2854@item @var{sourcename}.da
2855Runtime arc execution counts, used in conjunction with the arc
2856information in the file @code{@var{sourcename}.bbg}.
2857@end table
2858
2859Coverage data will map better to the source files if
2860@option{-ftest-coverage} is used without optimization.
2861
74291a4b 2862@item -d@var{letters}
cd3bb277 2863@opindex d
74291a4b
MM
2864Says to make debugging dumps during compilation at times specified by
2865@var{letters}. This is used for debugging the compiler. The file names
375e2d5c 2866for most of the dumps are made by appending a pass number and a word to
02f52e19 2867the source file name (e.g. @file{foo.c.00.rtl} or @file{foo.c.01.sibling}).
375e2d5c 2868Here are the possible letters for use in @var{letters}, and their meanings:
74291a4b
MM
2869
2870@table @samp
375e2d5c 2871@item A
cd3bb277 2872@opindex dA
375e2d5c 2873Annotate the assembler output with miscellaneous debugging information.
956d6950 2874@item b
cd3bb277 2875@opindex db
0b47e4c1 2876Dump after computing branch probabilities, to @file{@var{file}.14.bp}.
48d9ade5 2877@item B
cd3bb277 2878@opindex dB
0b47e4c1 2879Dump after block reordering, to @file{@var{file}.28.bbro}.
032713aa 2880@item c
cd3bb277 2881@opindex dc
0b47e4c1 2882Dump after instruction combination, to the file @file{@var{file}.16.combine}.
470fc13d 2883@item C
cd3bb277 2884@opindex dC
0b47e4c1 2885Dump after the first if conversion, to the file @file{@var{file}.17.ce}.
032713aa 2886@item d
cd3bb277 2887@opindex dd
0b47e4c1 2888Dump after delayed branch scheduling, to @file{@var{file}.31.dbr}.
032713aa 2889@item D
cd3bb277 2890@opindex dD
f5963e61
JL
2891Dump all macro definitions, at the end of preprocessing, in addition to
2892normal output.
48d9ade5 2893@item e
cd3bb277 2894@opindex de
0826f1d8 2895Dump after SSA optimizations, to @file{@var{file}.04.ssa} and
0b47e4c1 2896@file{@var{file}.07.ussa}.
470fc13d 2897@item E
cd3bb277 2898@opindex dE
0b47e4c1 2899Dump after the second if conversion, to @file{@var{file}.26.ce2}.
74291a4b 2900@item f
cd3bb277 2901@opindex df
0b47e4c1 2902Dump after life analysis, to @file{@var{file}.15.life}.
48d9ade5 2903@item F
cd3bb277 2904@opindex dF
0b47e4c1 2905Dump after purging @code{ADDRESSOF} codes, to @file{@var{file}.09.addressof}.
74291a4b 2906@item g
cd3bb277 2907@opindex dg
0b47e4c1 2908Dump after global register allocation, to @file{@var{file}.21.greg}.
0826f1d8
JL
2909@item h
2910@opindex dh
2911Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
2912@item o
cd3bb277 2913@opindex do
9c34dbbf 2914Dump after post-reload optimizations, to @file{@var{file}.22.postreload}.
02f52e19 2915@item G
cd3bb277 2916@opindex dG
0b47e4c1 2917Dump after GCSE, to @file{@var{file}.10.gcse}.
48d9ade5 2918@item i
cd3bb277 2919@opindex di
48d9ade5 2920Dump after sibling call optimizations, to @file{@var{file}.01.sibling}.
032713aa 2921@item j
cd3bb277 2922@opindex dj
0826f1d8 2923Dump after the first jump optimization, to @file{@var{file}.03.jump}.
74291a4b 2924@item k
cd3bb277 2925@opindex dk
0b47e4c1 2926Dump after conversion from registers to stack, to @file{@var{file}.32.stack}.
032713aa 2927@item l
cd3bb277 2928@opindex dl
0b47e4c1 2929Dump after local register allocation, to @file{@var{file}.20.lreg}.
032713aa 2930@item L
cd3bb277 2931@opindex dL
0b47e4c1 2932Dump after loop optimization, to @file{@var{file}.11.loop}.
032713aa 2933@item M
cd3bb277 2934@opindex dM
032713aa 2935Dump after performing the machine dependent reorganisation pass, to
0b47e4c1 2936@file{@var{file}.30.mach}.
48d9ade5 2937@item n
cd3bb277 2938@opindex dn
0b47e4c1 2939Dump after register renumbering, to @file{@var{file}.25.rnreg}.
032713aa 2940@item N
cd3bb277 2941@opindex dN
0b47e4c1 2942Dump after the register move pass, to @file{@var{file}.18.regmove}.
032713aa 2943@item r
cd3bb277 2944@opindex dr
375e2d5c 2945Dump after RTL generation, to @file{@var{file}.00.rtl}.
032713aa 2946@item R
cd3bb277 2947@opindex dR
9c34dbbf 2948Dump after the second scheduling pass, to @file{@var{file}.27.sched2}.
032713aa 2949@item s
cd3bb277 2950@opindex ds
032713aa 2951Dump after CSE (including the jump optimization that sometimes follows
0b47e4c1 2952CSE), to @file{@var{file}.08.cse}.
032713aa 2953@item S
cd3bb277 2954@opindex dS
9c34dbbf 2955Dump after the first scheduling pass, to @file{@var{file}.19.sched}.
032713aa 2956@item t
cd3bb277 2957@opindex dt
032713aa 2958Dump after the second CSE pass (including the jump optimization that
0b47e4c1 2959sometimes follows CSE), to @file{@var{file}.12.cse2}.
48d9ade5 2960@item w
cd3bb277 2961@opindex dw
0b47e4c1 2962Dump after the second flow pass, to @file{@var{file}.23.flow2}.
470fc13d 2963@item X
cd3bb277 2964@opindex dX
9c34dbbf 2965Dump after SSA dead code elimination, to @file{@var{file}.06.ssadce}.
48d9ade5 2966@item z
cd3bb277 2967@opindex dz
0b47e4c1 2968Dump after the peephole pass, to @file{@var{file}.24.peephole2}.
74291a4b 2969@item a
cd3bb277 2970@opindex da
74291a4b
MM
2971Produce all the dumps listed above.
2972@item m
cd3bb277 2973@opindex dm
74291a4b
MM
2974Print statistics on memory usage, at the end of the run, to
2975standard error.
2976@item p
cd3bb277 2977@opindex dp
74291a4b 2978Annotate the assembler output with a comment indicating which
f20b5577
MM
2979pattern and alternative was used. The length of each instruction is
2980also printed.
2856c3e3 2981@item P
cd3bb277 2982@opindex dP
2856c3e3 2983Dump the RTL in the assembler output as a comment before each instruction.
630d3d5a 2984Also turns on @option{-dp} annotation.
375e2d5c 2985@item v
cd3bb277 2986@opindex dv
375e2d5c
RH
2987For each of the other indicated dump files (except for
2988@file{@var{file}.00.rtl}), dump a representation of the control flow graph
b192711e 2989suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
62a1403d 2990@item x
cd3bb277 2991@opindex dx
62a1403d
AS
2992Just generate RTL for a function instead of compiling it. Usually used
2993with @samp{r}.
032713aa 2994@item y
cd3bb277 2995@opindex dy
032713aa 2996Dump debugging information during parsing, to standard error.
74291a4b
MM
2997@end table
2998
b707b450 2999@item -fdump-unnumbered
cd3bb277 3000@opindex fdump-unnumbered
695ac33f 3001When doing debugging dumps (see @option{-d} option above), suppress instruction
b707b450 3002numbers and line number note output. This makes it more feasible to
b192711e 3003use diff on debugging dumps for compiler invocations with different
695ac33f 3004options, in particular with and without @option{-g}.
b707b450 3005
aee96fe9 3006@item -fdump-class-hierarchy @r{(C++ only)}
22367161 3007@itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
cd3bb277 3008@opindex fdump-class-hierarchy
e76b4820 3009Dump a representation of each class's hierarchy and virtual function
767094dd 3010table layout to a file. The file name is made by appending @file{.class}
22367161
NS
3011to the source file name. If the @samp{-@var{options}} form is used,
3012@var{options} controls the details of the dump as described for the
3013@option{-fdump-tree} options.
3014
3015@item -fdump-tree-@var{switch} @r{(C++ only)}
3016@itemx -fdump-tree-@var{switch}-@var{options} @r{(C++ only)}
3017@opindex fdump-tree
3018Control the dumping at various stages of processing the intermediate
3019language tree to a file. The file name is generated by appending a switch
3020specific suffix to the source file name. If the @samp{-@var{options}}
3021form is used, @var{options} is a list of @samp{-} separated options that
3022control the details of the dump. Not all options are applicable to all
3023dumps, those which are not meaningful will be ignored. The following
3024options are available
f71f87f9 3025
e76b4820 3026@table @samp
22367161 3027@item address
767094dd 3028Print the address of each node. Usually this is not meaningful as it
22367161
NS
3029changes according to the environment and source file. Its primary use
3030is for tying up a dump file with a debug environment.
3031@item slim
3032Inhibit dumping of members of a scope or body of a function merely
3033because that scope has been reached. Only dump such items when they
3034are directly reachable by some other path.
3035@item all
3036Turn on all options.
e76b4820
NS
3037@end table
3038
3039The following tree dumps are possible:
3040@table @samp
3041@item original
3042Dump before any tree based optimization, to @file{@var{file}.original}.
3043@item optimized
3044Dump after all tree based optimization, to @file{@var{file}.optimized}.
6be77748 3045@item inlined
9c34dbbf 3046Dump after function inlining, to @file{@var{file}.inlined}.
e76b4820 3047@end table
9965d119 3048
74291a4b 3049@item -fpretend-float
cd3bb277 3050@opindex fpretend-float
74291a4b
MM
3051When running a cross-compiler, pretend that the target machine uses the
3052same floating point format as the host machine. This causes incorrect
3053output of the actual floating constants, but the actual instruction
0c2d1a2a 3054sequence will probably be the same as GCC would make when running on
74291a4b
MM
3055the target machine.
3056
3057@item -save-temps
cd3bb277 3058@opindex save-temps
74291a4b
MM
3059Store the usual ``temporary'' intermediate files permanently; place them
3060in the current directory and name them based on the source file. Thus,
3061compiling @file{foo.c} with @samp{-c -save-temps} would produce files
f2ecb02d
JM
3062@file{foo.i} and @file{foo.s}, as well as @file{foo.o}. This creates a
3063preprocessed @file{foo.i} output file even though the compiler now
3064normally uses an integrated preprocessor.
74291a4b 3065
03c41c05 3066@item -time
cd3bb277 3067@opindex time
03c41c05 3068Report the CPU time taken by each subprocess in the compilation
f2ecb02d
JM
3069sequence. For C source files, this is the compiler proper and assembler
3070(plus the linker if linking is done). The output looks like this:
03c41c05
ZW
3071
3072@smallexample
03c41c05
ZW
3073# cc1 0.12 0.01
3074# as 0.00 0.01
3075@end smallexample
3076
3077The first number on each line is the ``user time,'' that is time spent
3078executing the program itself. The second number is ``system time,''
3079time spent executing operating system routines on behalf of the program.
3080Both numbers are in seconds.
3081
74291a4b 3082@item -print-file-name=@var{library}
cd3bb277 3083@opindex print-file-name
74291a4b
MM
3084Print the full absolute name of the library file @var{library} that
3085would be used when linking---and don't do anything else. With this
0c2d1a2a 3086option, GCC does not compile or link anything; it just prints the
74291a4b
MM
3087file name.
3088
b1018de6
AO
3089@item -print-multi-directory
3090@opindex print-multi-directory
3091Print the directory name corresponding to the multilib selected by any
3092other switches present in the command line. This directory is supposed
3093to exist in @env{GCC_EXEC_PREFIX}.
3094
3095@item -print-multi-lib
3096@opindex print-multi-lib
3097Print the mapping from multilib directory names to compiler switches
3098that enable them. The directory name is separated from the switches by
3099@samp{;}, and each switch starts with an @samp{@@} instead of the
3100@samp{-}, without spaces between multiple switches. This is supposed to
3101ease shell-processing.
3102
74291a4b 3103@item -print-prog-name=@var{program}
cd3bb277 3104@opindex print-prog-name
630d3d5a 3105Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
74291a4b
MM
3106
3107@item -print-libgcc-file-name
cd3bb277 3108@opindex print-libgcc-file-name
630d3d5a 3109Same as @option{-print-file-name=libgcc.a}.
74291a4b 3110
630d3d5a 3111This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
74291a4b
MM
3112but you do want to link with @file{libgcc.a}. You can do
3113
3114@example
3115gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
3116@end example
3117
3118@item -print-search-dirs
cd3bb277 3119@opindex print-search-dirs
74291a4b
MM
3120Print the name of the configured installation directory and a list of
3121program and library directories gcc will search---and don't do anything else.
3122
3123This is useful when gcc prints the error message
3c0b7970
JM
3124@samp{installation problem, cannot exec cpp0: No such file or directory}.
3125To resolve this you either need to put @file{cpp0} and the other compiler
74291a4b 3126components where gcc expects to find them, or you can set the environment
bedc7537 3127variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
74291a4b
MM
3128Don't forget the trailing '/'.
3129@xref{Environment Variables}.
1f0c3120
JM
3130
3131@item -dumpmachine
cd3bb277 3132@opindex dumpmachine
1f0c3120
JM
3133Print the compiler's target machine (for example,
3134@samp{i686-pc-linux-gnu})---and don't do anything else.
3135
3136@item -dumpversion
cd3bb277 3137@opindex dumpversion
1f0c3120
JM
3138Print the compiler version (for example, @samp{3.0})---and don't do
3139anything else.
3140
3141@item -dumpspecs
cd3bb277 3142@opindex dumpspecs
1f0c3120
JM
3143Print the compiler's built-in specs---and don't do anything else. (This
3144is used when GCC itself is being built.) @xref{Spec Files}.
74291a4b
MM
3145@end table
3146
3147@node Optimize Options
3148@section Options That Control Optimization
3149@cindex optimize options
3150@cindex options, optimization
3151
3152These options control various sorts of optimizations:
3153
2642624b 3154@table @gcctabopt
74291a4b
MM
3155@item -O
3156@itemx -O1
cd3bb277
JM
3157@opindex O
3158@opindex O1
74291a4b
MM
3159Optimize. Optimizing compilation takes somewhat more time, and a lot
3160more memory for a large function.
3161
630d3d5a 3162Without @option{-O}, the compiler's goal is to reduce the cost of
74291a4b
MM
3163compilation and to make debugging produce the expected results.
3164Statements are independent: if you stop the program with a breakpoint
3165between statements, you can then assign a new value to any variable or
3166change the program counter to any other statement in the function and
3167get exactly the results you would expect from the source code.
3168
630d3d5a 3169With @option{-O}, the compiler tries to reduce code size and execution
9c34dbbf
ZW
3170time, without performing any optimizations that take a great deal of
3171compilation time.
74291a4b
MM
3172
3173@item -O2
cd3bb277 3174@opindex O2
0c2d1a2a 3175Optimize even more. GCC performs nearly all supported optimizations
74291a4b 3176that do not involve a space-speed tradeoff. The compiler does not
630d3d5a
JM
3177perform loop unrolling or function inlining when you specify @option{-O2}.
3178As compared to @option{-O}, this option increases both compilation time
74291a4b
MM
3179and the performance of the generated code.
3180
630d3d5a 3181@option{-O2} turns on all optional optimizations except for loop unrolling,
2b2a8f1f 3182function inlining, and register renaming. It also turns on the
630d3d5a 3183@option{-fforce-mem} option on all machines and frame pointer elimination
2b2a8f1f 3184on machines where doing so does not interfere with debugging.
74291a4b 3185
081ca317
BL
3186Please note the warning under @option{-fgcse} about
3187invoking @option{-O2} on programs that use computed gotos.
3188
74291a4b 3189@item -O3
cd3bb277 3190@opindex O3
630d3d5a
JM
3191Optimize yet more. @option{-O3} turns on all optimizations specified by
3192@option{-O2} and also turns on the @option{-finline-functions} and
3193@option{-frename-registers} options.
74291a4b
MM
3194
3195@item -O0
cd3bb277 3196@opindex O0
74291a4b
MM
3197Do not optimize.
3198
c6aded7c 3199@item -Os
cd3bb277 3200@opindex Os
630d3d5a 3201Optimize for size. @option{-Os} enables all @option{-O2} optimizations that
c6aded7c
AG
3202do not typically increase code size. It also performs further
3203optimizations designed to reduce code size.
3204
630d3d5a 3205If you use multiple @option{-O} options, with or without level numbers,
74291a4b
MM
3206the last such option is the one that is effective.
3207@end table
3208
630d3d5a 3209Options of the form @option{-f@var{flag}} specify machine-independent
74291a4b 3210flags. Most flags have both positive and negative forms; the negative
630d3d5a 3211form of @option{-ffoo} would be @option{-fno-foo}. In the table below,
74291a4b
MM
3212only one of the forms is listed---the one which is not the default.
3213You can figure out the other form by either removing @samp{no-} or
3214adding it.
3215
2642624b 3216@table @gcctabopt
74291a4b 3217@item -ffloat-store
cd3bb277 3218@opindex ffloat-store
74291a4b
MM
3219Do not store floating point variables in registers, and inhibit other
3220options that might change whether a floating point value is taken from a
3221register or memory.
3222
3223@cindex floating point precision
3224This option prevents undesirable excess precision on machines such as
3225the 68000 where the floating registers (of the 68881) keep more
3226precision than a @code{double} is supposed to have. Similarly for the
3227x86 architecture. For most programs, the excess precision does only
3228good, but a few programs rely on the precise definition of IEEE floating
630d3d5a 3229point. Use @option{-ffloat-store} for such programs, after modifying
6fd74494 3230them to store all pertinent intermediate computations into variables.
74291a4b
MM
3231
3232@item -fno-default-inline
cd3bb277 3233@opindex fno-default-inline
74291a4b
MM
3234Do not make member functions inline by default merely because they are
3235defined inside the class scope (C++ only). Otherwise, when you specify
630d3d5a 3236@w{@option{-O}}, member functions defined inside class scope are compiled
74291a4b
MM
3237inline by default; i.e., you don't need to add @samp{inline} in front of
3238the member function name.
3239
3240@item -fno-defer-pop
cd3bb277 3241@opindex fno-defer-pop
74291a4b
MM
3242Always pop the arguments to each function call as soon as that function
3243returns. For machines which must pop arguments after a function call,
3244the compiler normally lets arguments accumulate on the stack for several
3245function calls and pops them all at once.
3246
3247@item -fforce-mem
cd3bb277 3248@opindex fforce-mem
74291a4b
MM
3249Force memory operands to be copied into registers before doing
3250arithmetic on them. This produces better code by making all memory
3251references potential common subexpressions. When they are not common
3252subexpressions, instruction combination should eliminate the separate
630d3d5a 3253register-load. The @option{-O2} option turns on this option.
74291a4b
MM
3254
3255@item -fforce-addr
cd3bb277 3256@opindex fforce-addr
74291a4b
MM
3257Force memory address constants to be copied into registers before
3258doing arithmetic on them. This may produce better code just as
630d3d5a 3259@option{-fforce-mem} may.
74291a4b
MM
3260
3261@item -fomit-frame-pointer
cd3bb277 3262@opindex fomit-frame-pointer
74291a4b
MM
3263Don't keep the frame pointer in a register for functions that
3264don't need one. This avoids the instructions to save, set up and
3265restore frame pointers; it also makes an extra register available
3266in many functions. @strong{It also makes debugging impossible on
3267some machines.}
3268
8aeea6e6 3269On some machines, such as the VAX, this flag has no effect, because
74291a4b
MM
3270the standard calling sequence automatically handles the frame pointer
3271and nothing is saved by pretending it doesn't exist. The
3272machine-description macro @code{FRAME_POINTER_REQUIRED} controls
3273whether a target machine supports this flag. @xref{Registers,,Register
b11cc610 3274Usage, gccint, GNU Compiler Collection (GCC) Internals}.
74291a4b 3275
1aaef9c1 3276@item -foptimize-sibling-calls
cd3bb277 3277@opindex foptimize-sibling-calls
1aaef9c1
JH
3278Optimize sibling and tail recursive calls.
3279
91ce572a 3280@item -ftrapv
cd3bb277 3281@opindex ftrapv
91ce572a
CC
3282This option generates traps for signed overflow on addition, subtraction,
3283multiplication operations.
3284
74291a4b 3285@item -fno-inline
cd3bb277 3286@opindex fno-inline
74291a4b
MM
3287Don't pay attention to the @code{inline} keyword. Normally this option
3288is used to keep the compiler from expanding any functions inline.
3289Note that if you are not optimizing, no functions can be expanded inline.
3290
3291@item -finline-functions
cd3bb277 3292@opindex finline-functions
74291a4b
MM
3293Integrate all simple functions into their callers. The compiler
3294heuristically decides which functions are simple enough to be worth
3295integrating in this way.
3296
3297If all calls to a given function are integrated, and the function is
3298declared @code{static}, then the function is normally not output as
3299assembler code in its own right.
3300
efa3896a 3301@item -finline-limit=@var{n}
cd3bb277 3302@opindex finline-limit
f9e814f1
TP
3303By default, gcc limits the size of functions that can be inlined. This flag
3304allows the control of this limit for functions that are explicitly marked as
02f52e19
AJ
3305inline (ie marked with the inline keyword or defined within the class
3306definition in c++). @var{n} is the size of functions that can be inlined in
f9e814f1 3307number of pseudo instructions (not counting parameter handling). The default
93ee12c4
GP
3308value of @var{n} is 600.
3309Increasing this value can result in more inlined code at
f9e814f1 3310the cost of compilation time and memory consumption. Decreasing usually makes
02f52e19
AJ
3311the compilation faster and less code will be inlined (which presumably
3312means slower programs). This option is particularly useful for programs that
aee96fe9 3313use inlining heavily such as those based on recursive templates with C++.
f9e814f1
TP
3314
3315@emph{Note:} pseudo instruction represents, in this particular context, an
3316abstract measurement of function's size. In no way, it represents a count
3317of assembly instructions and as such its exact meaning might change from one
3318release to an another.
3319
74291a4b 3320@item -fkeep-inline-functions
cd3bb277 3321@opindex fkeep-inline-functions
74291a4b
MM
3322Even if all calls to a given function are integrated, and the function
3323is declared @code{static}, nevertheless output a separate run-time
3324callable version of the function. This switch does not affect
3325@code{extern inline} functions.
3326
3327@item -fkeep-static-consts
cd3bb277 3328@opindex fkeep-static-consts
74291a4b
MM
3329Emit variables declared @code{static const} when optimization isn't turned
3330on, even if the variables aren't referenced.
3331
0c2d1a2a 3332GCC enables this option by default. If you want to force the compiler to
74291a4b 3333check if the variable was referenced, regardless of whether or not
630d3d5a 3334optimization is turned on, use the @option{-fno-keep-static-consts} option.
74291a4b 3335
201556f0
JJ
3336@item -fmerge-constants
3337Attempt to merge identical constants (string constants and floating point
3338constants) accross compilation units.
3339
3340This option is default for optimized compilation if assembler and linker
c21cd8b1 3341support it. Use @option{-fno-merge-constants} to inhibit this behavior.
201556f0
JJ
3342
3343@item -fmerge-all-constants
3344Attempt to merge identical constants and identical variables.
3345
3346This option implies @option{-fmerge-constants}. In addition to
3347@option{-fmerge-constants} this considers e.g. even constant initialized
3348arrays or initialized constant variables with integral or floating point
3349types. Languages like C or C++ require each non-automatic variable to
3350have distinct location, so using this option will result in non-conforming
c21cd8b1 3351behavior.
201556f0 3352
74291a4b 3353@item -fno-function-cse
cd3bb277 3354@opindex fno-function-cse
74291a4b
MM
3355Do not put function addresses in registers; make each instruction that
3356calls a constant function contain the function's address explicitly.
3357
3358This option results in less efficient code, but some strange hacks
3359that alter the assembler output may be confused by the optimizations
3360performed when this option is not used.
3361
3362@item -ffast-math
cd3bb277 3363@opindex ffast-math
9c34dbbf
ZW
3364Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, and @*
3365@option{-fno-trapping-math}.
de6c5979 3366
630d3d5a 3367This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
74291a4b 3368
630d3d5a 3369This option should never be turned on by any @option{-O} option since
74291a4b 3370it can result in incorrect output for programs which depend on
c1030c7c 3371an exact implementation of IEEE or ISO rules/specifications for
74291a4b 3372math functions.
9605da8a
BL
3373
3374@item -fno-math-errno
cd3bb277 3375@opindex fno-math-errno
9605da8a
BL
3376Do not set ERRNO after calling math functions that are executed
3377with a single instruction, e.g., sqrt. A program that relies on
3378IEEE exceptions for math error handling may want to use this flag
3379for speed while maintaining IEEE arithmetic compatibility.
3380
630d3d5a 3381This option should never be turned on by any @option{-O} option since
de6c5979
BL
3382it can result in incorrect output for programs which depend on
3383an exact implementation of IEEE or ISO rules/specifications for
3384math functions.
3385
9c34dbbf 3386The default is @option{-fmath-errno}.
de6c5979
BL
3387
3388@item -funsafe-math-optimizations
cd3bb277 3389@opindex funsafe-math-optimizations
de6c5979
BL
3390Allow optimizations for floating-point arithmetic that (a) assume
3391that arguments and results are valid and (b) may violate IEEE or
237b14f7
RH
3392ANSI standards. When used at link-time, it may include libraries
3393or startup files that change the default FPU control word or other
3394similar optimizations.
de6c5979 3395
630d3d5a 3396This option should never be turned on by any @option{-O} option since
de6c5979
BL
3397it can result in incorrect output for programs which depend on
3398an exact implementation of IEEE or ISO rules/specifications for
3399math functions.
3400
9c34dbbf 3401The default is @option{-fno-unsafe-math-optimizations}.
de6c5979
BL
3402
3403@item -fno-trapping-math
cd3bb277 3404@opindex fno-trapping-math
de6c5979
BL
3405Compile code assuming that floating-point operations cannot generate
3406user-visible traps. Setting this option may allow faster code
3407if one relies on ``non-stop'' IEEE arithmetic, for example.
3408
630d3d5a 3409This option should never be turned on by any @option{-O} option since
de6c5979
BL
3410it can result in incorrect output for programs which depend on
3411an exact implementation of IEEE or ISO rules/specifications for
3412math functions.
3413
9c34dbbf 3414The default is @option{-ftrapping-math}.
74291a4b
MM
3415@end table
3416
630d3d5a
JM
3417The following options control specific optimizations. The @option{-O2}
3418option turns on all of these optimizations except @option{-funroll-loops}
3419and @option{-funroll-all-loops}. On most machines, the @option{-O} option
3420turns on the @option{-fthread-jumps} and @option{-fdelayed-branch} options,
74291a4b
MM
3421but specific machines may handle it differently.
3422
3423You can use the following flags in the rare cases when ``fine-tuning''
3424of optimizations to be performed is desired.
3425
9c34dbbf
ZW
3426Not all of the optimizations performed by GCC have @option{-f} options
3427to control them.
3428
ad919812 3429@table @gcctabopt
74291a4b 3430@item -fstrength-reduce
cd3bb277 3431@opindex fstrength-reduce
74291a4b
MM
3432Perform the optimizations of loop strength reduction and
3433elimination of iteration variables.
3434
3435@item -fthread-jumps
cd3bb277 3436@opindex fthread-jumps
74291a4b
MM
3437Perform optimizations where we check to see if a jump branches to a
3438location where another comparison subsumed by the first is found. If
3439so, the first branch is redirected to either the destination of the
3440second branch or a point immediately following it, depending on whether
3441the condition is known to be true or false.
3442
3443@item -fcse-follow-jumps
cd3bb277 3444@opindex fcse-follow-jumps
74291a4b
MM
3445In common subexpression elimination, scan through jump instructions
3446when the target of the jump is not reached by any other path. For
3447example, when CSE encounters an @code{if} statement with an
3448@code{else} clause, CSE will follow the jump when the condition
3449tested is false.
3450
3451@item -fcse-skip-blocks
cd3bb277 3452@opindex fcse-skip-blocks
630d3d5a 3453This is similar to @option{-fcse-follow-jumps}, but causes CSE to
74291a4b
MM
3454follow jumps which conditionally skip over blocks. When CSE
3455encounters a simple @code{if} statement with no else clause,
630d3d5a 3456@option{-fcse-skip-blocks} causes CSE to follow the jump around the
74291a4b
MM
3457body of the @code{if}.
3458
3459@item -frerun-cse-after-loop
cd3bb277 3460@opindex frerun-cse-after-loop
74291a4b
MM
3461Re-run common subexpression elimination after loop optimizations has been
3462performed.
3463
6d6d0fa0 3464@item -frerun-loop-opt
cd3bb277 3465@opindex frerun-loop-opt
6d6d0fa0
JL
3466Run the loop optimizer twice.
3467
7506f491 3468@item -fgcse
cd3bb277 3469@opindex fgcse
7506f491
DE
3470Perform a global common subexpression elimination pass.
3471This pass also performs global constant and copy propagation.
3472
081ca317
BL
3473@emph{Note:} When compiling a program using computed gotos, a GCC
3474extension, you may get better runtime performance if you disable
3475the global common subexpression elmination pass by adding
3476@option{-fno-gcse} to the command line.
3477
a13d4ebf 3478@item -fgcse-lm
cd3bb277 3479@opindex fgcse-lm
695ac33f 3480When @option{-fgcse-lm} is enabled, global common subexpression elimination will
767094dd 3481attempt to move loads which are only killed by stores into themselves. This
a13d4ebf 3482allows a loop containing a load/store sequence to be changed to a load outside
02f52e19 3483the loop, and a copy/store within the loop.
a13d4ebf
AM
3484
3485@item -fgcse-sm
cd3bb277 3486@opindex fgcse-sm
695ac33f 3487When @option{-fgcse-sm} is enabled, A store motion pass is run after global common
767094dd 3488subexpression elimination. This pass will attempt to move stores out of loops.
695ac33f 3489When used in conjunction with @option{-fgcse-lm}, loops containing a load/store sequence
a13d4ebf
AM
3490can be changed to a load before the loop and a store after the loop.
3491
b6d24183 3492@item -fdelete-null-pointer-checks
cd3bb277 3493@opindex fdelete-null-pointer-checks
9c34dbbf
ZW
3494Use global dataflow analysis to identify and eliminate useless checks
3495for null pointers. The compiler assumes that dereferencing a null
3496pointer would have halted the program. If a pointer is checked after
3497it has already been dereferenced, it cannot be null.
3498
3499In some environments, this assumption is not true, and programs can
3500safely dereference null pointers. Use
3501@option{-fno-delete-null-pointer-checks} to disable this optimization
3502for programs which depend on that behavior.
b6d24183 3503
74291a4b 3504@item -fexpensive-optimizations
cd3bb277 3505@opindex fexpensive-optimizations
74291a4b
MM
3506Perform a number of minor optimizations that are relatively expensive.
3507
639726ba 3508@item -foptimize-register-move
59d40964 3509@itemx -fregmove
cd3bb277
JM
3510@opindex foptimize-register-move
3511@opindex fregmove
9ec36da5
JL
3512Attempt to reassign register numbers in move instructions and as
3513operands of other simple instructions in order to maximize the amount of
56159047 3514register tying. This is especially helpful on machines with two-operand
630d3d5a 3515instructions. GCC enables this optimization by default with @option{-O2}
9ec36da5
JL
3516or higher.
3517
bedc7537 3518Note @option{-fregmove} and @option{-foptimize-register-move} are the same
9ec36da5
JL
3519optimization.
3520
74291a4b 3521@item -fdelayed-branch
cd3bb277 3522@opindex fdelayed-branch
74291a4b
MM
3523If supported for the target machine, attempt to reorder instructions
3524to exploit instruction slots available after delayed branch
3525instructions.
3526
3527@item -fschedule-insns
cd3bb277 3528@opindex fschedule-insns
74291a4b
MM
3529If supported for the target machine, attempt to reorder instructions to
3530eliminate execution stalls due to required data being unavailable. This
3531helps machines that have slow floating point or memory load instructions
3532by allowing other instructions to be issued until the result of the load
3533or floating point instruction is required.
3534
3535@item -fschedule-insns2
cd3bb277 3536@opindex fschedule-insns2
630d3d5a 3537Similar to @option{-fschedule-insns}, but requests an additional pass of
74291a4b
MM
3538instruction scheduling after register allocation has been done. This is
3539especially useful on machines with a relatively small number of
3540registers and where memory load instructions take more than one cycle.
3541
3542@item -ffunction-sections
59d40964 3543@itemx -fdata-sections
cd3bb277
JM
3544@opindex ffunction-sections
3545@opindex fdata-sections
7d0756fb
CM
3546Place each function or data item into its own section in the output
3547file if the target supports arbitrary sections. The name of the
3548function or the name of the data item determines the section's name
3549in the output file.
74291a4b 3550
7d0756fb 3551Use these options on systems where the linker can perform optimizations
74291a4b
MM
3552to improve locality of reference in the instruction space. HPPA
3553processors running HP-UX and Sparc processors running Solaris 2 have
3554linkers with such optimizations. Other systems using the ELF object format
3555as well as AIX may have these optimizations in the future.
3556
7d0756fb
CM
3557Only use these options when there are significant benefits from doing
3558so. When you specify these options, the assembler and linker will
74291a4b
MM
3559create larger object and executable files and will also be slower.
3560You will not be able to use @code{gprof} on all systems if you
3561specify this option and you may have problems with debugging if
630d3d5a 3562you specify both this option and @option{-g}.
74291a4b
MM
3563
3564@item -fcaller-saves
cd3bb277 3565@opindex fcaller-saves
74291a4b
MM
3566Enable values to be allocated in registers that will be clobbered by
3567function calls, by emitting extra instructions to save and restore the
3568registers around such calls. Such allocation is done only when it
3569seems to result in better code than would otherwise be produced.
3570
81610a0d
HPN
3571This option is always enabled by default on certain machines, usually
3572those which have no call-preserved registers to use instead.
3573
3574For all machines, optimization level 2 and higher enables this flag by
3575default.
74291a4b
MM
3576
3577@item -funroll-loops
cd3bb277 3578@opindex funroll-loops
9c34dbbf
ZW
3579Unroll loops whose number of iterations can be determined at compile
3580time or upon entry to the loop. @option{-funroll-loops} implies both
3581@option{-fstrength-reduce} and @option{-frerun-cse-after-loop}. This
3582option makes code larger, and may or may not make it run faster.
74291a4b
MM
3583
3584@item -funroll-all-loops
cd3bb277 3585@opindex funroll-all-loops
9c34dbbf
ZW
3586Unroll all loops, even if their number of iterations is uncertain when
3587the loop is entered. This usually makes programs run more slowly.
3588@option{-funroll-all-loops} implies the same options as
3589@option{-funroll-loops},
3590
0dd0e980
JH
3591@item -fprefetch-loop-arrays
3592@opindex fprefetch-loop-arrays
3593If supported by the target machine, generate instructions to prefetch
3594memory to improve the performance of loops that access large arrays.
74291a4b 3595
e5eb27e5 3596@item -fmove-all-movables
cd3bb277 3597@opindex fmove-all-movables
e5eb27e5
JL
3598Forces all invariant computations in loops to be moved
3599outside the loop.
3600
3601@item -freduce-all-givs
cd3bb277 3602@opindex freduce-all-givs
e5eb27e5
JL
3603Forces all general-induction variables in loops to be
3604strength-reduced.
3605
3606@emph{Note:} When compiling programs written in Fortran,
630d3d5a 3607@option{-fmove-all-movables} and @option{-freduce-all-givs} are enabled
e5eb27e5
JL
3608by default when you use the optimizer.
3609
3610These options may generate better or worse code; results are highly
3611dependent on the structure of loops within the source code.
3612
3613These two options are intended to be removed someday, once
3614they have helped determine the efficacy of various
3615approaches to improving loop optimizations.
3616
2642624b 3617Please let us (@w{@email{gcc@@gcc.gnu.org}} and @w{@email{fortran@@gnu.org}})
e5eb27e5
JL
3618know how use of these options affects
3619the performance of your production code.
3620We're very interested in code that runs @emph{slower}
3621when these options are @emph{enabled}.
3622
74291a4b 3623@item -fno-peephole
6cfc0341 3624@itemx -fno-peephole2
cd3bb277 3625@opindex fno-peephole
6cfc0341
RH
3626@opindex fno-peephole2
3627Disable any machine-specific peephole optimizations. The difference
630d3d5a 3628between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
6cfc0341
RH
3629are implemented in the compiler; some targets use one, some use the
3630other, a few use both.
861bb6c1
JL
3631
3632@item -fbranch-probabilities
cd3bb277 3633@opindex fbranch-probabilities
630d3d5a 3634After running a program compiled with @option{-fprofile-arcs}
861bb6c1 3635(@pxref{Debugging Options,, Options for Debugging Your Program or
bedc7537 3636@command{gcc}}), you can compile it a second time using
630d3d5a 3637@option{-fbranch-probabilities}, to improve optimizations based on
3de87bf2
JJ
3638the number of times each branch was taken. When the program
3639compiled with @option{-fprofile-arcs} exits it saves arc execution
3640counts to a file called @file{@var{sourcename}.da} for each source
3641file The information in this data file is very dependent on the
3642structure of the generated code, so you must use the same source code
3643and the same optimization options for both compilations.
861bb6c1 3644
630d3d5a 3645With @option{-fbranch-probabilities}, GCC puts a @samp{REG_EXEC_COUNT}
861bb6c1
JL
3646note on the first instruction of each basic block, and a
3647@samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
3648These can be used to improve optimization. Currently, they are only
3649used in one place: in @file{reorg.c}, instead of guessing which path a
3650branch is mostly to take, the @samp{REG_BR_PROB} values are used to
3651exactly determine which path is taken more often.
8c660648 3652
454d0cc7 3653@item -fno-guess-branch-probability
cd3bb277 3654@opindex fno-guess-branch-probability
9c34dbbf
ZW
3655Do not guess branch probabilities using a randomized model.
3656
3657Sometimes gcc will opt to use a randomized model to guess branch
3658probabilities, when none are available from either profiling feedback
3659(@option{-fprofile-arcs}) or @samp{__builtin_expect}. This means that
3660different runs of the compiler on the same program may produce different
3661object code.
3662
3663In a hard real-time system, people don't want different runs of the
3664compiler to produce code that has different behavior; minimizing
3665non-determinism is of paramount import. This switch allows users to
3666reduce non-determinism, possibly at the expense of inferior
3667optimization.
454d0cc7 3668
41472af8 3669@item -fstrict-aliasing
cd3bb277 3670@opindex fstrict-aliasing
41472af8
MM
3671Allows the compiler to assume the strictest aliasing rules applicable to
3672the language being compiled. For C (and C++), this activates
3673optimizations based on the type of expressions. In particular, an
3674object of one type is assumed never to reside at the same address as an
3675object of a different type, unless the types are almost the same. For
3676example, an @code{unsigned int} can alias an @code{int}, but not a
3677@code{void*} or a @code{double}. A character type may alias any other
02f52e19 3678type.
41472af8
MM
3679
3680Pay special attention to code like this:
3681@example
02f52e19 3682union a_union @{
41472af8
MM
3683 int i;
3684 double d;
3685@};
3686
3687int f() @{
3688 a_union t;
3689 t.d = 3.0;
3690 return t.i;
3691@}
3692@end example
3693The practice of reading from a different union member than the one most
3694recently written to (called ``type-punning'') is common. Even with
630d3d5a 3695@option{-fstrict-aliasing}, type-punning is allowed, provided the memory
41472af8
MM
3696is accessed through the union type. So, the code above will work as
3697expected. However, this code might not:
3698@example
02f52e19 3699int f() @{
41472af8
MM
3700 a_union t;
3701 int* ip;
3702 t.d = 3.0;
3703 ip = &t.i;
3704 return *ip;
3705@}
3706@end example
3707
41472af8
MM
3708Every language that wishes to perform language-specific alias analysis
3709should define a function that computes, given an @code{tree}
3710node, an alias set for the node. Nodes in different alias sets are not
3711allowed to alias. For an example, see the C front-end function
3712@code{c_get_alias_set}.
41472af8 3713
efa3896a
GK
3714@item -falign-functions
3715@itemx -falign-functions=@var{n}
cd3bb277 3716@opindex falign-functions
efa3896a
GK
3717Align the start of functions to the next power-of-two greater than
3718@var{n}, skipping up to @var{n} bytes. For instance,
630d3d5a
JM
3719@option{-falign-functions=32} aligns functions to the next 32-byte
3720boundary, but @option{-falign-functions=24} would align to the next
efa3896a
GK
372132-byte boundary only if this can be done by skipping 23 bytes or less.
3722
630d3d5a 3723@option{-fno-align-functions} and @option{-falign-functions=1} are
efa3896a
GK
3724equivalent and mean that functions will not be aligned.
3725
3726Some assemblers only support this flag when @var{n} is a power of two;
3727in that case, it is rounded up.
3728
3729If @var{n} is not specified, use a machine-dependent default.
3730
3731@item -falign-labels
3732@itemx -falign-labels=@var{n}
cd3bb277 3733@opindex falign-labels
efa3896a 3734Align all branch targets to a power-of-two boundary, skipping up to
630d3d5a 3735@var{n} bytes like @option{-falign-functions}. This option can easily
efa3896a
GK
3736make code slower, because it must insert dummy operations for when the
3737branch target is reached in the usual flow of the code.
3738
630d3d5a 3739If @option{-falign-loops} or @option{-falign-jumps} are applicable and
efa3896a
GK
3740are greater than this value, then their values are used instead.
3741
3742If @var{n} is not specified, use a machine-dependent default which is
3743very likely to be @samp{1}, meaning no alignment.
3744
3745@item -falign-loops
3746@itemx -falign-loops=@var{n}
cd3bb277 3747@opindex falign-loops
efa3896a 3748Align loops to a power-of-two boundary, skipping up to @var{n} bytes
630d3d5a 3749like @option{-falign-functions}. The hope is that the loop will be
efa3896a
GK
3750executed many times, which will make up for any execution of the dummy
3751operations.
3752
3753If @var{n} is not specified, use a machine-dependent default.
3754
3755@item -falign-jumps
3756@itemx -falign-jumps=@var{n}
cd3bb277 3757@opindex falign-jumps
efa3896a
GK
3758Align branch targets to a power-of-two boundary, for branch targets
3759where the targets can only be reached by jumping, skipping up to @var{n}
630d3d5a 3760bytes like @option{-falign-functions}. In this case, no dummy operations
efa3896a
GK
3761need be executed.
3762
3763If @var{n} is not specified, use a machine-dependent default.
3764
4bae0b47 3765@item -fssa
cd3bb277 3766@opindex fssa
4bae0b47
AS
3767Perform optimizations in static single assignment form. Each function's
3768flow graph is translated into SSA form, optimizations are performed, and
90ecce3e 3769the flow graph is translated back from SSA form. Users should not
b53978a3
JO
3770specify this option, since it is not yet ready for production use.
3771
0b47e4c1
JL
3772@item -fssa-ccp
3773@opindex fssa-ccp
3774Perform Sparse Conditional Constant Propagation in SSA form. Requires
3775@option{-fssa}. Like @option{-fssa}, this is an experimental feature.
3776
62d285ff
JL
3777@item -fssa-dce
3778@opindex fssa-dce
3779Perform aggressive dead-code elimination in SSA form. Requires @option{-fssa}.
3780Like @option{-fssa}, this is an experimental feature.
4bae0b47 3781
46d3a873 3782@item -fsingle-precision-constant
cd3bb277 3783@opindex fsingle-precision-constant
46d3a873
CC
3784Treat floating point constant as single precision constant instead of
3785implicitly converting it to double precision constant.
3786
2b2a8f1f 3787@item -frename-registers
cd3bb277 3788@opindex frename-registers
c771326b 3789Attempt to avoid false dependencies in scheduled code by making use
2b2a8f1f
RH
3790of registers left over after register allocation. This optimization
3791will most benefit processors with lots of registers. It can, however,
3792make debugging impossible, since variables will no longer stay in
3793a ``home register''.
3af64fd6 3794
8582c27b
RH
3795@item -fno-cprop-registers
3796@opindex fno-cprop-registers
3797After register allocation and post-register allocation instruction splitting,
3798we perform a copy-propagation pass to try to reduce scheduling dependencies
3799and occasionally eliminate the copy.
3800
3af64fd6 3801@item --param @var{name}=@var{value}
cd3bb277 3802@opindex param
3af64fd6
MM
3803In some places, GCC uses various constants to control the amount of
3804optimization that is done. For example, GCC will not inline functions
3805that contain more that a certain number of instructions. You can
3806control some of these constants on the command-line using the
630d3d5a 3807@option{--param} option.
3af64fd6 3808
4fe9b91c 3809In each case, the @var{value} is an integer. The allowable choices for
3af64fd6
MM
3810@var{name} are given in the following table:
3811
3812@table @gcctabopt
1c4c47db
JO
3813@item max-delay-slot-insn-search
3814The maximum number of instructions to consider when looking for an
3815instruction to fill a delay slot. If more than this arbitrary number of
3816instructions is searched, the time savings from filling the delay slot
3817will be minimal so stop searching. Increasing values mean more
3818aggressive optimization, making the compile time increase with probably
3819small improvement in executable run time.
3820
3821@item max-delay-slot-live-search
3822When trying to fill delay slots, the maximum number of instructions to
3823consider when searching for a block with valid live register
3824information. Increasing this arbitrarily chosen value means more
3825aggressive optimization, increasing the compile time. This parameter
3826should be removed when the delay slot code is rewritten to maintain the
3827control-flow graph.
33d3b05b
MM
3828
3829@item max-gcse-memory
3830The approximate maximum amount of memory that will be allocated in
3831order to perform the global common subexpression elimination
3832optimization. If more memory than specified is required, the
3833optimization will not be done.
3af64fd6 3834
740f35a0 3835@item max-gcse-passes
7dac2f89 3836The maximum number of passes of GCSE to run.
740f35a0 3837
4a121cc3 3838@item max-pending-list-length
0c688a7d 3839The maximum number of pending dependencies scheduling will allow
4a121cc3
AM
3840before flushing the current state and starting over. Large functions
3841with few branches or calls can create excessively large lists which
3842needlessly consume memory and resources.
3843
1c4c47db
JO
3844@item max-inline-insns
3845If an function contains more than this many instructions, it
3846will not be inlined. This option is precisely equivalent to
630d3d5a 3847@option{-finline-limit}.
1c4c47db
JO
3848
3849@end table
74291a4b
MM
3850@end table
3851
3852@node Preprocessor Options
3853@section Options Controlling the Preprocessor
3854@cindex preprocessor options
3855@cindex options, preprocessor
3856
3857These options control the C preprocessor, which is run on each C source
3858file before actual compilation.
3859
630d3d5a
JM
3860If you use the @option{-E} option, nothing is done except preprocessing.
3861Some of these options make sense only together with @option{-E} because
74291a4b
MM
3862they cause the preprocessor output to be unsuitable for actual
3863compilation.
3864
2642624b 3865@table @gcctabopt
74291a4b 3866@item -include @var{file}
cd3bb277 3867@opindex include
74291a4b 3868Process @var{file} as input before processing the regular input file.
630d3d5a
JM
3869In effect, the contents of @var{file} are compiled first. Any @option{-D}
3870and @option{-U} options on the command line are always processed before
3871@option{-include @var{file}}, regardless of the order in which they are
3872written. All the @option{-include} and @option{-imacros} options are
74291a4b
MM
3873processed in the order in which they are written.
3874
3875@item -imacros @var{file}
cd3bb277 3876@opindex imacros
74291a4b
MM
3877Process @var{file} as input, discarding the resulting output, before
3878processing the regular input file. Because the output generated from
630d3d5a 3879@var{file} is discarded, the only effect of @option{-imacros @var{file}}
74291a4b 3880is to make the macros defined in @var{file} available for use in the
630d3d5a 3881main input. All the @option{-include} and @option{-imacros} options are
e582248c 3882processed in the order in which they are written.
74291a4b
MM
3883
3884@item -idirafter @var{dir}
cd3bb277 3885@opindex idirafter
74291a4b
MM
3886@cindex second include path
3887Add the directory @var{dir} to the second include path. The directories
3888on the second include path are searched when a header file is not found
3889in any of the directories in the main include path (the one that
630d3d5a 3890@option{-I} adds to).
74291a4b
MM
3891
3892@item -iprefix @var{prefix}
cd3bb277 3893@opindex iprefix
630d3d5a 3894Specify @var{prefix} as the prefix for subsequent @option{-iwithprefix}
74291a4b
MM
3895options.
3896
3897@item -iwithprefix @var{dir}
cd3bb277 3898@opindex iwithprefix
74291a4b
MM
3899Add a directory to the second include path. The directory's name is
3900made by concatenating @var{prefix} and @var{dir}, where @var{prefix} was
630d3d5a 3901specified previously with @option{-iprefix}. If you have not specified a
74291a4b
MM
3902prefix yet, the directory containing the installed passes of the
3903compiler is used as the default.
3904
3905@item -iwithprefixbefore @var{dir}
cd3bb277 3906@opindex iwithprefixbefore
74291a4b
MM
3907Add a directory to the main include path. The directory's name is made
3908by concatenating @var{prefix} and @var{dir}, as in the case of
630d3d5a 3909@option{-iwithprefix}.
74291a4b
MM
3910
3911@item -isystem @var{dir}
cd3bb277 3912@opindex isystem
74291a4b
MM
3913Add a directory to the beginning of the second include path, marking it
3914as a system directory, so that it gets the same special treatment as
3915is applied to the standard system directories.
3916
3917@item -nostdinc
cd3bb277 3918@opindex nostdinc
74291a4b 3919Do not search the standard system directories for header files. Only
630d3d5a 3920the directories you have specified with @option{-I} options (and the
74291a4b 3921current directory, if appropriate) are searched. @xref{Directory
630d3d5a 3922Options}, for information on @option{-I}.
74291a4b 3923
dfb5868d
NS
3924By using both @option{-nostdinc} and @option{-I-}, you can limit the include-file
3925search path to only those directories you specify explicitly.
74291a4b 3926
e582248c 3927@item -remap
cd3bb277 3928@opindex remap
e582248c
NB
3929When searching for a header file in a directory, remap file names if a
3930file named @file{header.gcc} exists in that directory. This can be used
3931to work around limitations of file systems with file name restrictions.
3932The @file{header.gcc} file should contain a series of lines with two
3933tokens on each line: the first token is the name to map, and the second
3934token is the actual name to use.
3935
74291a4b 3936@item -undef
cd3bb277 3937@opindex undef
74291a4b
MM
3938Do not predefine any nonstandard macros. (Including architecture flags).
3939
3940@item -E
cd3bb277 3941@opindex E
74291a4b
MM
3942Run only the C preprocessor. Preprocess all the C source files
3943specified and output the results to standard output or to the
3944specified output file.
3945
3946@item -C
cd3bb277 3947@opindex C
74291a4b 3948Tell the preprocessor not to discard comments. Used with the
630d3d5a 3949@option{-E} option.
74291a4b
MM
3950
3951@item -P
cd3bb277 3952@opindex P
74291a4b 3953Tell the preprocessor not to generate @samp{#line} directives.
630d3d5a 3954Used with the @option{-E} option.
74291a4b
MM
3955
3956@cindex make
3957@cindex dependencies, make
3958@item -M
cd3bb277 3959@opindex M
e582248c
NB
3960Instead of outputting the result of preprocessing, output a rule
3961suitable for @code{make} describing the dependencies of the main source
3962file. The preprocessor outputs one @code{make} rule containing the
3963object file name for that source file, a colon, and the names of all the
48ce6bbb
NS
3964included files. Unless overridden explicitly, the object file name
3965consists of the basename of the source file with any suffix replaced with
767094dd 3966object file suffix. If there are many included files then the
48ce6bbb 3967rule is split into several lines using @samp{\}-newline.
74291a4b 3968
630d3d5a 3969@option{-M} implies @option{-E}.
74291a4b 3970
e582248c 3971@item -MM
cd3bb277 3972@opindex MM
630d3d5a 3973Like @option{-M}, but mention only the files included with @samp{#include
e582248c
NB
3974"@var{file}"}. System header files included with @samp{#include
3975<@var{file}>} are omitted.
3976
7da723ef 3977@item -MD
cd3bb277 3978@opindex MD
630d3d5a 3979Like @option{-M} but the dependency information is written to a file
7da723ef 3980rather than stdout. @code{gcc} will use the same file name and
695ac33f 3981directory as the object file, but with the suffix @file{.d} instead.
7da723ef 3982
630d3d5a
JM
3983This is in addition to compiling the main file as specified---@option{-MD}
3984does not inhibit ordinary compilation the way @option{-M} does,
3985unless you also specify @option{-MG}.
7da723ef
NB
3986
3987With Mach, you can use the utility @code{md} to merge multiple
3988dependency files into a single dependency file suitable for using with
3989the @samp{make} command.
3990
d396403a 3991@item -MMD
cd3bb277 3992@opindex MMD
630d3d5a 3993Like @option{-MD} except mention only user header files, not system
7da723ef
NB
3994-header files.
3995
e582248c 3996@item -MF @var{file}
cd3bb277 3997@opindex MF
630d3d5a 3998When used with @option{-M} or @option{-MM}, specifies a file to write the
e582248c 3999dependencies to. This allows the preprocessor to write the preprocessed
630d3d5a 4000file to stdout normally. If no @option{-MF} switch is given, CPP sends
e582248c
NB
4001the rules to stdout and suppresses normal preprocessed output.
4002
74291a4b 4003Another way to specify output of a @code{make} rule is by setting
bedc7537 4004the environment variable @env{DEPENDENCIES_OUTPUT} (@pxref{Environment
74291a4b
MM
4005Variables}).
4006
74291a4b 4007@item -MG
cd3bb277 4008@opindex MG
630d3d5a 4009When used with @option{-M} or @option{-MM}, @option{-MG} says to treat missing
e582248c
NB
4010header files as generated files and assume they live in the same
4011directory as the source file. It suppresses preprocessed output, as a
4012missing header file is ordinarily an error.
4013
4014This feature is used in automatic updating of makefiles.
4015
4016@item -MP
cd3bb277 4017@opindex MP
e582248c
NB
4018This option instructs CPP to add a phony target for each dependency
4019other than the main file, causing each to depend on nothing. These
4020dummy rules work around errors @code{make} gives if you remove header
4021files without updating the @code{Makefile} to match.
4022
4023This is typical output:-
4024
4025@smallexample
4026/tmp/test.o: /tmp/test.c /tmp/test.h
4027
4028/tmp/test.h:
4029@end smallexample
4030
4031@item -MQ @var{target}
4032@item -MT @var{target}
cd3bb277
JM
4033@opindex MQ
4034@opindex MT
e582248c
NB
4035By default CPP uses the main file name, including any path, and appends
4036the object suffix, normally ``.o'', to it to obtain the name of the
630d3d5a 4037target for dependency generation. With @option{-MT} you can specify a
e582248c
NB
4038target yourself, overriding the default one.
4039
4040If you want multiple targets, you can specify them as a single argument
630d3d5a 4041to @option{-MT}, or use multiple @option{-MT} options.
e582248c
NB
4042
4043The targets you specify are output in the order they appear on the
630d3d5a
JM
4044command line. @option{-MQ} is identical to @option{-MT}, except that the
4045target name is quoted for Make, but with @option{-MT} it isn't. For
4046example, @option{-MT '$(objpfx)foo.o'} gives
e582248c
NB
4047
4048@smallexample
4049$(objpfx)foo.o: /tmp/foo.c
4050@end smallexample
4051
630d3d5a 4052but @option{-MQ '$(objpfx)foo.o'} gives
e582248c
NB
4053
4054@smallexample
4055$$(objpfx)foo.o: /tmp/foo.c
4056@end smallexample
4057
4058The default target is automatically quoted, as if it were given with
630d3d5a 4059@option{-MQ}.
74291a4b
MM
4060
4061@item -H
cd3bb277 4062@opindex H
74291a4b
MM
4063Print the name of each header file used, in addition to other normal
4064activities.
4065
4066@item -A@var{question}(@var{answer})
cd3bb277 4067@opindex A
74291a4b
MM
4068Assert the answer @var{answer} for @var{question}, in case it is tested
4069with a preprocessing conditional such as @samp{#if
630d3d5a 4070#@var{question}(@var{answer})}. @option{-A-} disables the standard
74291a4b
MM
4071assertions that normally describe the target machine.
4072
4073@item -D@var{macro}
cd3bb277 4074@opindex D
74291a4b
MM
4075Define macro @var{macro} with the string @samp{1} as its definition.
4076
4077@item -D@var{macro}=@var{defn}
630d3d5a
JM
4078Define macro @var{macro} as @var{defn}. All instances of @option{-D} on
4079the command line are processed before any @option{-U} options.
74291a4b 4080
630d3d5a
JM
4081Any @option{-D} and @option{-U} options on the command line are processed in
4082order, and always before @option{-imacros @var{file}}, regardless of the
e582248c
NB
4083order in which they are written.
4084
74291a4b 4085@item -U@var{macro}
cd3bb277 4086@opindex U
630d3d5a
JM
4087Undefine macro @var{macro}. @option{-U} options are evaluated after all
4088@option{-D} options, but before any @option{-include} and @option{-imacros}
74291a4b
MM
4089options.
4090
630d3d5a
JM
4091Any @option{-D} and @option{-U} options on the command line are processed in
4092order, and always before @option{-imacros @var{file}}, regardless of the
e582248c
NB
4093order in which they are written.
4094
74291a4b 4095@item -dM
cd3bb277 4096@opindex dM
74291a4b 4097Tell the preprocessor to output only a list of the macro definitions
630d3d5a 4098that are in effect at the end of preprocessing. Used with the @option{-E}
74291a4b
MM
4099option.
4100
4101@item -dD
cd3bb277 4102@opindex dD
74291a4b
MM
4103Tell the preprocessing to pass all macro definitions into the output, in
4104their proper sequence in the rest of the output.
4105
4106@item -dN
cd3bb277 4107@opindex dN
630d3d5a 4108Like @option{-dD} except that the macro arguments and contents are omitted.
74291a4b
MM
4109Only @samp{#define @var{name}} is included in the output.
4110
e582248c 4111@item -dI
cd3bb277 4112@opindex dI
e582248c
NB
4113Output @samp{#include} directives in addition to the result of
4114preprocessing.
4115
3bce8a01
NB
4116@item -fpreprocessed
4117@opindex fpreprocessed
4118Indicate to the preprocessor that the input file has already been
4119preprocessed. This suppresses things like macro expansion, trigraph
4120conversion, escaped newline splicing, and processing of most directives.
6d34c1c4
NB
4121The preprocessor still recognizes and removes comments, so that you can
4122pass a file preprocessed with @option{-C} to the compiler without
4123problems. In this mode the integrated preprocessor is little more than
4124a tokenizer for the front ends.
3bce8a01 4125
630d3d5a 4126@option{-fpreprocessed} is implicit if the input file has one of the
6d34c1c4
NB
4127extensions @samp{i}, @samp{ii} or @samp{mi}. These are the extensions
4128that GCC uses for preprocessed files created by @option{-save-temps}.
3bce8a01 4129
74291a4b 4130@item -trigraphs
cd3bb277 4131@opindex trigraphs
e582248c
NB
4132Process ISO standard trigraph sequences. These are three-character
4133sequences, all starting with @samp{??}, that are defined by ISO C to
4134stand for single characters. For example, @samp{??/} stands for
4135@samp{\}, so @samp{'??/n'} is a character constant for a newline. By
4136default, GCC ignores trigraphs, but in standard-conforming modes it
630d3d5a 4137converts them. See the @option{-std} and @option{-ansi} options.
e582248c
NB
4138
4139The nine trigraph sequences are
4140@table @samp
4141@item ??(
aee96fe9 4142@expansion{} @samp{[}
e582248c
NB
4143
4144@item ??)
aee96fe9 4145@expansion{} @samp{]}
e582248c
NB
4146
4147@item ??<
aee96fe9 4148@expansion{} @samp{@{}
e582248c
NB
4149
4150@item ??>
aee96fe9 4151@expansion{} @samp{@}}
e582248c
NB
4152
4153@item ??=
aee96fe9 4154@expansion{} @samp{#}
e582248c
NB
4155
4156@item ??/
aee96fe9 4157@expansion{} @samp{\}
e582248c
NB
4158
4159@item ??'
aee96fe9 4160@expansion{} @samp{^}
e582248c
NB
4161
4162@item ??!
aee96fe9 4163@expansion{} @samp{|}
e582248c
NB
4164
4165@item ??-
aee96fe9 4166@expansion{} @samp{~}
e582248c
NB
4167
4168@end table
4169
4170Trigraph support is not popular, so many compilers do not implement it
4171properly. Portable code should not rely on trigraphs being either
4172converted or ignored.
74291a4b 4173
aee96fe9 4174@item -Wp,@var{option}
cd3bb277 4175@opindex Wp
bedc7537 4176Pass @var{option} as an option to the preprocessor. If @var{option}
74291a4b
MM
4177contains commas, it is split into multiple options at the commas.
4178@end table
4179
4180@node Assembler Options
4181@section Passing Options to the Assembler
4182
4183@c prevent bad page break with this line
4184You can pass options to the assembler.
4185
2642624b 4186@table @gcctabopt
aee96fe9 4187@item -Wa,@var{option}
cd3bb277 4188@opindex Wa
74291a4b
MM
4189Pass @var{option} as an option to the assembler. If @var{option}
4190contains commas, it is split into multiple options at the commas.
4191@end table
4192
4193@node Link Options
4194@section Options for Linking
4195@cindex link options
4196@cindex options, linking
4197
4198These options come into play when the compiler links object files into
4199an executable output file. They are meaningless if the compiler is
4200not doing a link step.
4201
2642624b 4202@table @gcctabopt
74291a4b
MM
4203@cindex file names
4204@item @var{object-file-name}
4205A file name that does not end in a special recognized suffix is
4206considered to name an object file or library. (Object files are
4207distinguished from libraries by the linker according to the file
4208contents.) If linking is done, these object files are used as input
4209to the linker.
4210
4211@item -c
4212@itemx -S
4213@itemx -E
cd3bb277
JM
4214@opindex c
4215@opindex S
4216@opindex E
74291a4b
MM
4217If any of these options is used, then the linker is not run, and
4218object file names should not be used as arguments. @xref{Overall
4219Options}.
4220
4221@cindex Libraries
4222@item -l@var{library}
4275c4c4 4223@itemx -l @var{library}
cd3bb277 4224@opindex l
4275c4c4
JS
4225Search the library named @var{library} when linking. (The second
4226alternative with the library as a separate argument is only for
4227POSIX compliance and is not recommended.)
74291a4b
MM
4228
4229It makes a difference where in the command you write this option; the
4275c4c4 4230linker searches and processes libraries and object files in the order they
74291a4b
MM
4231are specified. Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
4232after file @file{foo.o} but before @file{bar.o}. If @file{bar.o} refers
4233to functions in @samp{z}, those functions may not be loaded.
4234
4235The linker searches a standard list of directories for the library,
4236which is actually a file named @file{lib@var{library}.a}. The linker
4237then uses this file as if it had been specified precisely by name.
4238
4239The directories searched include several standard system directories
630d3d5a 4240plus any that you specify with @option{-L}.
74291a4b
MM
4241
4242Normally the files found this way are library files---archive files
4243whose members are object files. The linker handles an archive file by
4244scanning through it for members which define symbols that have so far
4245been referenced but not defined. But if the file that is found is an
4246ordinary object file, it is linked in the usual fashion. The only
630d3d5a
JM
4247difference between using an @option{-l} option and specifying a file name
4248is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
74291a4b
MM
4249and searches several directories.
4250
4251@item -lobjc
cd3bb277 4252@opindex lobjc
630d3d5a 4253You need this special case of the @option{-l} option in order to
2147b154 4254link an Objective-C program.
74291a4b
MM
4255
4256@item -nostartfiles
cd3bb277 4257@opindex nostartfiles
74291a4b 4258Do not use the standard system startup files when linking.
bedc7537
NC
4259The standard system libraries are used normally, unless @option{-nostdlib}
4260or @option{-nodefaultlibs} is used.
74291a4b
MM
4261
4262@item -nodefaultlibs
cd3bb277 4263@opindex nodefaultlibs
74291a4b
MM
4264Do not use the standard system libraries when linking.
4265Only the libraries you specify will be passed to the linker.
bedc7537 4266The standard startup files are used normally, unless @option{-nostartfiles}
4754172c 4267is used. The compiler may generate calls to memcmp, memset, and memcpy
c1030c7c 4268for System V (and ISO C) environments or to bcopy and bzero for
4754172c
CM
4269BSD environments. These entries are usually resolved by entries in
4270libc. These entry points should be supplied through some other
4271mechanism when this option is specified.
74291a4b
MM
4272
4273@item -nostdlib
cd3bb277 4274@opindex nostdlib
74291a4b
MM
4275Do not use the standard system startup files or libraries when linking.
4276No startup files and only the libraries you specify will be passed to
767094dd 4277the linker. The compiler may generate calls to memcmp, memset, and memcpy
c1030c7c 4278for System V (and ISO C) environments or to bcopy and bzero for
4754172c
CM
4279BSD environments. These entries are usually resolved by entries in
4280libc. These entry points should be supplied through some other
4281mechanism when this option is specified.
74291a4b 4282
630d3d5a
JM
4283@cindex @option{-lgcc}, use with @option{-nostdlib}
4284@cindex @option{-nostdlib} and unresolved references
4285@cindex unresolved references and @option{-nostdlib}
4286@cindex @option{-lgcc}, use with @option{-nodefaultlibs}
4287@cindex @option{-nodefaultlibs} and unresolved references
4288@cindex unresolved references and @option{-nodefaultlibs}
4289One of the standard libraries bypassed by @option{-nostdlib} and
4290@option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
0c2d1a2a 4291that GCC uses to overcome shortcomings of particular machines, or special
74291a4b 4292needs for some languages.
b11cc610
JM
4293(@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
4294Collection (GCC) Internals},
74291a4b 4295for more discussion of @file{libgcc.a}.)
74291a4b 4296In most cases, you need @file{libgcc.a} even when you want to avoid
630d3d5a
JM
4297other standard libraries. In other words, when you specify @option{-nostdlib}
4298or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
0c2d1a2a 4299This ensures that you have no unresolved references to internal GCC
74291a4b 4300library subroutines. (For example, @samp{__main}, used to ensure C++
b11cc610
JM
4301constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
4302GNU Compiler Collection (GCC) Internals}.)
74291a4b
MM
4303
4304@item -s
cd3bb277 4305@opindex s
74291a4b
MM
4306Remove all symbol table and relocation information from the executable.
4307
4308@item -static
cd3bb277 4309@opindex static
74291a4b
MM
4310On systems that support dynamic linking, this prevents linking with the shared
4311libraries. On other systems, this option has no effect.
4312
4313@item -shared
cd3bb277 4314@opindex shared
74291a4b 4315Produce a shared object which can then be linked with other objects to
1d3b0e2c 4316form an executable. Not all systems support this option. For predictable
02f52e19 4317results, you must also specify the same set of options that were used to
630d3d5a 4318generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
2642624b 4319when you specify this option.@footnote{On some systems, @samp{gcc -shared}
767094dd 4320needs to build supplementary stub code for constructors to work. On
2642624b 4321multi-libbed systems, @samp{gcc -shared} must select the correct support
1d3b0e2c 4322libraries to link against. Failing to supply the correct flags may lead
767094dd 4323to subtle defects. Supplying them in cases where they are not necessary
1d3b0e2c 4324is innocuous.}
74291a4b 4325
9db0819e
RH
4326@item -shared-libgcc
4327@itemx -static-libgcc
cd3bb277
JM
4328@opindex shared-libgcc
4329@opindex static-libgcc
9db0819e
RH
4330On systems that provide @file{libgcc} as a shared library, these options
4331force the use of either the shared or static version respectively.
4332If no shared version of @file{libgcc} was built when the compiler was
4333configured, these options have no effect.
4334
4335There are several situations in which an application should use the
4336shared @file{libgcc} instead of the static version. The most common
4337of these is when the application wishes to throw and catch exceptions
4338across different shared libraries. In that case, each of the libraries
4339as well as the application itself should use the shared @file{libgcc}.
4340
630d3d5a
JM
4341Therefore, whenever you specify the @option{-shared} option, the GCC
4342driver automatically adds @option{-shared-libgcc}, unless you explicitly
4343specify @option{-static-libgcc}. The G++ driver automatically adds
4344@option{-shared-libgcc} when you build a main executable as well because
049f6ec9
MM
4345for C++ programs that is typically the right thing to do.
4346(Exception-handling will not work reliably otherwise.)
4347
4348However, when linking a main executable written in C, you must
630d3d5a 4349explicitly say @option{-shared-libgcc} if you want to use the shared
049f6ec9 4350@file{libgcc}.
9db0819e 4351
74291a4b 4352@item -symbolic
cd3bb277 4353@opindex symbolic
74291a4b
MM
4354Bind references to global symbols when building a shared object. Warn
4355about any unresolved references (unless overridden by the link editor
4356option @samp{-Xlinker -z -Xlinker defs}). Only a few systems support
4357this option.
4358
4359@item -Xlinker @var{option}
cd3bb277 4360@opindex Xlinker
74291a4b 4361Pass @var{option} as an option to the linker. You can use this to
0c2d1a2a 4362supply system-specific linker options which GCC does not know how to
74291a4b
MM
4363recognize.
4364
4365If you want to pass an option that takes an argument, you must use
630d3d5a
JM
4366@option{-Xlinker} twice, once for the option and once for the argument.
4367For example, to pass @option{-assert definitions}, you must write
74291a4b 4368@samp{-Xlinker -assert -Xlinker definitions}. It does not work to write
630d3d5a 4369@option{-Xlinker "-assert definitions"}, because this passes the entire
74291a4b
MM
4370string as a single argument, which is not what the linker expects.
4371
aee96fe9 4372@item -Wl,@var{option}
cd3bb277 4373@opindex Wl
74291a4b
MM
4374Pass @var{option} as an option to the linker. If @var{option} contains
4375commas, it is split into multiple options at the commas.
4376
4377@item -u @var{symbol}
cd3bb277 4378@opindex u
74291a4b 4379Pretend the symbol @var{symbol} is undefined, to force linking of
630d3d5a 4380library modules to define it. You can use @option{-u} multiple times with
74291a4b
MM
4381different symbols to force loading of additional library modules.
4382@end table
4383
4384@node Directory Options
4385@section Options for Directory Search
4386@cindex directory options
4387@cindex options, directory search
4388@cindex search path
4389
4390These options specify directories to search for header files, for
4391libraries and for parts of the compiler:
4392
2642624b 4393@table @gcctabopt
74291a4b 4394@item -I@var{dir}
cd3bb277 4395@opindex I
861bb6c1
JL
4396Add the directory @var{dir} to the head of the list of directories to be
4397searched for header files. This can be used to override a system header
4398file, substituting your own version, since these directories are
d0a5eb32
RK
4399searched before the system header file directories. However, you should
4400not use this option to add directories that contain vendor-supplied
767094dd 4401system header files (use @option{-isystem} for that). If you use more than
630d3d5a 4402one @option{-I} option, the directories are scanned in left-to-right
74291a4b
MM
4403order; the standard system directories come after.
4404
dbead49c
NS
4405If a standard system include directory, or a directory specified with
4406@option{-isystem}, is also specified with @option{-I}, it will be
4407searched only in the position requested by @option{-I}. Also, it will
4408not be considered a system include directory. If that directory really
4409does contain system headers, there is a good chance that they will
4410break. For instance, if GCC's installation procedure edited the headers
4411in @file{/usr/include} to fix bugs, @samp{-I/usr/include} will cause the
4412original, buggy headers to be found instead of the corrected ones. GCC
4413will issue a warning when a system include directory is hidden in this
4414way.
4415
74291a4b 4416@item -I-
cd3bb277 4417@opindex I-
630d3d5a 4418Any directories you specify with @option{-I} options before the @option{-I-}
74291a4b
MM
4419option are searched only for the case of @samp{#include "@var{file}"};
4420they are not searched for @samp{#include <@var{file}>}.
4421
630d3d5a
JM
4422If additional directories are specified with @option{-I} options after
4423the @option{-I-}, these directories are searched for all @samp{#include}
4424directives. (Ordinarily @emph{all} @option{-I} directories are used
74291a4b
MM
4425this way.)
4426
630d3d5a 4427In addition, the @option{-I-} option inhibits the use of the current
74291a4b
MM
4428directory (where the current input file came from) as the first search
4429directory for @samp{#include "@var{file}"}. There is no way to
630d3d5a 4430override this effect of @option{-I-}. With @option{-I.} you can specify
74291a4b
MM
4431searching the directory which was current when the compiler was
4432invoked. That is not exactly the same as what the preprocessor does
4433by default, but it is often satisfactory.
4434
630d3d5a
JM
4435@option{-I-} does not inhibit the use of the standard system directories
4436for header files. Thus, @option{-I-} and @option{-nostdinc} are
74291a4b
MM
4437independent.
4438
4439@item -L@var{dir}
cd3bb277 4440@opindex L
74291a4b 4441Add directory @var{dir} to the list of directories to be searched
630d3d5a 4442for @option{-l}.
74291a4b
MM
4443
4444@item -B@var{prefix}
cd3bb277 4445@opindex B
74291a4b
MM
4446This option specifies where to find the executables, libraries,
4447include files, and data files of the compiler itself.
4448
4449The compiler driver program runs one or more of the subprograms
4450@file{cpp}, @file{cc1}, @file{as} and @file{ld}. It tries
4451@var{prefix} as a prefix for each program it tries to run, both with and
4452without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
4453
4454For each subprogram to be run, the compiler driver first tries the
630d3d5a 4455@option{-B} prefix, if any. If that name is not found, or if @option{-B}
74291a4b
MM
4456was not specified, the driver tries two standard prefixes, which are
4457@file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc-lib/}. If neither of
4458those results in a file name that is found, the unmodified program
4459name is searched for using the directories specified in your
bedc7537 4460@env{PATH} environment variable.
74291a4b 4461
07804c3b
NC
4462The compiler will check to see if the path provided by the @option{-B}
4463refers to a directory, and if necessary it will add a directory
4464separator character at the end of the path.
4465
630d3d5a 4466@option{-B} prefixes that effectively specify directory names also apply
74291a4b 4467to libraries in the linker, because the compiler translates these
630d3d5a 4468options into @option{-L} options for the linker. They also apply to
74291a4b 4469includes files in the preprocessor, because the compiler translates these
630d3d5a 4470options into @option{-isystem} options for the preprocessor. In this case,
74291a4b
MM
4471the compiler appends @samp{include} to the prefix.
4472
4473The run-time support file @file{libgcc.a} can also be searched for using
630d3d5a 4474the @option{-B} prefix, if needed. If it is not found there, the two
74291a4b
MM
4475standard prefixes above are tried, and that is all. The file is left
4476out of the link if it is not found by those means.
4477
630d3d5a 4478Another way to specify a prefix much like the @option{-B} prefix is to use
bedc7537 4479the environment variable @env{GCC_EXEC_PREFIX}. @xref{Environment
74291a4b 4480Variables}.
861bb6c1 4481
07804c3b 4482As a special kludge, if the path provided by @option{-B} is
bf4eebe0
NC
4483@file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
44849, then it will be replaced by @file{[dir/]include}. This is to help
7dac2f89 4485with boot-strapping the compiler.
07804c3b 4486
861bb6c1 4487@item -specs=@var{file}
cd3bb277 4488@opindex specs
861bb6c1
JL
4489Process @var{file} after the compiler reads in the standard @file{specs}
4490file, in order to override the defaults that the @file{gcc} driver
4491program uses when determining what switches to pass to @file{cc1},
4492@file{cc1plus}, @file{as}, @file{ld}, etc. More than one
630d3d5a 4493@option{-specs=@var{file}} can be specified on the command line, and they
861bb6c1 4494are processed in order, from left to right.
74291a4b
MM
4495@end table
4496
ee457005
JM
4497@c man end
4498
a743d340
NC
4499@node Spec Files
4500@section Specifying subprocesses and the switches to pass to them
4501@cindex Spec Files
bedc7537 4502@command{gcc} is a driver program. It performs its job by invoking a
a743d340
NC
4503sequence of other programs to do the work of compiling, assembling and
4504linking. GCC interprets its command-line parameters and uses these to
4505deduce which programs it should invoke, and which command-line options
c21cd8b1 4506it ought to place on their command lines. This behavior is controlled
a743d340
NC
4507by @dfn{spec strings}. In most cases there is one spec string for each
4508program that GCC can invoke, but a few programs have multiple spec
c21cd8b1 4509strings to control their behavior. The spec strings built into GCC can
630d3d5a 4510be overridden by using the @option{-specs=} command-line switch to specify
a743d340
NC
4511a spec file.
4512
4513@dfn{Spec files} are plaintext files that are used to construct spec
4514strings. They consist of a sequence of directives separated by blank
4515lines. The type of directive is determined by the first non-whitespace
4516character on the line and it can be one of the following:
4517
4518@table @code
4519@item %@var{command}
4520Issues a @var{command} to the spec file processor. The commands that can
02f52e19 4521appear here are:
a743d340
NC
4522
4523@table @code
4524@item %include <@var{file}>
4525@cindex %include
4526Search for @var{file} and insert its text at the current point in the
4527specs file.
4528
4529@item %include_noerr <@var{file}>
4530@cindex %include_noerr
4531Just like @samp{%include}, but do not generate an error message if the include
4532file cannot be found.
4533
4534@item %rename @var{old_name} @var{new_name}
4535@cindex %rename
4536Rename the spec string @var{old_name} to @var{new_name}.
4537
4538@end table
4539
4540@item *[@var{spec_name}]:
4541This tells the compiler to create, override or delete the named spec
4542string. All lines after this directive up to the next directive or
4543blank line are considered to be the text for the spec string. If this
4544results in an empty string then the spec will be deleted. (Or, if the
4545spec did not exist, then nothing will happened.) Otherwise, if the spec
4546does not currently exist a new spec will be created. If the spec does
4547exist then its contents will be overridden by the text of this
4548directive, unless the first character of that text is the @samp{+}
4549character, in which case the text will be appended to the spec.
4550
4551@item [@var{suffix}]:
4552Creates a new @samp{[@var{suffix}] spec} pair. All lines after this directive
4553and up to the next directive or blank line are considered to make up the
02f52e19 4554spec string for the indicated suffix. When the compiler encounters an
a743d340
NC
4555input file with the named suffix, it will processes the spec string in
4556order to work out how to compile that file. For example:
4557
4558@smallexample
4559.ZZ:
4560z-compile -input %i
4561@end smallexample
4562
4563This says that any input file whose name ends in @samp{.ZZ} should be
4564passed to the program @samp{z-compile}, which should be invoked with the
630d3d5a 4565command-line switch @option{-input} and with the result of performing the
a743d340
NC
4566@samp{%i} substitution. (See below.)
4567
4568As an alternative to providing a spec string, the text that follows a
4569suffix directive can be one of the following:
4570
4571@table @code
4572@item @@@var{language}
4573This says that the suffix is an alias for a known @var{language}. This is
bedc7537 4574similar to using the @option{-x} command-line switch to GCC to specify a
a743d340
NC
4575language explicitly. For example:
4576
4577@smallexample
4578.ZZ:
4579@@c++
4580@end smallexample
4581
4582Says that .ZZ files are, in fact, C++ source files.
4583
4584@item #@var{name}
4585This causes an error messages saying:
4586
4587@smallexample
4588@var{name} compiler not installed on this system.
4589@end smallexample
4590@end table
4591
4592GCC already has an extensive list of suffixes built into it.
4593This directive will add an entry to the end of the list of suffixes, but
4594since the list is searched from the end backwards, it is effectively
4595possible to override earlier entries using this technique.
4596
4597@end table
4598
4599GCC has the following spec strings built into it. Spec files can
4600override these strings or create their own. Note that individual
02f52e19 4601targets can also add their own spec strings to this list.
a743d340
NC
4602
4603@smallexample
4604asm Options to pass to the assembler
4605asm_final Options to pass to the assembler post-processor
4606cpp Options to pass to the C preprocessor
4607cc1 Options to pass to the C compiler
4608cc1plus Options to pass to the C++ compiler
4609endfile Object files to include at the end of the link
4610link Options to pass to the linker
4611lib Libraries to include on the command line to the linker
4612libgcc Decides which GCC support library to pass to the linker
4613linker Sets the name of the linker
4614predefines Defines to be passed to the C preprocessor
310668e8
JM
4615signed_char Defines to pass to CPP to say whether @code{char} is signed
4616 by default
a743d340
NC
4617startfile Object files to include at the start of the link
4618@end smallexample
4619
4620Here is a small example of a spec file:
4621
4622@smallexample
4623%rename lib old_lib
4624
4625*lib:
4626--start-group -lgcc -lc -leval1 --end-group %(old_lib)
4627@end smallexample
4628
4629This example renames the spec called @samp{lib} to @samp{old_lib} and
4630then overrides the previous definition of @samp{lib} with a new one.
4631The new definition adds in some extra command-line options before
4632including the text of the old definition.
4633
4634@dfn{Spec strings} are a list of command-line options to be passed to their
4635corresponding program. In addition, the spec strings can contain
4636@samp{%}-prefixed sequences to substitute variable text or to
4637conditionally insert text into the command line. Using these constructs
4638it is possible to generate quite complex command lines.
4639
4640Here is a table of all defined @samp{%}-sequences for spec
4641strings. Note that spaces are not generated automatically around the
4642results of expanding these sequences. Therefore you can concatenate them
02f52e19 4643together or combine them with constant text in a single argument.
a743d340
NC
4644
4645@table @code
4646@item %%
4647Substitute one @samp{%} into the program name or argument.
4648
4649@item %i
4650Substitute the name of the input file being processed.
4651
4652@item %b
4653Substitute the basename of the input file being processed.
4654This is the substring up to (and not including) the last period
4655and not including the directory.
4656
371e300b
NC
4657@item %B
4658This is the same as @samp{%b}, but include the file suffix (text after
4659the last period).
4660
a743d340
NC
4661@item %d
4662Marks the argument containing or following the @samp{%d} as a
4663temporary file name, so that that file will be deleted if GCC exits
4664successfully. Unlike @samp{%g}, this contributes no text to the
02f52e19 4665argument.
a743d340
NC
4666
4667@item %g@var{suffix}
4668Substitute a file name that has suffix @var{suffix} and is chosen
4669once per compilation, and mark the argument in the same way as
4670@samp{%d}. To reduce exposure to denial-of-service attacks, the file
02f52e19 4671name is now chosen in a way that is hard to predict even when previously
695ac33f 4672chosen file names are known. For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
a743d340
NC
4673might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}. @var{suffix} matches
4674the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
4675treated exactly as if @samp{%O} had been preprocessed. Previously, @samp{%g}
4676was simply substituted with a file name chosen once per compilation,
4677without regard to any appended suffix (which was therefore treated
4678just like ordinary text), making such attacks more likely to succeed.
4679
4680@item %u@var{suffix}
4681Like @samp{%g}, but generates a new temporary file name even if
4682@samp{%u@var{suffix}} was already seen.
4683
4684@item %U@var{suffix}
4685Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
4686new one if there is no such last file name. In the absence of any
4687@samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
695ac33f 4688the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
a743d340
NC
4689would involve the generation of two distinct file names, one
4690for each @samp{%g.s} and another for each @samp{%U.s}. Previously, @samp{%U} was
4691simply substituted with a file name chosen for the previous @samp{%u},
4692without regard to any appended suffix.
4693
371e300b 4694@item %j@var{SUFFIX}
aee96fe9 4695Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
371e300b
NC
4696writable, and if save-temps is off; otherwise, substitute the name
4697of a temporary file, just like @samp{%u}. This temporary file is not
4698meant for communication between processes, but rather as a junk
4699disposal mechanism.
4700
4701@item %.@var{SUFFIX}
4702Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
767094dd 4703when it is subsequently output with @samp{%*}. @var{SUFFIX} is
371e300b
NC
4704terminated by the next space or %.
4705
a743d340
NC
4706@item %w
4707Marks the argument containing or following the @samp{%w} as the
4708designated output file of this compilation. This puts the argument
4709into the sequence of arguments that @samp{%o} will substitute later.
4710
4711@item %o
4712Substitutes the names of all the output files, with spaces
4713automatically placed around them. You should write spaces
4714around the @samp{%o} as well or the results are undefined.
4715@samp{%o} is for use in the specs for running the linker.
4716Input files whose names have no recognized suffix are not compiled
4717at all, but they are included among the output files, so they will
4718be linked.
4719
4720@item %O
4721Substitutes the suffix for object files. Note that this is
4722handled specially when it immediately follows @samp{%g, %u, or %U},
4723because of the need for those to form complete file names. The
4724handling is such that @samp{%O} is treated exactly as if it had already
4725been substituted, except that @samp{%g, %u, and %U} do not currently
4726support additional @var{suffix} characters following @samp{%O} as they would
4727following, for example, @samp{.o}.
4728
4729@item %p
4730Substitutes the standard macro predefinitions for the
4731current target machine. Use this when running @code{cpp}.
4732
4733@item %P
4734Like @samp{%p}, but puts @samp{__} before and after the name of each
4735predefined macro, except for macros that start with @samp{__} or with
c1030c7c 4736@samp{_@var{L}}, where @var{L} is an uppercase letter. This is for ISO
161d7b59 4737C@.
a743d340
NC
4738
4739@item %I
aee96fe9 4740Substitute a @option{-iprefix} option made from @env{GCC_EXEC_PREFIX}.
a743d340
NC
4741
4742@item %s
4743Current argument is the name of a library or startup file of some sort.
4744Search for that file in a standard list of directories and substitute
02f52e19 4745the full name found.
a743d340
NC
4746
4747@item %e@var{str}
4748Print @var{str} as an error message. @var{str} is terminated by a newline.
4749Use this when inconsistent options are detected.
4750
4751@item %|
4752Output @samp{-} if the input for the current command is coming from a pipe.
4753
4754@item %(@var{name})
4755Substitute the contents of spec string @var{name} at this point.
4756
4757@item %[@var{name}]
630d3d5a 4758Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
a743d340
NC
4759
4760@item %x@{@var{option}@}
4761Accumulate an option for @samp{%X}.
4762
4763@item %X
630d3d5a 4764Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
a743d340
NC
4765spec string.
4766
4767@item %Y
630d3d5a 4768Output the accumulated assembler options specified by @option{-Wa}.
a743d340
NC
4769
4770@item %Z
630d3d5a 4771Output the accumulated preprocessor options specified by @option{-Wp}.
a743d340
NC
4772
4773@item %v1
161d7b59 4774Substitute the major version number of GCC@.
a743d340
NC
4775(For version 2.9.5, this is 2.)
4776
4777@item %v2
161d7b59 4778Substitute the minor version number of GCC@.
a743d340
NC
4779(For version 2.9.5, this is 9.)
4780
371e300b 4781@item %v3
161d7b59 4782Substitute the patch level number of GCC@.
371e300b
NC
4783(For version 2.9.5, this is 5.)
4784
a743d340
NC
4785@item %a
4786Process the @code{asm} spec. This is used to compute the
4787switches to be passed to the assembler.
4788
4789@item %A
4790Process the @code{asm_final} spec. This is a spec string for
4791passing switches to an assembler post-processor, if such a program is
4792needed.
4793
4794@item %l
4795Process the @code{link} spec. This is the spec for computing the
4796command line passed to the linker. Typically it will make use of the
4797@samp{%L %G %S %D and %E} sequences.
4798
4799@item %D
630d3d5a 4800Dump out a @option{-L} option for each directory that GCC believes might
a743d340 4801contain startup files. If the target supports multilibs then the
02f52e19 4802current multilib directory will be prepended to each of these paths.
a743d340 4803
371e300b 4804@item %M
c771326b 4805Output the multilib directory with directory separators replaced with
695ac33f
JM
4806@samp{_}. If multilib directories are not set, or the multilib directory is
4807@file{.} then this option emits nothing.
371e300b 4808
a743d340
NC
4809@item %L
4810Process the @code{lib} spec. This is a spec string for deciding which
02f52e19 4811libraries should be included on the command line to the linker.
a743d340
NC
4812
4813@item %G
4814Process the @code{libgcc} spec. This is a spec string for deciding
02f52e19 4815which GCC support library should be included on the command line to the linker.
a743d340
NC
4816
4817@item %S
4818Process the @code{startfile} spec. This is a spec for deciding which
4819object files should be the first ones passed to the linker. Typically
02f52e19 4820this might be a file named @file{crt0.o}.
a743d340
NC
4821
4822@item %E
4823Process the @code{endfile} spec. This is a spec string that specifies
02f52e19 4824the last object files that will be passed to the linker.
a743d340
NC
4825
4826@item %C
4827Process the @code{cpp} spec. This is used to construct the arguments
4828to be passed to the C preprocessor.
4829
4830@item %c
4831Process the @code{signed_char} spec. This is intended to be used
02f52e19 4832to tell cpp whether a char is signed. It typically has the definition:
a743d340
NC
4833@smallexample
4834%@{funsigned-char:-D__CHAR_UNSIGNED__@}
4835@end smallexample
4836
4837@item %1
4838Process the @code{cc1} spec. This is used to construct the options to be
4839passed to the actual C compiler (@samp{cc1}).
4840
4841@item %2
4842Process the @code{cc1plus} spec. This is used to construct the options to be
4843passed to the actual C++ compiler (@samp{cc1plus}).
4844
4845@item %*
4846Substitute the variable part of a matched option. See below.
4847Note that each comma in the substituted string is replaced by
4848a single space.
4849
4850@item %@{@code{S}@}
161d7b59 4851Substitutes the @code{-S} switch, if that switch was given to GCC@.
a743d340
NC
4852If that switch was not specified, this substitutes nothing. Note that
4853the leading dash is omitted when specifying this option, and it is
4854automatically inserted if the substitution is performed. Thus the spec
630d3d5a
JM
4855string @samp{%@{foo@}} would match the command-line option @option{-foo}
4856and would output the command line option @option{-foo}.
a743d340
NC
4857
4858@item %W@{@code{S}@}
4859Like %@{@code{S}@} but mark last argument supplied within as a file to be
02f52e19 4860deleted on failure.
a743d340
NC
4861
4862@item %@{@code{S}*@}
4863Substitutes all the switches specified to GCC whose names start
4864with @code{-S}, but which also take an argument. This is used for
695ac33f 4865switches like @option{-o}, @option{-D}, @option{-I}, etc.
630d3d5a 4866GCC considers @option{-o foo} as being
a743d340 4867one switch whose names starts with @samp{o}. %@{o*@} would substitute this
02f52e19 4868text, including the space. Thus two arguments would be generated.
a743d340
NC
4869
4870@item %@{^@code{S}*@}
4871Like %@{@code{S}*@}, but don't put a blank between a switch and its
4872argument. Thus %@{^o*@} would only generate one argument, not two.
4873
371e300b
NC
4874@item %@{@code{S}*&@code{T}*@}
4875Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
4876(the order of @code{S} and @code{T} in the spec is not significant).
4877There can be any number of ampersand-separated variables; for each the
4878wild card is optional. Useful for CPP as @samp{%@{D*&U*&A*@}}.
4879
d630442f 4880@item %@{<@code{S}@}
695ac33f 4881Remove all occurrences of @code{-S} from the command line. Note---this
d630442f 4882command is position dependent. @samp{%} commands in the spec string
50c57e7b 4883before this option will see @code{-S}, @samp{%} commands in the spec
d630442f
NC
4884string after this option will not.
4885
a743d340
NC
4886@item %@{@code{S}*:@code{X}@}
4887Substitutes @code{X} if one or more switches whose names start with
161d7b59 4888@code{-S} are specified to GCC@. Note that the tail part of the
e979f9e8 4889@code{-S} option (i.e.@: the part matched by the @samp{*}) will be substituted
02f52e19 4890for each occurrence of @samp{%*} within @code{X}.
a743d340
NC
4891
4892@item %@{@code{S}:@code{X}@}
161d7b59 4893Substitutes @code{X}, but only if the @samp{-S} switch was given to GCC@.
a743d340
NC
4894
4895@item %@{!@code{S}:@code{X}@}
161d7b59 4896Substitutes @code{X}, but only if the @samp{-S} switch was @emph{not} given to GCC@.
a743d340
NC
4897
4898@item %@{|@code{S}:@code{X}@}
4899Like %@{@code{S}:@code{X}@}, but if no @code{S} switch, substitute @samp{-}.
4900
4901@item %@{|!@code{S}:@code{X}@}
4902Like %@{!@code{S}:@code{X}@}, but if there is an @code{S} switch, substitute @samp{-}.
4903
4904@item %@{.@code{S}:@code{X}@}
4905Substitutes @code{X}, but only if processing a file with suffix @code{S}.
4906
4907@item %@{!.@code{S}:@code{X}@}
4908Substitutes @code{X}, but only if @emph{not} processing a file with suffix @code{S}.
4909
4910@item %@{@code{S}|@code{P}:@code{X}@}
161d7b59 4911Substitutes @code{X} if either @code{-S} or @code{-P} was given to GCC@. This may be
a743d340
NC
4912combined with @samp{!} and @samp{.} sequences as well, although they
4913have a stronger binding than the @samp{|}. For example a spec string
4914like this:
4915
4916@smallexample
4917%@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
4918@end smallexample
4919
4920will output the following command-line options from the following input
4921command-line options:
4922
4923@smallexample
4924fred.c -foo -baz
4925jim.d -bar -boggle
4926-d fred.c -foo -baz -boggle
4927-d jim.d -bar -baz -boggle
4928@end smallexample
4929
4930@end table
4931
4932The conditional text @code{X} in a %@{@code{S}:@code{X}@} or
4933%@{!@code{S}:@code{X}@} construct may contain other nested @samp{%} constructs
4934or spaces, or even newlines. They are processed as usual, as described
02f52e19 4935above.
a743d340 4936
695ac33f
JM
4937The @option{-O}, @option{-f}, @option{-m}, and @option{-W}
4938switches are handled specifically in these
630d3d5a
JM
4939constructs. If another value of @option{-O} or the negated form of a @option{-f}, @option{-m}, or
4940@option{-W} switch is found later in the command line, the earlier switch
a743d340
NC
4941value is ignored, except with @{@code{S}*@} where @code{S} is just one
4942letter, which passes all matching options.
4943
4944The character @samp{|} at the beginning of the predicate text is used to indicate
630d3d5a 4945that a command should be piped to the following command, but only if @option{-pipe}
a743d340
NC
4946is specified.
4947
4948It is built into GCC which switches take arguments and which do not.
4949(You might think it would be useful to generalize this to allow each
4950compiler's spec to say which switches take arguments. But this cannot
4951be done in a consistent fashion. GCC cannot even decide which input
4952files have been specified without knowing which switches take arguments,
4953and it must know which input files to compile in order to tell which
02f52e19 4954compilers to run).
a743d340 4955
630d3d5a 4956GCC also knows implicitly that arguments starting in @option{-l} are to be
a743d340
NC
4957treated as compiler output files, and passed to the linker in their
4958proper position among the other output files.
4959
ee457005
JM
4960@c man begin OPTIONS
4961
74291a4b
MM
4962@node Target Options
4963@section Specifying Target Machine and Compiler Version
4964@cindex target options
4965@cindex cross compiling
4966@cindex specifying machine version
4967@cindex specifying compiler version and target machine
4968@cindex compiler version, specifying
4969@cindex target machine, specifying
4970
0c2d1a2a 4971By default, GCC compiles code for the same type of machine that you
74291a4b
MM
4972are using. However, it can also be installed as a cross-compiler, to
4973compile for some other type of machine. In fact, several different
0c2d1a2a 4974configurations of GCC, for different target machines, can be
74291a4b 4975installed side by side. Then you specify which one to use with the
630d3d5a 4976@option{-b} option.
74291a4b 4977
0c2d1a2a 4978In addition, older and newer versions of GCC can be installed side
74291a4b
MM
4979by side. One of them (probably the newest) will be the default, but
4980you may sometimes wish to use another.
4981
2642624b 4982@table @gcctabopt
74291a4b 4983@item -b @var{machine}
cd3bb277 4984@opindex b
74291a4b 4985The argument @var{machine} specifies the target machine for compilation.
0c2d1a2a 4986This is useful when you have installed GCC as a cross-compiler.
74291a4b
MM
4987
4988The value to use for @var{machine} is the same as was specified as the
0c2d1a2a 4989machine type when configuring GCC as a cross-compiler. For
74291a4b
MM
4990example, if a cross-compiler was configured with @samp{configure
4991i386v}, meaning to compile for an 80386 running System V, then you
630d3d5a 4992would specify @option{-b i386v} to run that cross compiler.
74291a4b 4993
630d3d5a 4994When you do not specify @option{-b}, it normally means to compile for
74291a4b
MM
4995the same type of machine that you are using.
4996
4997@item -V @var{version}
cd3bb277 4998@opindex V
0c2d1a2a 4999The argument @var{version} specifies which version of GCC to run.
74291a4b 5000This is useful when multiple versions are installed. For example,
0c2d1a2a 5001@var{version} might be @samp{2.0}, meaning to run GCC version 2.0.
74291a4b 5002
630d3d5a 5003The default version, when you do not specify @option{-V}, is the last
0c2d1a2a 5004version of GCC that you installed.
74291a4b
MM
5005@end table
5006
630d3d5a 5007The @option{-b} and @option{-V} options actually work by controlling part of
74291a4b 5008the file name used for the executable files and libraries used for
0c2d1a2a 5009compilation. A given version of GCC, for a given target machine, is
bd819a4a 5010normally kept in the directory @file{/usr/local/lib/gcc-lib/@var{machine}/@var{version}}.
74291a4b 5011
630d3d5a 5012Thus, sites can customize the effect of @option{-b} or @option{-V} either by
74291a4b
MM
5013changing the names of these directories or adding alternate names (or
5014symbolic links). If in directory @file{/usr/local/lib/gcc-lib/} the
630d3d5a
JM
5015file @file{80386} is a link to the file @file{i386v}, then @option{-b
501680386} becomes an alias for @option{-b i386v}.
74291a4b 5017
630d3d5a 5018In one respect, the @option{-b} or @option{-V} do not completely change
bedc7537 5019to a different compiler: the top-level driver program @command{gcc}
74291a4b
MM
5020that you originally invoked continues to run and invoke the other
5021executables (preprocessor, compiler per se, assembler and linker)
5022that do the real work. However, since no real work is done in the
5023driver program, it usually does not matter that the driver program
8c7b74b9
JM
5024in use is not the one for the specified target. It is common for the
5025interface to the other executables to change incompatibly between
5026compiler versions, so unless the version specified is very close to that
630d3d5a
JM
5027of the driver (for example, @option{-V 3.0} with a driver program from GCC
5028version 3.0.1), use of @option{-V} may not work; for example, using
5029@option{-V 2.95.2} will not work with a driver program from GCC 3.0.
74291a4b
MM
5030
5031The only way that the driver program depends on the target machine is
5032in the parsing and handling of special machine-specific options.
5033However, this is controlled by a file which is found, along with the
5034other executables, in the directory for the specified version and
5035target machine. As a result, a single installed driver program adapts
8c7b74b9
JM
5036to any specified target machine, and sufficiently similar compiler
5037versions.
74291a4b
MM
5038
5039The driver program executable does control one significant thing,
5040however: the default version and target machine. Therefore, you can
5041install different instances of the driver program, compiled for
5042different targets or versions, under different names.
5043
bedc7537
NC
5044For example, if the driver for version 2.0 is installed as @command{ogcc}
5045and that for version 2.1 is installed as @command{gcc}, then the command
5046@command{gcc} will use version 2.1 by default, while @command{ogcc} will use
74291a4b 50472.0 by default. However, you can choose either version with either
630d3d5a 5048command with the @option{-V} option.
74291a4b
MM
5049
5050@node Submodel Options
5051@section Hardware Models and Configurations
5052@cindex submodel options
5053@cindex specifying hardware config
5054@cindex hardware models and configurations, specifying
5055@cindex machine dependent options
5056
630d3d5a 5057Earlier we discussed the standard option @option{-b} which chooses among
74291a4b 5058different installed compilers for completely different target
8aeea6e6 5059machines, such as VAX vs.@: 68000 vs.@: 80386.
74291a4b
MM
5060
5061In addition, each of these target machine types can have its own
5062special options, starting with @samp{-m}, to choose among various
5063hardware models or configurations---for example, 68010 vs 68020,
5064floating coprocessor or none. A single installed version of the
5065compiler can compile for any model or configuration, according to the
5066options specified.
5067
5068Some configurations of the compiler also support additional special
5069options, usually for compatibility with other compilers on the same
5070platform.
5071
74291a4b
MM
5072These options are defined by the macro @code{TARGET_SWITCHES} in the
5073machine description. The default for the options is also defined by
5074that macro, which enables you to change the defaults.
74291a4b
MM
5075
5076@menu
5077* M680x0 Options::
2856c3e3 5078* M68hc1x Options::
74291a4b
MM
5079* VAX Options::
5080* SPARC Options::
5081* Convex Options::
5082* AMD29K Options::
5083* ARM Options::
ecff22ab 5084* MN10200 Options::
6d6d0fa0 5085* MN10300 Options::
861bb6c1 5086* M32R/D Options::
74291a4b
MM
5087* M88K Options::
5088* RS/6000 and PowerPC Options::
5089* RT Options::
5090* MIPS Options::
14f73b5a 5091* i386 and x86-64 Options::
74291a4b
MM
5092* HPPA Options::
5093* Intel 960 Options::
5094* DEC Alpha Options::
d7c23cdc 5095* DEC Alpha/VMS Options::
74291a4b
MM
5096* Clipper Options::
5097* H8/300 Options::
5098* SH Options::
5099* System V Options::
282a61e6 5100* TMS320C3x/C4x Options::
f84271d9 5101* V850 Options::
56b2d7a7 5102* ARC Options::
83575957 5103* NS32K Options::
052a4b28
DC
5104* AVR Options::
5105* MCore Options::
df6194d4 5106* IA-64 Options::
e8ad90e5 5107* D30V Options::
91abf72d 5108* S/390 and zSeries Options::
0b85d816 5109* CRIS Options::
bcf684c7 5110* MMIX Options::
9f85bca7 5111* PDP-11 Options::
74291a4b
MM
5112@end menu
5113
5114@node M680x0 Options
5115@subsection M680x0 Options
5116@cindex M680x0 options
5117
5118These are the @samp{-m} options defined for the 68000 series. The default
5119values for these options depends on which style of 68000 was selected when
5120the compiler was configured; the defaults for the most common choices are
5121given below.
5122
2642624b 5123@table @gcctabopt
74291a4b
MM
5124@item -m68000
5125@itemx -mc68000
cd3bb277
JM
5126@opindex m68000
5127@opindex mc68000
74291a4b
MM
5128Generate output for a 68000. This is the default
5129when the compiler is configured for 68000-based systems.
5130
74cf1c6d
RK
5131Use this option for microcontrollers with a 68000 or EC000 core,
5132including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
5133
74291a4b
MM
5134@item -m68020
5135@itemx -mc68020
cd3bb277
JM
5136@opindex m68020
5137@opindex mc68020
74291a4b
MM
5138Generate output for a 68020. This is the default
5139when the compiler is configured for 68020-based systems.
5140
5141@item -m68881
cd3bb277 5142@opindex m68881
74291a4b 5143Generate output containing 68881 instructions for floating point.
630d3d5a 5144This is the default for most 68020 systems unless @option{--nfp} was
74291a4b
MM
5145specified when the compiler was configured.
5146
5147@item -m68030
cd3bb277 5148@opindex m68030
74291a4b
MM
5149Generate output for a 68030. This is the default when the compiler is
5150configured for 68030-based systems.
5151
5152@item -m68040
cd3bb277 5153@opindex m68040
74291a4b
MM
5154Generate output for a 68040. This is the default when the compiler is
5155configured for 68040-based systems.
5156
5157This option inhibits the use of 68881/68882 instructions that have to be
74cf1c6d
RK
5158emulated by software on the 68040. Use this option if your 68040 does not
5159have code to emulate those instructions.
74291a4b
MM
5160
5161@item -m68060
cd3bb277 5162@opindex m68060
74291a4b
MM
5163Generate output for a 68060. This is the default when the compiler is
5164configured for 68060-based systems.
5165
5166This option inhibits the use of 68020 and 68881/68882 instructions that
74cf1c6d
RK
5167have to be emulated by software on the 68060. Use this option if your 68060
5168does not have code to emulate those instructions.
5169
5170@item -mcpu32
cd3bb277 5171@opindex mcpu32
767094dd 5172Generate output for a CPU32. This is the default
74cf1c6d
RK
5173when the compiler is configured for CPU32-based systems.
5174
5175Use this option for microcontrollers with a
5176CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
517768336, 68340, 68341, 68349 and 68360.
74291a4b
MM
5178
5179@item -m5200
cd3bb277 5180@opindex m5200
695ac33f 5181Generate output for a 520X ``coldfire'' family cpu. This is the default
74291a4b
MM
5182when the compiler is configured for 520X-based systems.
5183
02f52e19 5184Use this option for microcontroller with a 5200 core, including
74cf1c6d
RK
5185the MCF5202, MCF5203, MCF5204 and MCF5202.
5186
74291a4b
MM
5187
5188@item -m68020-40
cd3bb277 5189@opindex m68020-40
74291a4b
MM
5190Generate output for a 68040, without using any of the new instructions.
5191This results in code which can run relatively efficiently on either a
519268020/68881 or a 68030 or a 68040. The generated code does use the
519368881 instructions that are emulated on the 68040.
5194
861bb6c1 5195@item -m68020-60
cd3bb277 5196@opindex m68020-60
861bb6c1
JL
5197Generate output for a 68060, without using any of the new instructions.
5198This results in code which can run relatively efficiently on either a
519968020/68881 or a 68030 or a 68040. The generated code does use the
520068881 instructions that are emulated on the 68060.
5201
74291a4b 5202@item -mfpa
cd3bb277 5203@opindex mfpa
74291a4b
MM
5204Generate output containing Sun FPA instructions for floating point.
5205
5206@item -msoft-float
cd3bb277 5207@opindex msoft-float
74291a4b
MM
5208Generate output containing library calls for floating point.
5209@strong{Warning:} the requisite libraries are not available for all m68k
5210targets. Normally the facilities of the machine's usual C compiler are
5211used, but this can't be done directly in cross-compilation. You must
5212make your own arrangements to provide suitable library functions for
5213cross-compilation. The embedded targets @samp{m68k-*-aout} and
5214@samp{m68k-*-coff} do provide software floating point support.
5215
5216@item -mshort
cd3bb277 5217@opindex mshort
74291a4b
MM
5218Consider type @code{int} to be 16 bits wide, like @code{short int}.
5219
5220@item -mnobitfield
cd3bb277 5221@opindex mnobitfield
630d3d5a
JM
5222Do not use the bit-field instructions. The @option{-m68000}, @option{-mcpu32}
5223and @option{-m5200} options imply @w{@option{-mnobitfield}}.
74291a4b
MM
5224
5225@item -mbitfield
cd3bb277 5226@opindex mbitfield
630d3d5a
JM
5227Do use the bit-field instructions. The @option{-m68020} option implies
5228@option{-mbitfield}. This is the default if you use a configuration
74291a4b
MM
5229designed for a 68020.
5230
5231@item -mrtd
cd3bb277 5232@opindex mrtd
74291a4b
MM
5233Use a different function-calling convention, in which functions
5234that take a fixed number of arguments return with the @code{rtd}
5235instruction, which pops their arguments while returning. This
5236saves one instruction in the caller since there is no need to pop
5237the arguments there.
5238
5239This calling convention is incompatible with the one normally
5240used on Unix, so you cannot use it if you need to call libraries
5241compiled with the Unix compiler.
5242
5243Also, you must provide function prototypes for all functions that
5244take variable numbers of arguments (including @code{printf});
5245otherwise incorrect code will be generated for calls to those
5246functions.
5247
5248In addition, seriously incorrect code will result if you call a
5249function with too many arguments. (Normally, extra arguments are
5250harmlessly ignored.)
5251
5252The @code{rtd} instruction is supported by the 68010, 68020, 68030,
74cf1c6d 525368040, 68060 and CPU32 processors, but not by the 68000 or 5200.
861bb6c1
JL
5254
5255@item -malign-int
5256@itemx -mno-align-int
cd3bb277
JM
5257@opindex malign-int
5258@opindex mno-align-int
02f52e19 5259Control whether GCC aligns @code{int}, @code{long}, @code{long long},
861bb6c1 5260@code{float}, @code{double}, and @code{long double} variables on a 32-bit
630d3d5a 5261boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
861bb6c1
JL
5262Aligning variables on 32-bit boundaries produces code that runs somewhat
5263faster on processors with 32-bit busses at the expense of more memory.
5264
630d3d5a 5265@strong{Warning:} if you use the @option{-malign-int} switch, GCC will
861bb6c1
JL
5266align structures containing the above types differently than
5267most published application binary interface specifications for the m68k.
5268
fb868474 5269@item -mpcrel
cd3bb277 5270@opindex mpcrel
fb868474 5271Use the pc-relative addressing mode of the 68000 directly, instead of
695ac33f
JM
5272using a global offset table. At present, this option implies @option{-fpic},
5273allowing at most a 16-bit offset for pc-relative addressing. @option{-fPIC} is
5274not presently supported with @option{-mpcrel}, though this could be supported for
fb868474
DL
527568020 and higher processors.
5276
b71733d5
GM
5277@item -mno-strict-align
5278@itemx -mstrict-align
cd3bb277
JM
5279@opindex mno-strict-align
5280@opindex mstrict-align
b71733d5
GM
5281Do not (do) assume that unaligned memory references will be handled by
5282the system.
5283
74291a4b
MM
5284@end table
5285
2856c3e3
SC
5286@node M68hc1x Options
5287@subsection M68hc1x Options
5288@cindex M68hc1x options
5289
5290These are the @samp{-m} options defined for the 68hc11 and 68hc12
02f52e19 5291microcontrollers. The default values for these options depends on
2856c3e3
SC
5292which style of microcontroller was selected when the compiler was configured;
5293the defaults for the most common choices are given below.
5294
2642624b 5295@table @gcctabopt
2856c3e3
SC
5296@item -m6811
5297@itemx -m68hc11
cd3bb277
JM
5298@opindex m6811
5299@opindex m68hc11
2856c3e3
SC
5300Generate output for a 68HC11. This is the default
5301when the compiler is configured for 68HC11-based systems.
5302
5303@item -m6812
5304@itemx -m68hc12
cd3bb277
JM
5305@opindex m6812
5306@opindex m68hc12
2856c3e3
SC
5307Generate output for a 68HC12. This is the default
5308when the compiler is configured for 68HC12-based systems.
5309
5310@item -mauto-incdec
cd3bb277 5311@opindex mauto-incdec
2856c3e3
SC
5312Enable the use of 68HC12 pre and post auto-increment and auto-decrement
5313addressing modes.
5314
5315@item -mshort
cd3bb277 5316@opindex mshort
2856c3e3
SC
5317Consider type @code{int} to be 16 bits wide, like @code{short int}.
5318
5319@item -msoft-reg-count=@var{count}
cd3bb277 5320@opindex msoft-reg-count
2856c3e3
SC
5321Specify the number of pseudo-soft registers which are used for the
5322code generation. The maximum number is 32. Using more pseudo-soft
5323register may or may not result in better code depending on the program.
5324The default is 4 for 68HC11 and 2 for 68HC12.
5325
5326@end table
5327
74291a4b
MM
5328@node VAX Options
5329@subsection VAX Options
5330@cindex VAX options
5331
8aeea6e6 5332These @samp{-m} options are defined for the VAX:
74291a4b 5333
2642624b 5334@table @gcctabopt
74291a4b 5335@item -munix
cd3bb277 5336@opindex munix
74291a4b 5337Do not output certain jump instructions (@code{aobleq} and so on)
8aeea6e6 5338that the Unix assembler for the VAX cannot handle across long
74291a4b
MM
5339ranges.
5340
5341@item -mgnu
cd3bb277 5342@opindex mgnu
74291a4b
MM
5343Do output those jump instructions, on the assumption that you
5344will assemble with the GNU assembler.
5345
5346@item -mg
cd3bb277 5347@opindex mg
74291a4b
MM
5348Output code for g-format floating point numbers instead of d-format.
5349@end table
5350
5351@node SPARC Options
5352@subsection SPARC Options
5353@cindex SPARC options
5354
5355These @samp{-m} switches are supported on the SPARC:
5356
2642624b 5357@table @gcctabopt
74291a4b
MM
5358@item -mno-app-regs
5359@itemx -mapp-regs
cd3bb277
JM
5360@opindex mno-app-regs
5361@opindex mapp-regs
630d3d5a 5362Specify @option{-mapp-regs} to generate output using the global registers
74291a4b
MM
53632 through 4, which the SPARC SVR4 ABI reserves for applications. This
5364is the default.
5365
5366To be fully SVR4 ABI compliant at the cost of some performance loss,
630d3d5a 5367specify @option{-mno-app-regs}. You should compile libraries and system
74291a4b
MM
5368software with this option.
5369
5370@item -mfpu
5371@itemx -mhard-float
cd3bb277
JM
5372@opindex mfpu
5373@opindex mhard-float
74291a4b
MM
5374Generate output containing floating point instructions. This is the
5375default.
5376
5377@item -mno-fpu
5378@itemx -msoft-float
cd3bb277
JM
5379@opindex mno-fpu
5380@opindex msoft-float
74291a4b
MM
5381Generate output containing library calls for floating point.
5382@strong{Warning:} the requisite libraries are not available for all SPARC
5383targets. Normally the facilities of the machine's usual C compiler are
5384used, but this cannot be done directly in cross-compilation. You must make
5385your own arrangements to provide suitable library functions for
5386cross-compilation. The embedded targets @samp{sparc-*-aout} and
5387@samp{sparclite-*-*} do provide software floating point support.
5388
630d3d5a 5389@option{-msoft-float} changes the calling convention in the output file;
74291a4b
MM
5390therefore, it is only useful if you compile @emph{all} of a program with
5391this option. In particular, you need to compile @file{libgcc.a}, the
630d3d5a 5392library that comes with GCC, with @option{-msoft-float} in order for
74291a4b
MM
5393this to work.
5394
5395@item -mhard-quad-float
cd3bb277 5396@opindex mhard-quad-float
74291a4b
MM
5397Generate output containing quad-word (long double) floating point
5398instructions.
5399
5400@item -msoft-quad-float
cd3bb277 5401@opindex msoft-quad-float
74291a4b
MM
5402Generate output containing library calls for quad-word (long double)
5403floating point instructions. The functions called are those specified
161d7b59 5404in the SPARC ABI@. This is the default.
74291a4b
MM
5405
5406As of this writing, there are no sparc implementations that have hardware
5407support for the quad-word floating point instructions. They all invoke
5408a trap handler for one of these instructions, and then the trap handler
5409emulates the effect of the instruction. Because of the trap handler overhead,
5410this is much slower than calling the ABI library routines. Thus the
630d3d5a 5411@option{-msoft-quad-float} option is the default.
74291a4b
MM
5412
5413@item -mno-epilogue
5414@itemx -mepilogue
cd3bb277
JM
5415@opindex mno-epilogue
5416@opindex mepilogue
630d3d5a 5417With @option{-mepilogue} (the default), the compiler always emits code for
74291a4b
MM
5418function exit at the end of each function. Any function exit in
5419the middle of the function (such as a return statement in C) will
5420generate a jump to the exit code at the end of the function.
5421
630d3d5a 5422With @option{-mno-epilogue}, the compiler tries to emit exit code inline
74291a4b
MM
5423at every function exit.
5424
5425@item -mno-flat
5426@itemx -mflat
cd3bb277
JM
5427@opindex mno-flat
5428@opindex mflat
630d3d5a 5429With @option{-mflat}, the compiler does not generate save/restore instructions
695ac33f 5430and will use a ``flat'' or single register window calling convention.
74291a4b
MM
5431This model uses %i7 as the frame pointer and is compatible with the normal
5432register window model. Code from either may be intermixed.
aee96fe9 5433The local registers and the input registers (0--5) are still treated as
695ac33f 5434``call saved'' registers and will be saved on the stack as necessary.
74291a4b 5435
630d3d5a 5436With @option{-mno-flat} (the default), the compiler emits save/restore
74291a4b
MM
5437instructions (except for leaf functions) and is the normal mode of operation.
5438
5439@item -mno-unaligned-doubles
5440@itemx -munaligned-doubles
cd3bb277
JM
5441@opindex mno-unaligned-doubles
5442@opindex munaligned-doubles
74291a4b
MM
5443Assume that doubles have 8 byte alignment. This is the default.
5444
630d3d5a 5445With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
74291a4b
MM
5446alignment only if they are contained in another type, or if they have an
5447absolute address. Otherwise, it assumes they have 4 byte alignment.
5448Specifying this option avoids some rare compatibility problems with code
5449generated by other compilers. It is not the default because it results
5450in a performance loss, especially for floating point code.
5451
c219ddf7
BK
5452@item -mno-faster-structs
5453@itemx -mfaster-structs
cd3bb277
JM
5454@opindex mno-faster-structs
5455@opindex mfaster-structs
630d3d5a 5456With @option{-mfaster-structs}, the compiler assumes that structures
c219ddf7
BK
5457should have 8 byte alignment. This enables the use of pairs of
5458@code{ldd} and @code{std} instructions for copies in structure
5459assignment, in place of twice as many @code{ld} and @code{st} pairs.
5460However, the use of this changed alignment directly violates the Sparc
161d7b59 5461ABI@. Thus, it's intended only for use on targets where the developer
c219ddf7 5462acknowledges that their resulting code will not be directly in line with
161d7b59 5463the rules of the ABI@.
c219ddf7 5464
74291a4b
MM
5465@item -mv8
5466@itemx -msparclite
cd3bb277
JM
5467@opindex mv8
5468@opindex msparclite
74291a4b
MM
5469These two options select variations on the SPARC architecture.
5470
5471By default (unless specifically configured for the Fujitsu SPARClite),
5472GCC generates code for the v7 variant of the SPARC architecture.
5473
630d3d5a 5474@option{-mv8} will give you SPARC v8 code. The only difference from v7
74291a4b
MM
5475code is that the compiler emits the integer multiply and integer
5476divide instructions which exist in SPARC v8 but not in SPARC v7.
5477
630d3d5a 5478@option{-msparclite} will give you SPARClite code. This adds the integer
74291a4b
MM
5479multiply, integer divide step and scan (@code{ffs}) instructions which
5480exist in SPARClite but not in SPARC v7.
5481
0c2d1a2a 5482These options are deprecated and will be deleted in a future GCC release.
630d3d5a 5483They have been replaced with @option{-mcpu=xxx}.
74291a4b
MM
5484
5485@item -mcypress
5486@itemx -msupersparc
cd3bb277
JM
5487@opindex mcypress
5488@opindex msupersparc
c21cd8b1 5489These two options select the processor for which the code is optimized.
74291a4b 5490
630d3d5a 5491With @option{-mcypress} (the default), the compiler optimizes code for the
74291a4b
MM
5492Cypress CY7C602 chip, as used in the SparcStation/SparcServer 3xx series.
5493This is also appropriate for the older SparcStation 1, 2, IPX etc.
5494
630d3d5a 5495With @option{-msupersparc} the compiler optimizes code for the SuperSparc cpu, as
767094dd 5496used in the SparcStation 10, 1000 and 2000 series. This flag also enables use
74291a4b
MM
5497of the full SPARC v8 instruction set.
5498
0c2d1a2a 5499These options are deprecated and will be deleted in a future GCC release.
630d3d5a 5500They have been replaced with @option{-mcpu=xxx}.
74291a4b
MM
5501
5502@item -mcpu=@var{cpu_type}
cd3bb277 5503@opindex mcpu
c0498f43
DE
5504Set the instruction set, register set, and instruction scheduling parameters
5505for machine type @var{cpu_type}. Supported values for @var{cpu_type} are
5506@samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
ad6843d7
RH
5507@samp{hypersparc}, @samp{sparclite86x}, @samp{f930}, @samp{f934},
5508@samp{sparclet}, @samp{tsc701}, @samp{v9}, and @samp{ultrasparc}.
c0498f43
DE
5509
5510Default instruction scheduling parameters are used for values that select
5511an architecture and not an implementation. These are @samp{v7}, @samp{v8},
5512@samp{sparclite}, @samp{sparclet}, @samp{v9}.
5513
5514Here is a list of each supported architecture and their supported
5515implementations.
5516
5517@smallexample
5518 v7: cypress
ad6843d7
RH
5519 v8: supersparc, hypersparc
5520 sparclite: f930, f934, sparclite86x
c0498f43
DE
5521 sparclet: tsc701
5522 v9: ultrasparc
5523@end smallexample
74291a4b
MM
5524
5525@item -mtune=@var{cpu_type}
cd3bb277 5526@opindex mtune
74291a4b 5527Set the instruction scheduling parameters for machine type
c0498f43 5528@var{cpu_type}, but do not set the instruction set or register set that the
630d3d5a 5529option @option{-mcpu=@var{cpu_type}} would.
c0498f43 5530
9c34dbbf
ZW
5531The same values for @option{-mcpu=@var{cpu_type}} can be used for
5532@option{-mtune=@var{cpu_type}}, but the only useful values are those
5533that select a particular cpu implementation. Those are @samp{cypress},
5534@samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
5535@samp{sparclite86x}, @samp{tsc701}, and @samp{ultrasparc}.
74291a4b
MM
5536
5537@end table
5538
5539These @samp{-m} switches are supported in addition to the above
5540on the SPARCLET processor.
5541
2642624b 5542@table @gcctabopt
74291a4b 5543@item -mlittle-endian
cd3bb277 5544@opindex mlittle-endian
74291a4b
MM
5545Generate code for a processor running in little-endian mode.
5546
5547@item -mlive-g0
cd3bb277 5548@opindex mlive-g0
74291a4b
MM
5549Treat register @code{%g0} as a normal register.
5550GCC will continue to clobber it as necessary but will not assume
5551it always reads as 0.
5552
5553@item -mbroken-saverestore
cd3bb277 5554@opindex mbroken-saverestore
74291a4b
MM
5555Generate code that does not use non-trivial forms of the @code{save} and
5556@code{restore} instructions. Early versions of the SPARCLET processor do
5557not correctly handle @code{save} and @code{restore} instructions used with
5558arguments. They correctly handle them used without arguments. A @code{save}
5559instruction used without arguments increments the current window pointer
5560but does not allocate a new stack frame. It is assumed that the window
5561overflow trap handler will properly handle this case as will interrupt
5562handlers.
5563@end table
5564
5565These @samp{-m} switches are supported in addition to the above
02f52e19 5566on SPARC V9 processors in 64-bit environments.
74291a4b 5567
2642624b 5568@table @gcctabopt
74291a4b 5569@item -mlittle-endian
cd3bb277 5570@opindex mlittle-endian
74291a4b
MM
5571Generate code for a processor running in little-endian mode.
5572
ded17aad
DE
5573@item -m32
5574@itemx -m64
cd3bb277
JM
5575@opindex m32
5576@opindex m64
02f52e19
AJ
5577Generate code for a 32-bit or 64-bit environment.
5578The 32-bit environment sets int, long and pointer to 32 bits.
5579The 64-bit environment sets int to 32 bits and long and pointer
ded17aad
DE
5580to 64 bits.
5581
5582@item -mcmodel=medlow
cd3bb277 5583@opindex mcmodel=medlow
ded17aad
DE
5584Generate code for the Medium/Low code model: the program must be linked
5585in the low 32 bits of the address space. Pointers are 64 bits.
5586Programs can be statically or dynamically linked.
5587
5588@item -mcmodel=medmid
cd3bb277 5589@opindex mcmodel=medmid
ded17aad
DE
5590Generate code for the Medium/Middle code model: the program must be linked
5591in the low 44 bits of the address space, the text segment must be less than
55922G bytes, and data segment must be within 2G of the text segment.
5593Pointers are 64 bits.
5594
5595@item -mcmodel=medany
cd3bb277 5596@opindex mcmodel=medany
ded17aad
DE
5597Generate code for the Medium/Anywhere code model: the program may be linked
5598anywhere in the address space, the text segment must be less than
55992G bytes, and data segment must be within 2G of the text segment.
5600Pointers are 64 bits.
5601
5602@item -mcmodel=embmedany
cd3bb277 5603@opindex mcmodel=embmedany
ded17aad 5604Generate code for the Medium/Anywhere code model for embedded systems:
02f52e19 5605assume a 32-bit text and a 32-bit data segment, both starting anywhere
ded17aad 5606(determined at link time). Register %g4 points to the base of the
02f52e19 5607data segment. Pointers are still 64 bits.
ded17aad 5608Programs are statically linked, PIC is not supported.
74291a4b
MM
5609
5610@item -mstack-bias
5611@itemx -mno-stack-bias
cd3bb277
JM
5612@opindex mstack-bias
5613@opindex mno-stack-bias
630d3d5a
JM
5614With @option{-mstack-bias}, GCC assumes that the stack pointer, and
5615frame pointer if present, are offset by @minus{}2047 which must be added back
74291a4b
MM
5616when making stack frame references.
5617Otherwise, assume no such offset is present.
5618@end table
5619
5620@node Convex Options
5621@subsection Convex Options
5622@cindex Convex options
5623
5624These @samp{-m} options are defined for Convex:
5625
2642624b 5626@table @gcctabopt
74291a4b 5627@item -mc1
cd3bb277 5628@opindex mc1
74291a4b
MM
5629Generate output for C1. The code will run on any Convex machine.
5630The preprocessor symbol @code{__convex__c1__} is defined.
5631
5632@item -mc2
cd3bb277 5633@opindex mc2
74291a4b
MM
5634Generate output for C2. Uses instructions not available on C1.
5635Scheduling and other optimizations are chosen for max performance on C2.
5636The preprocessor symbol @code{__convex_c2__} is defined.
5637
5638@item -mc32
cd3bb277 5639@opindex mc32
74291a4b
MM
5640Generate output for C32xx. Uses instructions not available on C1.
5641Scheduling and other optimizations are chosen for max performance on C32.
5642The preprocessor symbol @code{__convex_c32__} is defined.
5643
5644@item -mc34
cd3bb277 5645@opindex mc34
74291a4b
MM
5646Generate output for C34xx. Uses instructions not available on C1.
5647Scheduling and other optimizations are chosen for max performance on C34.
5648The preprocessor symbol @code{__convex_c34__} is defined.
5649
5650@item -mc38
cd3bb277 5651@opindex mc38
74291a4b
MM
5652Generate output for C38xx. Uses instructions not available on C1.
5653Scheduling and other optimizations are chosen for max performance on C38.
5654The preprocessor symbol @code{__convex_c38__} is defined.
5655
5656@item -margcount
cd3bb277 5657@opindex margcount
74291a4b
MM
5658Generate code which puts an argument count in the word preceding each
5659argument list. This is compatible with regular CC, and a few programs
5660may need the argument count word. GDB and other source-level debuggers
5661do not need it; this info is in the symbol table.
5662
5663@item -mnoargcount
cd3bb277 5664@opindex mnoargcount
74291a4b
MM
5665Omit the argument count word. This is the default.
5666
5667@item -mvolatile-cache
cd3bb277 5668@opindex mvolatile-cache
74291a4b
MM
5669Allow volatile references to be cached. This is the default.
5670
5671@item -mvolatile-nocache
cd3bb277 5672@opindex mvolatile-nocache
74291a4b
MM
5673Volatile references bypass the data cache, going all the way to memory.
5674This is only needed for multi-processor code that does not use standard
5675synchronization instructions. Making non-volatile references to volatile
5676locations will not necessarily work.
5677
5678@item -mlong32
cd3bb277 5679@opindex mlong32
74291a4b
MM
5680Type long is 32 bits, the same as type int. This is the default.
5681
5682@item -mlong64
cd3bb277 5683@opindex mlong64
74291a4b
MM
5684Type long is 64 bits, the same as type long long. This option is useless,
5685because no library support exists for it.
5686@end table
5687
5688@node AMD29K Options
5689@subsection AMD29K Options
5690@cindex AMD29K options
5691
5692These @samp{-m} options are defined for the AMD Am29000:
5693
2642624b 5694@table @gcctabopt
74291a4b 5695@item -mdw
cd3bb277 5696@opindex mdw
74291a4b
MM
5697@cindex DW bit (29k)
5698Generate code that assumes the @code{DW} bit is set, i.e., that byte and
5699halfword operations are directly supported by the hardware. This is the
5700default.
5701
5702@item -mndw
cd3bb277 5703@opindex mndw
74291a4b
MM
5704Generate code that assumes the @code{DW} bit is not set.
5705
5706@item -mbw
cd3bb277 5707@opindex mbw
74291a4b
MM
5708@cindex byte writes (29k)
5709Generate code that assumes the system supports byte and halfword write
5710operations. This is the default.
5711
5712@item -mnbw
cd3bb277 5713@opindex mnbw
74291a4b 5714Generate code that assumes the systems does not support byte and
630d3d5a 5715halfword write operations. @option{-mnbw} implies @option{-mndw}.
74291a4b
MM
5716
5717@item -msmall
cd3bb277 5718@opindex msmall
74291a4b
MM
5719@cindex memory model (29k)
5720Use a small memory model that assumes that all function addresses are
5721either within a single 256 KB segment or at an absolute address of less
5722than 256k. This allows the @code{call} instruction to be used instead
5723of a @code{const}, @code{consth}, @code{calli} sequence.
5724
5725@item -mnormal
cd3bb277 5726@opindex mnormal
74291a4b
MM
5727Use the normal memory model: Generate @code{call} instructions only when
5728calling functions in the same file and @code{calli} instructions
5729otherwise. This works if each file occupies less than 256 KB but allows
161d7b59 5730the entire executable to be larger than 256 KB@. This is the default.
74291a4b
MM
5731
5732@item -mlarge
cd3bb277 5733@opindex mlarge
74291a4b
MM
5734Always use @code{calli} instructions. Specify this option if you expect
5735a single file to compile into more than 256 KB of code.
5736
5737@item -m29050
cd3bb277 5738@opindex m29050
74291a4b
MM
5739@cindex processor selection (29k)
5740Generate code for the Am29050.
5741
5742@item -m29000
cd3bb277 5743@opindex m29000
74291a4b
MM
5744Generate code for the Am29000. This is the default.
5745
5746@item -mkernel-registers
cd3bb277 5747@opindex mkernel-registers
74291a4b
MM
5748@cindex kernel and user registers (29k)
5749Generate references to registers @code{gr64-gr95} instead of to
5750registers @code{gr96-gr127}. This option can be used when compiling
5751kernel code that wants a set of global registers disjoint from that used
5752by user-mode code.
5753
5754Note that when this option is used, register names in @samp{-f} flags
5755must use the normal, user-mode, names.
5756
5757@item -muser-registers
cd3bb277 5758@opindex muser-registers
74291a4b
MM
5759Use the normal set of global registers, @code{gr96-gr127}. This is the
5760default.
5761
5762@item -mstack-check
5763@itemx -mno-stack-check
cd3bb277
JM
5764@opindex mstack-check
5765@opindex mno-stack-check
74291a4b
MM
5766@cindex stack checks (29k)
5767Insert (or do not insert) a call to @code{__msp_check} after each stack
5768adjustment. This is often used for kernel code.
5769
5770@item -mstorem-bug
5771@itemx -mno-storem-bug
cd3bb277
JM
5772@opindex mstorem-bug
5773@opindex mno-storem-bug
74291a4b 5774@cindex storem bug (29k)
630d3d5a 5775@option{-mstorem-bug} handles 29k processors which cannot handle the
74291a4b
MM
5776separation of a mtsrim insn and a storem instruction (most 29000 chips
5777to date, but not the 29050).
5778
5779@item -mno-reuse-arg-regs
5780@itemx -mreuse-arg-regs
cd3bb277
JM
5781@opindex mno-reuse-arg-regs
5782@opindex mreuse-arg-regs
630d3d5a 5783@option{-mno-reuse-arg-regs} tells the compiler to only use incoming argument
74291a4b
MM
5784registers for copying out arguments. This helps detect calling a function
5785with fewer arguments than it was declared with.
5786
861bb6c1
JL
5787@item -mno-impure-text
5788@itemx -mimpure-text
cd3bb277
JM
5789@opindex mno-impure-text
5790@opindex mimpure-text
630d3d5a
JM
5791@option{-mimpure-text}, used in addition to @option{-shared}, tells the compiler to
5792not pass @option{-assert pure-text} to the linker when linking a shared object.
861bb6c1 5793
74291a4b 5794@item -msoft-float
cd3bb277 5795@opindex msoft-float
74291a4b 5796Generate output containing library calls for floating point.
161d7b59 5797@strong{Warning:} the requisite libraries are not part of GCC@.
74291a4b
MM
5798Normally the facilities of the machine's usual C compiler are used, but
5799this can't be done directly in cross-compilation. You must make your
5800own arrangements to provide suitable library functions for
5801cross-compilation.
4e8d7ddc
JW
5802
5803@item -mno-multm
cd3bb277 5804@opindex mno-multm
4e8d7ddc
JW
5805Do not generate multm or multmu instructions. This is useful for some embedded
5806systems which do not have trap handlers for these instructions.
74291a4b
MM
5807@end table
5808
5809@node ARM Options
5810@subsection ARM Options
5811@cindex ARM options
5812
5813These @samp{-m} options are defined for Advanced RISC Machines (ARM)
5814architectures:
5815
2642624b 5816@table @gcctabopt
74291a4b 5817@item -mapcs-frame
cd3bb277 5818@opindex mapcs-frame
74291a4b
MM
5819Generate a stack frame that is compliant with the ARM Procedure Call
5820Standard for all functions, even if this is not strictly necessary for
630d3d5a 5821correct execution of the code. Specifying @option{-fomit-frame-pointer}
157a620e 5822with this option will cause the stack frames not to be generated for
630d3d5a 5823leaf functions. The default is @option{-mno-apcs-frame}.
157a620e
NC
5824
5825@item -mapcs
cd3bb277 5826@opindex mapcs
630d3d5a 5827This is a synonym for @option{-mapcs-frame}.
74291a4b
MM
5828
5829@item -mapcs-26
cd3bb277 5830@opindex mapcs-26
74291a4b
MM
5831Generate code for a processor running with a 26-bit program counter,
5832and conforming to the function calling standards for the APCS 26-bit
630d3d5a 5833option. This option replaces the @option{-m2} and @option{-m3} options
74291a4b
MM
5834of previous releases of the compiler.
5835
5836@item -mapcs-32
cd3bb277 5837@opindex mapcs-32
74291a4b
MM
5838Generate code for a processor running with a 32-bit program counter,
5839and conforming to the function calling standards for the APCS 32-bit
630d3d5a 5840option. This option replaces the @option{-m6} option of previous releases
74291a4b
MM
5841of the compiler.
5842
247f8561
PB
5843@ignore
5844@c not currently implemented
157a620e 5845@item -mapcs-stack-check
cd3bb277 5846@opindex mapcs-stack-check
157a620e
NC
5847Generate code to check the amount of stack space available upon entry to
5848every function (that actually uses some stack space). If there is
5849insufficient space available then either the function
5850@samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
5851called, depending upon the amount of stack space required. The run time
5852system is required to provide these functions. The default is
630d3d5a 5853@option{-mno-apcs-stack-check}, since this produces smaller code.
157a620e 5854
247f8561 5855@c not currently implemented
157a620e 5856@item -mapcs-float
cd3bb277 5857@opindex mapcs-float
157a620e 5858Pass floating point arguments using the float point registers. This is
161d7b59 5859one of the variants of the APCS@. This option is recommended if the
157a620e
NC
5860target hardware has a floating point unit or if a lot of floating point
5861arithmetic is going to be performed by the code. The default is
630d3d5a
JM
5862@option{-mno-apcs-float}, since integer only code is slightly increased in
5863size if @option{-mapcs-float} is used.
157a620e 5864
247f8561 5865@c not currently implemented
157a620e 5866@item -mapcs-reentrant
cd3bb277 5867@opindex mapcs-reentrant
247f8561 5868Generate reentrant, position independent code. The default is
630d3d5a 5869@option{-mno-apcs-reentrant}.
247f8561 5870@end ignore
157a620e
NC
5871
5872@item -mthumb-interwork
cd3bb277 5873@opindex mthumb-interwork
247f8561 5874Generate code which supports calling between the ARM and Thumb
157a620e
NC
5875instruction sets. Without this option the two instruction sets cannot
5876be reliably used inside one program. The default is
630d3d5a
JM
5877@option{-mno-thumb-interwork}, since slightly larger code is generated
5878when @option{-mthumb-interwork} is specified.
157a620e
NC
5879
5880@item -mno-sched-prolog
cd3bb277 5881@opindex mno-sched-prolog
157a620e
NC
5882Prevent the reordering of instructions in the function prolog, or the
5883merging of those instruction with the instructions in the function's
ed0e6530
PB
5884body. This means that all functions will start with a recognizable set
5885of instructions (or in fact one of a choice from a small set of
157a620e
NC
5886different function prologues), and this information can be used to
5887locate the start if functions inside an executable piece of code. The
630d3d5a 5888default is @option{-msched-prolog}.
157a620e 5889
74291a4b 5890@item -mhard-float
cd3bb277 5891@opindex mhard-float
74291a4b
MM
5892Generate output containing floating point instructions. This is the
5893default.
5894
5895@item -msoft-float
cd3bb277 5896@opindex msoft-float
74291a4b
MM
5897Generate output containing library calls for floating point.
5898@strong{Warning:} the requisite libraries are not available for all ARM
5899targets. Normally the facilities of the machine's usual C compiler are
5900used, but this cannot be done directly in cross-compilation. You must make
5901your own arrangements to provide suitable library functions for
5902cross-compilation.
5903
630d3d5a 5904@option{-msoft-float} changes the calling convention in the output file;
74291a4b
MM
5905therefore, it is only useful if you compile @emph{all} of a program with
5906this option. In particular, you need to compile @file{libgcc.a}, the
630d3d5a 5907library that comes with GCC, with @option{-msoft-float} in order for
74291a4b
MM
5908this to work.
5909
5910@item -mlittle-endian
cd3bb277 5911@opindex mlittle-endian
74291a4b
MM
5912Generate code for a processor running in little-endian mode. This is
5913the default for all standard configurations.
5914
5915@item -mbig-endian
cd3bb277 5916@opindex mbig-endian
74291a4b
MM
5917Generate code for a processor running in big-endian mode; the default is
5918to compile code for a little-endian processor.
5919
5920@item -mwords-little-endian
cd3bb277 5921@opindex mwords-little-endian
74291a4b
MM
5922This option only applies when generating code for big-endian processors.
5923Generate code for a little-endian word order but a big-endian byte
5924order. That is, a byte order of the form @samp{32107654}. Note: this
5925option should only be used if you require compatibility with code for
5926big-endian ARM processors generated by versions of the compiler prior to
59272.8.
5928
5f1e6755 5929@item -malignment-traps
cd3bb277 5930@opindex malignment-traps
5f1e6755
NC
5931Generate code that will not trap if the MMU has alignment traps enabled.
5932On ARM architectures prior to ARMv4, there were no instructions to
5933access half-word objects stored in memory. However, when reading from
5934memory a feature of the ARM architecture allows a word load to be used,
5935even if the address is unaligned, and the processor core will rotate the
5936data as it is being loaded. This option tells the compiler that such
5937misaligned accesses will cause a MMU trap and that it should instead
5938synthesise the access as a series of byte accesses. The compiler can
5939still use word accesses to load half-word data if it knows that the
5940address is aligned to a word boundary.
5941
5942This option is ignored when compiling for ARM architecture 4 or later,
5943since these processors have instructions to directly access half-word
02f52e19
AJ
5944objects in memory.
5945
5f1e6755 5946@item -mno-alignment-traps
cd3bb277 5947@opindex mno-alignment-traps
5f1e6755
NC
5948Generate code that assumes that the MMU will not trap unaligned
5949accesses. This produces better code when the target instruction set
e979f9e8 5950does not have half-word memory operations (i.e.@: implementations prior to
02f52e19 5951ARMv4).
5f1e6755
NC
5952
5953Note that you cannot use this option to access unaligned word objects,
5954since the processor will only fetch one 32-bit aligned object from
02f52e19 5955memory.
5f1e6755 5956
695ac33f 5957The default setting for most targets is @option{-mno-alignment-traps}, since
5f1e6755 5958this produces better code when there are no half-word memory
02f52e19 5959instructions available.
5f1e6755 5960
74291a4b 5961@item -mshort-load-bytes
247f8561 5962@itemx -mno-short-load-words
cd3bb277
JM
5963@opindex mshort-load-bytes
5964@opindex mno-short-load-words
630d3d5a 5965These are deprecated aliases for @option{-malignment-traps}.
74291a4b
MM
5966
5967@item -mno-short-load-bytes
247f8561 5968@itemx -mshort-load-words
cd3bb277
JM
5969@opindex mno-short-load-bytes
5970@opindex mshort-load-words
630d3d5a 5971This are deprecated aliases for @option{-mno-alignment-traps}.
157a620e 5972
74291a4b 5973@item -mbsd
cd3bb277 5974@opindex mbsd
161d7b59 5975This option only applies to RISC iX@. Emulate the native BSD-mode
630d3d5a 5976compiler. This is the default if @option{-ansi} is not specified.
74291a4b
MM
5977
5978@item -mxopen
cd3bb277 5979@opindex mxopen
161d7b59 5980This option only applies to RISC iX@. Emulate the native X/Open-mode
74291a4b
MM
5981compiler.
5982
5983@item -mno-symrename
cd3bb277 5984@opindex mno-symrename
161d7b59 5985This option only applies to RISC iX@. Do not run the assembler
74291a4b
MM
5986post-processor, @samp{symrename}, after code has been assembled.
5987Normally it is necessary to modify some of the standard symbols in
5988preparation for linking with the RISC iX C library; this option
5989suppresses this pass. The post-processor is never run when the
5990compiler is built for cross-compilation.
157a620e 5991
cd3bb277
JM
5992@item -mcpu=@var{name}
5993@opindex mcpu
157a620e 5994This specifies the name of the target ARM processor. GCC uses this name
247f8561 5995to determine what kind of instructions it can emit when generating
aee96fe9
JM
5996assembly code. Permissible names are: @samp{arm2}, @samp{arm250},
5997@samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
5998@samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
5999@samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
6000@samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
6001@samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm8},
6002@samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
6003@samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
6004@samp{arm920t}, @samp{arm940t}, @samp{arm9tdmi}, @samp{arm10tdmi},
6005@samp{arm1020t}, @samp{xscale}.
62b10bbc 6006
cd3bb277
JM
6007@itemx -mtune=@var{name}
6008@opindex mtune
630d3d5a 6009This option is very similar to the @option{-mcpu=} option, except that
62b10bbc
NC
6010instead of specifying the actual target processor type, and hence
6011restricting which instructions can be used, it specifies that GCC should
6012tune the performance of the code as if the target were of the type
6013specified in this option, but still choosing the instructions that it
630d3d5a 6014will generate based on the cpu specified by a @option{-mcpu=} option.
247f8561 6015For some ARM implementations better performance can be obtained by using
62b10bbc 6016this option.
157a620e 6017
cd3bb277
JM
6018@item -march=@var{name}
6019@opindex march
157a620e 6020This specifies the name of the target ARM architecture. GCC uses this
247f8561 6021name to determine what kind of instructions it can emit when generating
157a620e 6022assembly code. This option can be used in conjunction with or instead
aee96fe9
JM
6023of the @option{-mcpu=} option. Permissible names are: @samp{armv2},
6024@samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
6025@samp{armv5}, @samp{armv5t}, @samp{armv5te}.
157a620e 6026
cd3bb277
JM
6027@item -mfpe=@var{number}
6028@itemx -mfp=@var{number}
6029@opindex mfpe
6030@opindex mfp
b192711e 6031This specifies the version of the floating point emulation available on
630d3d5a 6032the target. Permissible values are 2 and 3. @option{-mfp=} is a synonym
161d7b59 6033for @option{-mfpe=}, for compatibility with older versions of GCC@.
157a620e 6034
cd3bb277
JM
6035@item -mstructure-size-boundary=@var{n}
6036@opindex mstructure-size-boundary
157a620e 6037The size of all structures and unions will be rounded up to a multiple
ed0e6530 6038of the number of bits set by this option. Permissible values are 8 and
157a620e
NC
603932. The default value varies for different toolchains. For the COFF
6040targeted toolchain the default value is 8. Specifying the larger number
ed0e6530 6041can produce faster, more efficient code, but can also increase the size
157a620e
NC
6042of the program. The two values are potentially incompatible. Code
6043compiled with one value cannot necessarily expect to work with code or
6044libraries compiled with the other value, if they exchange information
247f8561 6045using structures or unions.
157a620e 6046
f5a1b0d2 6047@item -mabort-on-noreturn
cd3bb277 6048@opindex mabort-on-noreturn
247f8561
PB
6049Generate a call to the function @code{abort} at the end of a
6050@code{noreturn} function. It will be executed if the function tries to
6051return.
f5a1b0d2 6052
c27ba912
DM
6053@item -mlong-calls
6054@itemx -mno-long-calls
cd3bb277
JM
6055@opindex mlong-calls
6056@opindex mno-long-calls
c27ba912
DM
6057Tells the compiler to perform function calls by first loading the
6058address of the function into a register and then performing a subroutine
6059call on this register. This switch is needed if the target function
6060will lie outside of the 64 megabyte addressing range of the offset based
02f52e19 6061version of subroutine call instruction.
c27ba912
DM
6062
6063Even if this switch is enabled, not all function calls will be turned
6064into long calls. The heuristic is that static functions, functions
6065which have the @samp{short-call} attribute, functions that are inside
6066the scope of a @samp{#pragma no_long_calls} directive and functions whose
6067definitions have already been compiled within the current compilation
6068unit, will not be turned into long calls. The exception to this rule is
b192711e 6069that weak function definitions, functions with the @samp{long-call}
c27ba912
DM
6070attribute or the @samp{section} attribute, and functions that are within
6071the scope of a @samp{#pragma long_calls} directive, will always be
6072turned into long calls.
6073
6074This feature is not enabled by default. Specifying
c21cd8b1 6075@option{-mno-long-calls} will restore the default behavior, as will
c27ba912
DM
6076placing the function calls within the scope of a @samp{#pragma
6077long_calls_off} directive. Note these switches have no effect on how
6078the compiler generates code to handle function calls via function
02f52e19 6079pointers.
c27ba912 6080
62b10bbc 6081@item -mnop-fun-dllimport
cd3bb277 6082@opindex mnop-fun-dllimport
aee96fe9 6083Disable support for the @code{dllimport} attribute.
62b10bbc 6084
ed0e6530 6085@item -msingle-pic-base
cd3bb277 6086@opindex msingle-pic-base
ed0e6530
PB
6087Treat the register used for PIC addressing as read-only, rather than
6088loading it in the prologue for each function. The run-time system is
c21cd8b1 6089responsible for initializing this register with an appropriate value
ed0e6530
PB
6090before execution begins.
6091
cd3bb277
JM
6092@item -mpic-register=@var{reg}
6093@opindex mpic-register
ed0e6530
PB
6094Specify the register to be used for PIC addressing. The default is R10
6095unless stack-checking is enabled, when R9 is used.
6096
247f8561 6097@item -mpoke-function-name
cd3bb277 6098@opindex mpoke-function-name
247f8561
PB
6099Write the name of each function into the text section, directly
6100preceding the function prologue. The generated code is similar to this:
74291a4b 6101
247f8561
PB
6102@smallexample
6103 t0
6104 .ascii "arm_poke_function_name", 0
6105 .align
6106 t1
6107 .word 0xff000000 + (t1 - t0)
6108 arm_poke_function_name
6109 mov ip, sp
6110 stmfd sp!, @{fp, ip, lr, pc@}
6111 sub fp, ip, #4
6112@end smallexample
157a620e 6113
247f8561
PB
6114When performing a stack backtrace, code can inspect the value of
6115@code{pc} stored at @code{fp + 0}. If the trace function then looks at
6116location @code{pc - 12} and the top 8 bits are set, then we know that
6117there is a function name embedded immediately preceding this location
6118and has length @code{((pc[-3]) & 0xff000000)}.
157a620e 6119
247f8561 6120@item -mthumb
cd3bb277 6121@opindex mthumb
247f8561
PB
6122Generate code for the 16-bit Thumb instruction set. The default is to
6123use the 32-bit ARM instruction set.
157a620e
NC
6124
6125@item -mtpcs-frame
cd3bb277 6126@opindex mtpcs-frame
157a620e
NC
6127Generate a stack frame that is compliant with the Thumb Procedure Call
6128Standard for all non-leaf functions. (A leaf function is one that does
630d3d5a 6129not call any other functions.) The default is @option{-mno-tpcs-frame}.
157a620e
NC
6130
6131@item -mtpcs-leaf-frame
cd3bb277 6132@opindex mtpcs-leaf-frame
157a620e
NC
6133Generate a stack frame that is compliant with the Thumb Procedure Call
6134Standard for all leaf functions. (A leaf function is one that does
630d3d5a 6135not call any other functions.) The default is @option{-mno-apcs-leaf-frame}.
62b10bbc
NC
6136
6137@item -mcallee-super-interworking
cd3bb277 6138@opindex mcallee-super-interworking
62b10bbc
NC
6139Gives all externally visible functions in the file being compiled an ARM
6140instruction set header which switches to Thumb mode before executing the
6141rest of the function. This allows these functions to be called from
6142non-interworking code.
6143
6144@item -mcaller-super-interworking
cd3bb277 6145@opindex mcaller-super-interworking
62b10bbc
NC
6146Allows calls via function pointers (including virtual functions) to
6147execute correctly regardless of whether the target code has been
6148compiled for interworking or not. There is a small overhead in the cost
4bdc1ac7
PB
6149of executing a function pointer if this option is enabled.
6150
157a620e
NC
6151@end table
6152
ecff22ab
JL
6153@node MN10200 Options
6154@subsection MN10200 Options
6155@cindex MN10200 options
630d3d5a 6156These @option{-m} options are defined for Matsushita MN10200 architectures:
2642624b 6157@table @gcctabopt
ecff22ab
JL
6158
6159@item -mrelax
cd3bb277 6160@opindex mrelax
ecff22ab
JL
6161Indicate to the linker that it should perform a relaxation optimization pass
6162to shorten branches, calls and absolute memory addresses. This option only
6163has an effect when used on the command line for the final link step.
6164
02f52e19 6165This option makes symbolic debugging impossible.
ecff22ab 6166@end table
157a620e 6167
6d6d0fa0
JL
6168@node MN10300 Options
6169@subsection MN10300 Options
6170@cindex MN10300 options
630d3d5a 6171These @option{-m} options are defined for Matsushita MN10300 architectures:
6d6d0fa0 6172
2642624b 6173@table @gcctabopt
6d6d0fa0 6174@item -mmult-bug
cd3bb277 6175@opindex mmult-bug
6d6d0fa0
JL
6176Generate code to avoid bugs in the multiply instructions for the MN10300
6177processors. This is the default.
6178
6179@item -mno-mult-bug
cd3bb277 6180@opindex mno-mult-bug
6d6d0fa0
JL
6181Do not generate code to avoid bugs in the multiply instructions for the
6182MN10300 processors.
ecff22ab 6183
705ac34f 6184@item -mam33
cd3bb277 6185@opindex mam33
705ac34f
JL
6186Generate code which uses features specific to the AM33 processor.
6187
6188@item -mno-am33
cd3bb277 6189@opindex mno-am33
705ac34f
JL
6190Do not generate code which uses features specific to the AM33 processor. This
6191is the default.
6192
c474f76b
AO
6193@item -mno-crt0
6194@opindex mno-crt0
6195Do not link in the C run-time initialization object file.
6196
ecff22ab 6197@item -mrelax
cd3bb277 6198@opindex mrelax
ecff22ab
JL
6199Indicate to the linker that it should perform a relaxation optimization pass
6200to shorten branches, calls and absolute memory addresses. This option only
6201has an effect when used on the command line for the final link step.
6202
02f52e19 6203This option makes symbolic debugging impossible.
6d6d0fa0
JL
6204@end table
6205
ecff22ab 6206
861bb6c1
JL
6207@node M32R/D Options
6208@subsection M32R/D Options
6209@cindex M32R/D options
6210
630d3d5a 6211These @option{-m} options are defined for Mitsubishi M32R/D architectures:
861bb6c1 6212
2642624b 6213@table @gcctabopt
98180123
NC
6214@item -m32rx
6215@opindex m32rx
0bf93a51 6216Generate code for the M32R/X@.
98180123
NC
6217
6218@item -m32r
6219@opindex m32r
0bf93a51 6220Generate code for the M32R@. This is the default.
de41e41c 6221
861bb6c1 6222@item -mcode-model=small
cd3bb277 6223@opindex mcode-model=small
861bb6c1
JL
6224Assume all objects live in the lower 16MB of memory (so that their addresses
6225can be loaded with the @code{ld24} instruction), and assume all subroutines
6226are reachable with the @code{bl} instruction.
6227This is the default.
6228
6229The addressability of a particular object can be set with the
6230@code{model} attribute.
6231
6232@item -mcode-model=medium
cd3bb277 6233@opindex mcode-model=medium
02f52e19 6234Assume objects may be anywhere in the 32-bit address space (the compiler
861bb6c1
JL
6235will generate @code{seth/add3} instructions to load their addresses), and
6236assume all subroutines are reachable with the @code{bl} instruction.
6237
6238@item -mcode-model=large
cd3bb277 6239@opindex mcode-model=large
02f52e19 6240Assume objects may be anywhere in the 32-bit address space (the compiler
861bb6c1
JL
6241will generate @code{seth/add3} instructions to load their addresses), and
6242assume subroutines may not be reachable with the @code{bl} instruction
6243(the compiler will generate the much slower @code{seth/add3/jl}
6244instruction sequence).
6245
6246@item -msdata=none
cd3bb277 6247@opindex msdata=none
861bb6c1
JL
6248Disable use of the small data area. Variables will be put into
6249one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
6250@code{section} attribute has been specified).
6251This is the default.
6252
6253The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
6254Objects may be explicitly put in the small data area with the
6255@code{section} attribute using one of these sections.
6256
6257@item -msdata=sdata
cd3bb277 6258@opindex msdata=sdata
861bb6c1
JL
6259Put small global and static data in the small data area, but do not
6260generate special code to reference them.
6261
6262@item -msdata=use
cd3bb277 6263@opindex msdata=use
861bb6c1
JL
6264Put small global and static data in the small data area, and generate
6265special instructions to reference them.
6266
6267@item -G @var{num}
cd3bb277 6268@opindex G
861bb6c1
JL
6269@cindex smaller data references
6270Put global and static objects less than or equal to @var{num} bytes
6271into the small data or bss sections instead of the normal data or bss
6272sections. The default value of @var{num} is 8.
630d3d5a 6273The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
861bb6c1
JL
6274for this option to have any effect.
6275
630d3d5a 6276All modules should be compiled with the same @option{-G @var{num}} value.
861bb6c1 6277Compiling with different values of @var{num} may or may not work; if it
695ac33f 6278doesn't the linker will give an error message---incorrect code will not be
861bb6c1
JL
6279generated.
6280
6281@end table
6282
74291a4b
MM
6283@node M88K Options
6284@subsection M88K Options
6285@cindex M88k options
6286
6287These @samp{-m} options are defined for Motorola 88k architectures:
6288
2642624b 6289@table @gcctabopt
74291a4b 6290@item -m88000
cd3bb277 6291@opindex m88000
74291a4b
MM
6292Generate code that works well on both the m88100 and the
6293m88110.
6294
6295@item -m88100
cd3bb277 6296@opindex m88100
74291a4b
MM
6297Generate code that works best for the m88100, but that also
6298runs on the m88110.
6299
6300@item -m88110
cd3bb277 6301@opindex m88110
74291a4b
MM
6302Generate code that works best for the m88110, and may not run
6303on the m88100.
6304
6305@item -mbig-pic
cd3bb277 6306@opindex mbig-pic
74291a4b 6307Obsolete option to be removed from the next revision.
630d3d5a 6308Use @option{-fPIC}.
74291a4b
MM
6309
6310@item -midentify-revision
cd3bb277 6311@opindex midentify-revision
74291a4b
MM
6312@cindex identifying source, compiler (88k)
6313Include an @code{ident} directive in the assembler output recording the
6314source file name, compiler name and version, timestamp, and compilation
6315flags used.
6316
6317@item -mno-underscores
cd3bb277 6318@opindex mno-underscores
74291a4b
MM
6319@cindex underscores, avoiding (88k)
6320In assembler output, emit symbol names without adding an underscore
6321character at the beginning of each name. The default is to use an
6322underscore as prefix on each name.
6323
6324@item -mocs-debug-info
6325@itemx -mno-ocs-debug-info
cd3bb277
JM
6326@opindex mocs-debug-info
6327@opindex mno-ocs-debug-info
74291a4b
MM
6328@cindex OCS (88k)
6329@cindex debugging, 88k OCS
6330Include (or omit) additional debugging information (about registers used
6331in each stack frame) as specified in the 88open Object Compatibility
161d7b59 6332Standard, ``OCS''@. This extra information allows debugging of code that
74291a4b
MM
6333has had the frame pointer eliminated. The default for DG/UX, SVr4, and
6334Delta 88 SVr3.2 is to include this information; other 88k configurations
6335omit this information by default.
6336
6337@item -mocs-frame-position
cd3bb277 6338@opindex mocs-frame-position
74291a4b
MM
6339@cindex register positions in frame (88k)
6340When emitting COFF debugging information for automatic variables and
6341parameters stored on the stack, use the offset from the canonical frame
6342address, which is the stack pointer (register 31) on entry to the
6343function. The DG/UX, SVr4, Delta88 SVr3.2, and BCS configurations use
630d3d5a
JM
6344@option{-mocs-frame-position}; other 88k configurations have the default
6345@option{-mno-ocs-frame-position}.
74291a4b
MM
6346
6347@item -mno-ocs-frame-position
cd3bb277 6348@opindex mno-ocs-frame-position
74291a4b
MM
6349@cindex register positions in frame (88k)
6350When emitting COFF debugging information for automatic variables and
6351parameters stored on the stack, use the offset from the frame pointer
6352register (register 30). When this option is in effect, the frame
6353pointer is not eliminated when debugging information is selected by the
6354-g switch.
6355
6356@item -moptimize-arg-area
cd3bb277 6357@opindex moptimize-arg-area
74291a4b 6358@cindex arguments in frame (88k)
9c34dbbf
ZW
6359Save space by reorganizing the stack frame. This option generates code
6360that does not agree with the 88open specifications, but uses less
6361memory.
6362
6363@itemx -mno-optimize-arg-area
6364@opindex mno-optimize-arg-area
6365Do not reorganize the stack frame to save space. This is the default.
6366The generated conforms to the specification, but uses more memory.
74291a4b
MM
6367
6368@item -mshort-data-@var{num}
cd3bb277 6369@opindex mshort-data
74291a4b
MM
6370@cindex smaller data references (88k)
6371@cindex r0-relative references (88k)
6372Generate smaller data references by making them relative to @code{r0},
6373which allows loading a value using a single instruction (rather than the
6374usual two). You control which data references are affected by
6375specifying @var{num} with this option. For example, if you specify
630d3d5a 6376@option{-mshort-data-512}, then the data references affected are those
74291a4b 6377involving displacements of less than 512 bytes.
630d3d5a 6378@option{-mshort-data-@var{num}} is not effective for @var{num} greater
74291a4b
MM
6379than 64k.
6380
6381@item -mserialize-volatile
cd3bb277 6382@opindex mserialize-volatile
74291a4b 6383@itemx -mno-serialize-volatile
cd3bb277 6384@opindex mno-serialize-volatile
74291a4b
MM
6385@cindex sequential consistency on 88k
6386Do, or don't, generate code to guarantee sequential consistency
6387of volatile memory references. By default, consistency is
6388guaranteed.
6389
6390The order of memory references made by the MC88110 processor does
6391not always match the order of the instructions requesting those
6392references. In particular, a load instruction may execute before
6393a preceding store instruction. Such reordering violates
6394sequential consistency of volatile memory references, when there
6395are multiple processors. When consistency must be guaranteed,
f0523f02 6396GCC generates special instructions, as needed, to force
74291a4b
MM
6397execution in the proper order.
6398
6399The MC88100 processor does not reorder memory references and so
f0523f02
JM
6400always provides sequential consistency. However, by default, GCC
6401generates the special instructions to guarantee consistency
630d3d5a 6402even when you use @option{-m88100}, so that the code may be run on an
74291a4b 6403MC88110 processor. If you intend to run your code only on the
630d3d5a 6404MC88100 processor, you may use @option{-mno-serialize-volatile}.
74291a4b
MM
6405
6406The extra code generated to guarantee consistency may affect the
6407performance of your application. If you know that you can safely
630d3d5a 6408forgo this guarantee, you may use @option{-mno-serialize-volatile}.
74291a4b
MM
6409
6410@item -msvr4
6411@itemx -msvr3
cd3bb277
JM
6412@opindex msvr4
6413@opindex msvr3
74291a4b
MM
6414@cindex assembler syntax, 88k
6415@cindex SVr4
630d3d5a 6416Turn on (@option{-msvr4}) or off (@option{-msvr3}) compiler extensions
74291a4b
MM
6417related to System V release 4 (SVr4). This controls the following:
6418
6419@enumerate
6420@item
6421Which variant of the assembler syntax to emit.
6422@item
630d3d5a 6423@option{-msvr4} makes the C preprocessor recognize @samp{#pragma weak}
74291a4b
MM
6424that is used on System V release 4.
6425@item
630d3d5a 6426@option{-msvr4} makes GCC issue additional declaration directives used in
74291a4b
MM
6427SVr4.
6428@end enumerate
6429
630d3d5a 6430@option{-msvr4} is the default for the m88k-motorola-sysv4 and
767094dd 6431m88k-dg-dgux m88k configurations. @option{-msvr3} is the default for all
74291a4b
MM
6432other m88k configurations.
6433
6434@item -mversion-03.00
cd3bb277 6435@opindex mversion-03.00
74291a4b
MM
6436This option is obsolete, and is ignored.
6437@c ??? which asm syntax better for GAS? option there too?
6438
6439@item -mno-check-zero-division
6440@itemx -mcheck-zero-division
cd3bb277
JM
6441@opindex mno-check-zero-division
6442@opindex mcheck-zero-division
74291a4b
MM
6443@cindex zero division on 88k
6444Do, or don't, generate code to guarantee that integer division by
6445zero will be detected. By default, detection is guaranteed.
6446
6447Some models of the MC88100 processor fail to trap upon integer
6448division by zero under certain conditions. By default, when
f0523f02 6449compiling code that might be run on such a processor, GCC
74291a4b
MM
6450generates code that explicitly checks for zero-valued divisors
6451and traps with exception number 503 when one is detected. Use of
9c34dbbf 6452@option{-mno-check-zero-division} suppresses such checking for code
74291a4b
MM
6453generated to run on an MC88100 processor.
6454
9c34dbbf
ZW
6455GCC assumes that the MC88110 processor correctly detects all instances
6456of integer division by zero. When @option{-m88110} is specified, no
6457explicit checks for zero-valued divisors are generated, and both
6458@option{-mcheck-zero-division} and @option{-mno-check-zero-division} are
6459ignored.
74291a4b
MM
6460
6461@item -muse-div-instruction
cd3bb277 6462@opindex muse-div-instruction
74291a4b
MM
6463@cindex divide instruction, 88k
6464Use the div instruction for signed integer division on the
6465MC88100 processor. By default, the div instruction is not used.
6466
6467On the MC88100 processor the signed integer division instruction
6468div) traps to the operating system on a negative operand. The
6469operating system transparently completes the operation, but at a
6470large cost in execution time. By default, when compiling code
f0523f02 6471that might be run on an MC88100 processor, GCC emulates signed
74291a4b
MM
6472integer division using the unsigned integer division instruction
6473divu), thereby avoiding the large penalty of a trap to the
6474operating system. Such emulation has its own, smaller, execution
6475cost in both time and space. To the extent that your code's
6476important signed integer division operations are performed on two
6477nonnegative operands, it may be desirable to use the div
6478instruction directly.
6479
6480On the MC88110 processor the div instruction (also known as the
6481divs instruction) processes negative operands without trapping to
630d3d5a
JM
6482the operating system. When @option{-m88110} is specified,
6483@option{-muse-div-instruction} is ignored, and the div instruction is used
74291a4b
MM
6484for signed integer division.
6485
630d3d5a 6486Note that the result of dividing @code{INT_MIN} by @minus{}1 is undefined. In
74291a4b 6487particular, the behavior of such a division with and without
630d3d5a 6488@option{-muse-div-instruction} may differ.
74291a4b
MM
6489
6490@item -mtrap-large-shift
6491@itemx -mhandle-large-shift
cd3bb277
JM
6492@opindex mtrap-large-shift
6493@opindex mhandle-large-shift
74291a4b
MM
6494@cindex bit shift overflow (88k)
6495@cindex large bit shifts (88k)
6496Include code to detect bit-shifts of more than 31 bits; respectively,
0c2d1a2a 6497trap such shifts or emit code to handle them properly. By default GCC
74291a4b
MM
6498makes no special provision for large bit shifts.
6499
6500@item -mwarn-passed-structs
cd3bb277 6501@opindex mwarn-passed-structs
74291a4b
MM
6502@cindex structure passing (88k)
6503Warn when a function passes a struct as an argument or result.
6504Structure-passing conventions have changed during the evolution of the C
6505language, and are often the source of portability problems. By default,
0c2d1a2a 6506GCC issues no such warning.
74291a4b
MM
6507@end table
6508
9c34dbbf
ZW
6509@c break page here to avoid unsightly interparagraph stretch.
6510@c -zw, 2001-8-17
6511@page
6512
74291a4b
MM
6513@node RS/6000 and PowerPC Options
6514@subsection IBM RS/6000 and PowerPC Options
6515@cindex RS/6000 and PowerPC Options
6516@cindex IBM RS/6000 and PowerPC Options
6517
6518These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
2642624b 6519@table @gcctabopt
74291a4b
MM
6520@item -mpower
6521@itemx -mno-power
6522@itemx -mpower2
6523@itemx -mno-power2
6524@itemx -mpowerpc
6525@itemx -mno-powerpc
6526@itemx -mpowerpc-gpopt
6527@itemx -mno-powerpc-gpopt
6528@itemx -mpowerpc-gfxopt
6529@itemx -mno-powerpc-gfxopt
7fe90e7b
DE
6530@itemx -mpowerpc64
6531@itemx -mno-powerpc64
cd3bb277
JM
6532@opindex mpower
6533@opindex mno-power
6534@opindex mpower2
6535@opindex mno-power2
6536@opindex mpowerpc
6537@opindex mno-powerpc
6538@opindex mpowerpc-gpopt
6539@opindex mno-powerpc-gpopt
6540@opindex mpowerpc-gfxopt
6541@opindex mno-powerpc-gfxopt
6542@opindex mpowerpc64
6543@opindex mno-powerpc64
0c2d1a2a 6544GCC supports two related instruction set architectures for the
161d7b59 6545RS/6000 and PowerPC@. The @dfn{POWER} instruction set are those
74291a4b
MM
6546instructions supported by the @samp{rios} chip set used in the original
6547RS/6000 systems and the @dfn{PowerPC} instruction set is the
6548architecture of the Motorola MPC5xx, MPC6xx, MPC8xx microprocessors, and
861bb6c1 6549the IBM 4xx microprocessors.
74291a4b
MM
6550
6551Neither architecture is a subset of the other. However there is a
6552large common subset of instructions supported by both. An MQ
6553register is included in processors supporting the POWER architecture.
6554
6555You use these options to specify which instructions are available on the
6556processor you are using. The default value of these options is
161d7b59 6557determined when configuring GCC@. Specifying the
630d3d5a
JM
6558@option{-mcpu=@var{cpu_type}} overrides the specification of these
6559options. We recommend you use the @option{-mcpu=@var{cpu_type}} option
74291a4b
MM
6560rather than the options listed above.
6561
630d3d5a 6562The @option{-mpower} option allows GCC to generate instructions that
74291a4b 6563are found only in the POWER architecture and to use the MQ register.
630d3d5a 6564Specifying @option{-mpower2} implies @option{-power} and also allows GCC
74291a4b
MM
6565to generate instructions that are present in the POWER2 architecture but
6566not the original POWER architecture.
6567
630d3d5a 6568The @option{-mpowerpc} option allows GCC to generate instructions that
74291a4b 6569are found only in the 32-bit subset of the PowerPC architecture.
630d3d5a 6570Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
0c2d1a2a 6571GCC to use the optional PowerPC architecture instructions in the
74291a4b 6572General Purpose group, including floating-point square root. Specifying
630d3d5a 6573@option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
74291a4b
MM
6574use the optional PowerPC architecture instructions in the Graphics
6575group, including floating-point select.
6576
630d3d5a 6577The @option{-mpowerpc64} option allows GCC to generate the additional
7fe90e7b 657864-bit instructions that are found in the full PowerPC64 architecture
0c2d1a2a 6579and to treat GPRs as 64-bit, doubleword quantities. GCC defaults to
630d3d5a 6580@option{-mno-powerpc64}.
7fe90e7b 6581
630d3d5a 6582If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
74291a4b
MM
6583will use only the instructions in the common subset of both
6584architectures plus some special AIX common-mode calls, and will not use
630d3d5a 6585the MQ register. Specifying both @option{-mpower} and @option{-mpowerpc}
0c2d1a2a 6586permits GCC to use any instruction from either architecture and to
74291a4b
MM
6587allow use of the MQ register; specify this for the Motorola MPC601.
6588
6589@item -mnew-mnemonics
6590@itemx -mold-mnemonics
cd3bb277
JM
6591@opindex mnew-mnemonics
6592@opindex mold-mnemonics
9c34dbbf
ZW
6593Select which mnemonics to use in the generated assembler code. With
6594@option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
6595the PowerPC architecture. With @option{-mold-mnemonics} it uses the
6596assembler mnemonics defined for the POWER architecture. Instructions
6597defined in only one architecture have only one mnemonic; GCC uses that
6598mnemonic irrespective of which of these options is specified.
74291a4b 6599
0c2d1a2a 6600GCC defaults to the mnemonics appropriate for the architecture in
630d3d5a 6601use. Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
7fe90e7b 6602value of these option. Unless you are building a cross-compiler, you
630d3d5a
JM
6603should normally not specify either @option{-mnew-mnemonics} or
6604@option{-mold-mnemonics}, but should instead accept the default.
74291a4b
MM
6605
6606@item -mcpu=@var{cpu_type}
cd3bb277 6607@opindex mcpu
74291a4b
MM
6608Set architecture type, register usage, choice of mnemonics, and
6609instruction scheduling parameters for machine type @var{cpu_type}.
5f59ecb7
DE
6610Supported values for @var{cpu_type} are @samp{rios}, @samp{rios1},
6611@samp{rsc}, @samp{rios2}, @samp{rs64a}, @samp{601}, @samp{602},
6612@samp{603}, @samp{603e}, @samp{604}, @samp{604e}, @samp{620},
ed947a96
DJ
6613@samp{630}, @samp{740}, @samp{7400}, @samp{7450}, @samp{750},
6614@samp{power}, @samp{power2}, @samp{powerpc}, @samp{403}, @samp{505},
6615@samp{801}, @samp{821}, @samp{823}, and @samp{860} and @samp{common}.
9c34dbbf
ZW
6616
6617@option{-mcpu=common} selects a completely generic processor. Code
6618generated under this option will run on any POWER or PowerPC processor.
6619GCC will use only the instructions in the common subset of both
6620architectures, and will not use the MQ register. GCC assumes a generic
74291a4b
MM
6621processor model for scheduling purposes.
6622
9c34dbbf
ZW
6623@option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
6624@option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
6625PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
6626types, with an appropriate, generic processor model assumed for
6627scheduling purposes.
74291a4b 6628
9c34dbbf
ZW
6629The other options specify a specific processor. Code generated under
6630those options will run best on that processor, and may not run at all on
6631others.
6632
6633The @option{-mcpu} options automatically enable or disable other
6634@option{-m} options as follows:
6635
6636@table @samp
6637@item common
6638@option{-mno-power}, @option{-mno-powerc}
6639
6640@item power
6641@itemx power2
6642@itemx rios1
6643@itemx rios2
6644@itemx rsc
6645@option{-mpower}, @option{-mno-powerpc}, @option{-mno-new-mnemonics}
6646
6647@item powerpc
6648@itemx rs64a
6649@itemx 602
6650@itemx 603
6651@itemx 603e
6652@itemx 604
6653@itemx 620
6654@itemx 630
6655@itemx 740
ed947a96
DJ
6656@itemx 7400
6657@itemx 7450
9c34dbbf
ZW
6658@itemx 750
6659@itemx 505
6660@option{-mno-power}, @option{-mpowerpc}, @option{-mnew-mnemonics}
6661
6662@item 601
6663@option{-mpower}, @option{-mpowerpc}, @option{-mnew-mnemonics}
6664
6665@item 403
6666@itemx 821
6667@itemx 860
6668@option{-mno-power}, @option{-mpowerpc}, @option{-mnew-mnemonics}, @option{-msoft-float}
6669@end table
74291a4b
MM
6670
6671@item -mtune=@var{cpu_type}
cd3bb277 6672@opindex mtune
74291a4b 6673Set the instruction scheduling parameters for machine type
9c34dbbf
ZW
6674@var{cpu_type}, but do not set the architecture type, register usage, or
6675choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would. The same
6676values for @var{cpu_type} are used for @option{-mtune} as for
6677@option{-mcpu}. If both are specified, the code generated will use the
6678architecture, registers, and mnemonics set by @option{-mcpu}, but the
6679scheduling parameters set by @option{-mtune}.
74291a4b 6680
0ac081f6
AH
6681@item -maltivec
6682@itemx -mno-altivec
6683@opindex maltivec
6684@opindex mno-altivec
6685These switches enable or disable the use of built-in functions that
6686allow access to the AltiVec instruction set. You may also need to set
6687@option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
6688enhancements.
6689
74291a4b
MM
6690@item -mfull-toc
6691@itemx -mno-fp-in-toc
6692@itemx -mno-sum-in-toc
6693@itemx -mminimal-toc
cd3bb277
JM
6694@opindex mfull-toc
6695@opindex mno-fp-in-toc
6696@opindex mno-sum-in-toc
6697@opindex mminimal-toc
74291a4b 6698Modify generation of the TOC (Table Of Contents), which is created for
630d3d5a 6699every executable file. The @option{-mfull-toc} option is selected by
0c2d1a2a
JB
6700default. In that case, GCC will allocate at least one TOC entry for
6701each unique non-automatic variable reference in your program. GCC
161d7b59
JM
6702will also place floating-point constants in the TOC@. However, only
670316,384 entries are available in the TOC@.
74291a4b
MM
6704
6705If you receive a linker error message that saying you have overflowed
6706the available TOC space, you can reduce the amount of TOC space used
630d3d5a
JM
6707with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
6708@option{-mno-fp-in-toc} prevents GCC from putting floating-point
6709constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
74291a4b 6710generate code to calculate the sum of an address and a constant at
161d7b59 6711run-time instead of putting that sum into the TOC@. You may specify one
0c2d1a2a 6712or both of these options. Each causes GCC to produce very slightly
74291a4b
MM
6713slower and larger code at the expense of conserving TOC space.
6714
6715If you still run out of space in the TOC even when you specify both of
630d3d5a 6716these options, specify @option{-mminimal-toc} instead. This option causes
0c2d1a2a
JB
6717GCC to make only one TOC entry for every file. When you specify this
6718option, GCC will produce code that is slower and larger but which
74291a4b 6719uses extremely little TOC space. You may wish to use this option
bd819a4a 6720only on files that contain less frequently executed code.
74291a4b 6721
fa06229f
GK
6722@item -maix64
6723@itemx -maix32
cd3bb277
JM
6724@opindex maix64
6725@opindex maix32
fa06229f 6726Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
7fe90e7b 6727@code{long} type, and the infrastructure needed to support them.
630d3d5a
JM
6728Specifying @option{-maix64} implies @option{-mpowerpc64} and
6729@option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
6730implies @option{-mno-powerpc64}. GCC defaults to @option{-maix32}.
7fe90e7b 6731
74291a4b
MM
6732@item -mxl-call
6733@itemx -mno-xl-call
cd3bb277
JM
6734@opindex mxl-call
6735@opindex mno-xl-call
74291a4b
MM
6736On AIX, pass floating-point arguments to prototyped functions beyond the
6737register save area (RSA) on the stack in addition to argument FPRs. The
6738AIX calling convention was extended but not initially documented to
6739handle an obscure K&R C case of calling a function that takes the
6740address of its arguments with fewer arguments than declared. AIX XL
7fe90e7b
DE
6741compilers access floating point arguments which do not fit in the
6742RSA from the stack when a subroutine is compiled without
74291a4b
MM
6743optimization. Because always storing floating-point arguments on the
6744stack is inefficient and rarely needed, this option is not enabled by
6745default and only is necessary when calling subroutines compiled by AIX
6746XL compilers without optimization.
6747
861bb6c1 6748@item -mpe
cd3bb277 6749@opindex mpe
161d7b59 6750Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@. Link an
861bb6c1
JL
6751application written to use message passing with special startup code to
6752enable the application to run. The system must have PE installed in the
6753standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
630d3d5a 6754must be overridden with the @option{-specs=} option to specify the
861bb6c1 6755appropriate directory location. The Parallel Environment does not
0a379b7a 6756support threads, so the @option{-mpe} option and the @option{-pthread}
861bb6c1
JL
6757option are incompatible.
6758
74291a4b
MM
6759@item -msoft-float
6760@itemx -mhard-float
cd3bb277
JM
6761@opindex msoft-float
6762@opindex mhard-float
74291a4b
MM
6763Generate code that does not use (uses) the floating-point register set.
6764Software floating point emulation is provided if you use the
630d3d5a 6765@option{-msoft-float} option, and pass the option to GCC when linking.
74291a4b
MM
6766
6767@item -mmultiple
6768@itemx -mno-multiple
cd3bb277
JM
6769@opindex mmultiple
6770@opindex mno-multiple
74291a4b
MM
6771Generate code that uses (does not use) the load multiple word
6772instructions and the store multiple word instructions. These
6773instructions are generated by default on POWER systems, and not
630d3d5a 6774generated on PowerPC systems. Do not use @option{-mmultiple} on little
74291a4b 6775endian PowerPC systems, since those instructions do not work when the
bef84347
VM
6776processor is in little endian mode. The exceptions are PPC740 and
6777PPC750 which permit the instructions usage in little endian mode.
74291a4b
MM
6778
6779@item -mstring
6780@itemx -mno-string
cd3bb277
JM
6781@opindex mstring
6782@opindex mno-string
bef84347
VM
6783Generate code that uses (does not use) the load string instructions
6784and the store string word instructions to save multiple registers and
6785do small block moves. These instructions are generated by default on
6786POWER systems, and not generated on PowerPC systems. Do not use
630d3d5a 6787@option{-mstring} on little endian PowerPC systems, since those
bef84347
VM
6788instructions do not work when the processor is in little endian mode.
6789The exceptions are PPC740 and PPC750 which permit the instructions
6790usage in little endian mode.
74291a4b 6791
861bb6c1
JL
6792@item -mupdate
6793@itemx -mno-update
cd3bb277
JM
6794@opindex mupdate
6795@opindex mno-update
861bb6c1
JL
6796Generate code that uses (does not use) the load or store instructions
6797that update the base register to the address of the calculated memory
6798location. These instructions are generated by default. If you use
630d3d5a 6799@option{-mno-update}, there is a small window between the time that the
861bb6c1
JL
6800stack pointer is updated and the address of the previous frame is
6801stored, which means code that walks the stack frame across interrupts or
6802signals may get corrupted data.
6803
6804@item -mfused-madd
6805@itemx -mno-fused-madd
cd3bb277
JM
6806@opindex mfused-madd
6807@opindex mno-fused-madd
861bb6c1
JL
6808Generate code that uses (does not use) the floating point multiply and
6809accumulate instructions. These instructions are generated by default if
6810hardware floating is used.
6811
74291a4b
MM
6812@item -mno-bit-align
6813@itemx -mbit-align
cd3bb277
JM
6814@opindex mno-bit-align
6815@opindex mbit-align
74291a4b 6816On System V.4 and embedded PowerPC systems do not (do) force structures
c771326b
JM
6817and unions that contain bit-fields to be aligned to the base type of the
6818bit-field.
74291a4b
MM
6819
6820For example, by default a structure containing nothing but 8
c771326b 6821@code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
630d3d5a 6822boundary and have a size of 4 bytes. By using @option{-mno-bit-align},
74291a4b
MM
6823the structure would be aligned to a 1 byte boundary and be one byte in
6824size.
6825
6826@item -mno-strict-align
6827@itemx -mstrict-align
cd3bb277
JM
6828@opindex mno-strict-align
6829@opindex mstrict-align
74291a4b
MM
6830On System V.4 and embedded PowerPC systems do not (do) assume that
6831unaligned memory references will be handled by the system.
6832
6833@item -mrelocatable
6834@itemx -mno-relocatable
cd3bb277
JM
6835@opindex mrelocatable
6836@opindex mno-relocatable
74291a4b
MM
6837On embedded PowerPC systems generate code that allows (does not allow)
6838the program to be relocated to a different address at runtime. If you
630d3d5a
JM
6839use @option{-mrelocatable} on any module, all objects linked together must
6840be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
74291a4b
MM
6841
6842@item -mrelocatable-lib
6843@itemx -mno-relocatable-lib
cd3bb277
JM
6844@opindex mrelocatable-lib
6845@opindex mno-relocatable-lib
74291a4b
MM
6846On embedded PowerPC systems generate code that allows (does not allow)
6847the program to be relocated to a different address at runtime. Modules
630d3d5a
JM
6848compiled with @option{-mrelocatable-lib} can be linked with either modules
6849compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
6850with modules compiled with the @option{-mrelocatable} options.
74291a4b
MM
6851
6852@item -mno-toc
6853@itemx -mtoc
cd3bb277
JM
6854@opindex mno-toc
6855@opindex mtoc
74291a4b
MM
6856On System V.4 and embedded PowerPC systems do not (do) assume that
6857register 2 contains a pointer to a global area pointing to the addresses
6858used in the program.
6859
74291a4b
MM
6860@item -mlittle
6861@itemx -mlittle-endian
cd3bb277
JM
6862@opindex mlittle
6863@opindex mlittle-endian
74291a4b 6864On System V.4 and embedded PowerPC systems compile code for the
630d3d5a
JM
6865processor in little endian mode. The @option{-mlittle-endian} option is
6866the same as @option{-mlittle}.
74291a4b
MM
6867
6868@item -mbig
6869@itemx -mbig-endian
cd3bb277
JM
6870@opindex mbig
6871@opindex mbig-endian
74291a4b 6872On System V.4 and embedded PowerPC systems compile code for the
630d3d5a
JM
6873processor in big endian mode. The @option{-mbig-endian} option is
6874the same as @option{-mbig}.
74291a4b
MM
6875
6876@item -mcall-sysv
cd3bb277 6877@opindex mcall-sysv
74291a4b
MM
6878On System V.4 and embedded PowerPC systems compile code using calling
6879conventions that adheres to the March 1995 draft of the System V
6880Application Binary Interface, PowerPC processor supplement. This is the
6881default unless you configured GCC using @samp{powerpc-*-eabiaix}.
6882
6883@item -mcall-sysv-eabi
cd3bb277 6884@opindex mcall-sysv-eabi
630d3d5a 6885Specify both @option{-mcall-sysv} and @option{-meabi} options.
74291a4b
MM
6886
6887@item -mcall-sysv-noeabi
cd3bb277 6888@opindex mcall-sysv-noeabi
630d3d5a 6889Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
74291a4b
MM
6890
6891@item -mcall-aix
cd3bb277 6892@opindex mcall-aix
74291a4b 6893On System V.4 and embedded PowerPC systems compile code using calling
161d7b59 6894conventions that are similar to those used on AIX@. This is the
74291a4b
MM
6895default if you configured GCC using @samp{powerpc-*-eabiaix}.
6896
6897@item -mcall-solaris
cd3bb277 6898@opindex mcall-solaris
74291a4b
MM
6899On System V.4 and embedded PowerPC systems compile code for the Solaris
6900operating system.
6901
6902@item -mcall-linux
cd3bb277 6903@opindex mcall-linux
861bb6c1
JL
6904On System V.4 and embedded PowerPC systems compile code for the
6905Linux-based GNU system.
74291a4b 6906
48180d68
RM
6907@item -mcall-gnu
6908@opindex mcall-gnu
6909On System V.4 and embedded PowerPC systems compile code for the
6910Hurd-based GNU system.
6911
edf1b3f3
AC
6912@item -mcall-netbsd
6913@opindex mcall-netbsd
6914On System V.4 and embedded PowerPC systems compile code for the
6915NetBSD operating system.
6916
9904592e
ZW
6917@item -maix-struct-return
6918@opindex maix-struct-return
6919Return all structures in memory (as specified by the AIX ABI)@.
6920
6921@item -msvr4-struct-return
6922@opindex msvr4-struct-return
6923Return structures smaller than 8 bytes in registers (as specified by the
6924SVR4 ABI)@.
6925
0ac081f6
AH
6926@item -mabi=altivec
6927@opindex mabi=altivec
6928Extend the current ABI with AltiVec ABI extensions. This does not
6929change the default ABI, instead it adds the AltiVec ABI extensions to
6930the current ABI@.
6931
74291a4b 6932@item -mprototype
e9a25f70 6933@itemx -mno-prototype
cd3bb277
JM
6934@opindex mprototype
6935@opindex mno-prototype
74291a4b
MM
6936On System V.4 and embedded PowerPC systems assume that all calls to
6937variable argument functions are properly prototyped. Otherwise, the
6938compiler must insert an instruction before every non prototyped call to
6939set or clear bit 6 of the condition code register (@var{CR}) to
6940indicate whether floating point values were passed in the floating point
6941registers in case the function takes a variable arguments. With
630d3d5a 6942@option{-mprototype}, only calls to prototyped variable argument functions
74291a4b
MM
6943will set or clear the bit.
6944
6945@item -msim
cd3bb277 6946@opindex msim
74291a4b
MM
6947On embedded PowerPC systems, assume that the startup module is called
6948@file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
6949@file{libc.a}. This is the default for @samp{powerpc-*-eabisim}.
6950configurations.
6951
6952@item -mmvme
cd3bb277 6953@opindex mmvme
74291a4b 6954On embedded PowerPC systems, assume that the startup module is called
e9a25f70
JL
6955@file{crt0.o} and the standard C libraries are @file{libmvme.a} and
6956@file{libc.a}.
6957
6958@item -mads
cd3bb277 6959@opindex mads
e9a25f70
JL
6960On embedded PowerPC systems, assume that the startup module is called
6961@file{crt0.o} and the standard C libraries are @file{libads.a} and
6962@file{libc.a}.
6963
6964@item -myellowknife
cd3bb277 6965@opindex myellowknife
e9a25f70
JL
6966On embedded PowerPC systems, assume that the startup module is called
6967@file{crt0.o} and the standard C libraries are @file{libyk.a} and
74291a4b
MM
6968@file{libc.a}.
6969
bff46771 6970@item -mvxworks
cd3bb277 6971@opindex mvxworks
bff46771
GK
6972On System V.4 and embedded PowerPC systems, specify that you are
6973compiling for a VxWorks system.
6974
74291a4b 6975@item -memb
cd3bb277 6976@opindex memb
74291a4b
MM
6977On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
6978header to indicate that @samp{eabi} extended relocations are used.
6979
6980@item -meabi
6981@itemx -mno-eabi
cd3bb277
JM
6982@opindex meabi
6983@opindex mno-eabi
74291a4b
MM
6984On System V.4 and embedded PowerPC systems do (do not) adhere to the
6985Embedded Applications Binary Interface (eabi) which is a set of
bedc7537 6986modifications to the System V.4 specifications. Selecting @option{-meabi}
74291a4b
MM
6987means that the stack is aligned to an 8 byte boundary, a function
6988@code{__eabi} is called to from @code{main} to set up the eabi
630d3d5a 6989environment, and the @option{-msdata} option can use both @code{r2} and
74291a4b 6990@code{r13} to point to two separate small data areas. Selecting
bedc7537 6991@option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
74291a4b 6992do not call an initialization function from @code{main}, and the
630d3d5a
JM
6993@option{-msdata} option will only use @code{r13} to point to a single
6994small data area. The @option{-meabi} option is on by default if you
74291a4b
MM
6995configured GCC using one of the @samp{powerpc*-*-eabi*} options.
6996
6997@item -msdata=eabi
cd3bb277 6998@opindex msdata=eabi
74291a4b
MM
6999On System V.4 and embedded PowerPC systems, put small initialized
7000@code{const} global and static data in the @samp{.sdata2} section, which
7001is pointed to by register @code{r2}. Put small initialized
7002non-@code{const} global and static data in the @samp{.sdata} section,
7003which is pointed to by register @code{r13}. Put small uninitialized
7004global and static data in the @samp{.sbss} section, which is adjacent to
630d3d5a
JM
7005the @samp{.sdata} section. The @option{-msdata=eabi} option is
7006incompatible with the @option{-mrelocatable} option. The
7007@option{-msdata=eabi} option also sets the @option{-memb} option.
74291a4b
MM
7008
7009@item -msdata=sysv
cd3bb277 7010@opindex msdata=sysv
74291a4b
MM
7011On System V.4 and embedded PowerPC systems, put small global and static
7012data in the @samp{.sdata} section, which is pointed to by register
7013@code{r13}. Put small uninitialized global and static data in the
7014@samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
630d3d5a
JM
7015The @option{-msdata=sysv} option is incompatible with the
7016@option{-mrelocatable} option.
74291a4b
MM
7017
7018@item -msdata=default
7019@itemx -msdata
cd3bb277
JM
7020@opindex msdata=default
7021@opindex msdata
630d3d5a
JM
7022On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
7023compile code the same as @option{-msdata=eabi}, otherwise compile code the
7024same as @option{-msdata=sysv}.
74291a4b
MM
7025
7026@item -msdata-data
cd3bb277 7027@opindex msdata-data
74291a4b
MM
7028On System V.4 and embedded PowerPC systems, put small global and static
7029data in the @samp{.sdata} section. Put small uninitialized global and
7030static data in the @samp{.sbss} section. Do not use register @code{r13}
7031to address small data however. This is the default behavior unless
630d3d5a 7032other @option{-msdata} options are used.
74291a4b
MM
7033
7034@item -msdata=none
7035@itemx -mno-sdata
cd3bb277
JM
7036@opindex msdata=none
7037@opindex mno-sdata
74291a4b
MM
7038On embedded PowerPC systems, put all initialized global and static data
7039in the @samp{.data} section, and all uninitialized data in the
7040@samp{.bss} section.
7041
7042@item -G @var{num}
cd3bb277 7043@opindex G
74291a4b
MM
7044@cindex smaller data references (PowerPC)
7045@cindex .sdata/.sdata2 references (PowerPC)
956d6950 7046On embedded PowerPC systems, put global and static items less than or
74291a4b
MM
7047equal to @var{num} bytes into the small data or bss sections instead of
7048the normal data or bss section. By default, @var{num} is 8. The
630d3d5a
JM
7049@option{-G @var{num}} switch is also passed to the linker.
7050All modules should be compiled with the same @option{-G @var{num}} value.
74291a4b
MM
7051
7052@item -mregnames
7053@itemx -mno-regnames
cd3bb277
JM
7054@opindex mregnames
7055@opindex mno-regnames
74291a4b
MM
7056On System V.4 and embedded PowerPC systems do (do not) emit register
7057names in the assembly language output using symbolic forms.
f5a1b0d2 7058
0a379b7a
CR
7059@item -pthread
7060@opindex pthread
7061Adds support for multithreading with the @dfn{pthreads} library.
7062This option sets flags for both the preprocessor and linker.
7063
74291a4b 7064@end table
f5a1b0d2 7065
74291a4b
MM
7066@node RT Options
7067@subsection IBM RT Options
7068@cindex RT options
7069@cindex IBM RT options
7070
7071These @samp{-m} options are defined for the IBM RT PC:
7072
2642624b 7073@table @gcctabopt
74291a4b 7074@item -min-line-mul
cd3bb277 7075@opindex min-line-mul
74291a4b
MM
7076Use an in-line code sequence for integer multiplies. This is the
7077default.
7078
7079@item -mcall-lib-mul
cd3bb277 7080@opindex mcall-lib-mul
74291a4b
MM
7081Call @code{lmul$$} for integer multiples.
7082
7083@item -mfull-fp-blocks
cd3bb277 7084@opindex mfull-fp-blocks
74291a4b 7085Generate full-size floating point data blocks, including the minimum
161d7b59 7086amount of scratch space recommended by IBM@. This is the default.
74291a4b
MM
7087
7088@item -mminimum-fp-blocks
cd3bb277 7089@opindex mminimum-fp-blocks
74291a4b
MM
7090Do not include extra scratch space in floating point data blocks. This
7091results in smaller code, but slower execution, since scratch space must
7092be allocated dynamically.
7093
7094@cindex @file{varargs.h} and RT PC
7095@cindex @file{stdarg.h} and RT PC
7096@item -mfp-arg-in-fpregs
cd3bb277 7097@opindex mfp-arg-in-fpregs
74291a4b
MM
7098Use a calling sequence incompatible with the IBM calling convention in
7099which floating point arguments are passed in floating point registers.
c771326b 7100Note that @code{varargs.h} and @code{stdarg.h} will not work with
74291a4b
MM
7101floating point operands if this option is specified.
7102
7103@item -mfp-arg-in-gregs
cd3bb277 7104@opindex mfp-arg-in-gregs
74291a4b
MM
7105Use the normal calling convention for floating point arguments. This is
7106the default.
7107
7108@item -mhc-struct-return
cd3bb277 7109@opindex mhc-struct-return
74291a4b
MM
7110Return structures of more than one word in memory, rather than in a
7111register. This provides compatibility with the MetaWare HighC (hc)
630d3d5a 7112compiler. Use the option @option{-fpcc-struct-return} for compatibility
74291a4b
MM
7113with the Portable C Compiler (pcc).
7114
7115@item -mnohc-struct-return
cd3bb277 7116@opindex mnohc-struct-return
74291a4b
MM
7117Return some structures of more than one word in registers, when
7118convenient. This is the default. For compatibility with the
630d3d5a
JM
7119IBM-supplied compilers, use the option @option{-fpcc-struct-return} or the
7120option @option{-mhc-struct-return}.
74291a4b
MM
7121@end table
7122
7123@node MIPS Options
7124@subsection MIPS Options
7125@cindex MIPS options
7126
7127These @samp{-m} options are defined for the MIPS family of computers:
7128
2642624b 7129@table @gcctabopt
7dac2f89
EC
7130
7131@item -march=@var{cpu-type}
7132@opindex march
7133Assume the defaults for the machine type @var{cpu-type} when generating
7134instructions. The choices for @var{cpu-type} are @samp{r2000}, @samp{r3000},
7135@samp{r3900}, @samp{r4000}, @samp{r4100}, @samp{r4300}, @samp{r4400},
7136@samp{r4600}, @samp{r4650}, @samp{r5000}, @samp{r6000}, @samp{r8000},
7137and @samp{orion}. Additionally, the @samp{r2000}, @samp{r3000},
7138@samp{r4000}, @samp{r5000}, and @samp{r6000} can be abbreviated as
7139@samp{r2k} (or @samp{r2K}), @samp{r3k}, etc.
7140
7141@item -mtune=@var{cpu-type}
7142@opindex mtune
630d3d5a
JM
7143Assume the defaults for the machine type @var{cpu-type} when scheduling
7144instructions. The choices for @var{cpu-type} are @samp{r2000}, @samp{r3000},
8b9243df
JJ
7145@samp{r3900}, @samp{r4000}, @samp{r4100}, @samp{r4300}, @samp{r4400},
7146@samp{r4600}, @samp{r4650}, @samp{r5000}, @samp{r6000}, @samp{r8000},
7147and @samp{orion}. Additionally, the @samp{r2000}, @samp{r3000},
7148@samp{r4000}, @samp{r5000}, and @samp{r6000} can be abbreviated as
7149@samp{r2k} (or @samp{r2K}), @samp{r3k}, etc. While picking a specific
630d3d5a 7150@var{cpu-type} will schedule things appropriately for that particular
8b9243df 7151chip, the compiler will not generate any code that does not meet level 1
630d3d5a
JM
7152of the MIPS ISA (instruction set architecture) without a @option{-mipsX}
7153or @option{-mabi} switch being used.
74291a4b 7154
7dac2f89
EC
7155@item -mcpu=@var{cpu-type}
7156@opindex mcpu
7157This is identical to specifying both @option{-march} and @option{-mtune}.
7158
74291a4b 7159@item -mips1
cd3bb277 7160@opindex mips1
161d7b59 7161Issue instructions from level 1 of the MIPS ISA@. This is the default.
630d3d5a 7162@samp{r3000} is the default @var{cpu-type} at this ISA level.
74291a4b
MM
7163
7164@item -mips2
cd3bb277 7165@opindex mips2
74291a4b 7166Issue instructions from level 2 of the MIPS ISA (branch likely, square
630d3d5a 7167root instructions). @samp{r6000} is the default @var{cpu-type} at this
74291a4b
MM
7168ISA level.
7169
7170@item -mips3
cd3bb277 7171@opindex mips3
02f52e19 7172Issue instructions from level 3 of the MIPS ISA (64-bit instructions).
630d3d5a 7173@samp{r4000} is the default @var{cpu-type} at this ISA level.
74291a4b 7174
3398f47f 7175@item -mips4
cd3bb277 7176@opindex mips4
8b9243df
JJ
7177Issue instructions from level 4 of the MIPS ISA (conditional move,
7178prefetch, enhanced FPU instructions). @samp{r8000} is the default
630d3d5a 7179@var{cpu-type} at this ISA level.
3398f47f 7180
74291a4b 7181@item -mfp32
cd3bb277 7182@opindex mfp32
74291a4b
MM
7183Assume that 32 32-bit floating point registers are available. This is
7184the default.
7185
7186@item -mfp64
cd3bb277 7187@opindex mfp64
74291a4b 7188Assume that 32 64-bit floating point registers are available. This is
630d3d5a 7189the default when the @option{-mips3} option is used.
74291a4b 7190
13fac94a
GK
7191@item -mfused-madd
7192@itemx -mno-fused-madd
7193@opindex mfused-madd
7194@opindex mno-fused-madd
7195Generate code that uses (does not use) the floating point multiply and
7196accumulate instructions, when they are available. These instructions
7197are generated by default if they are available, but this may be
7198undesirable if the extra precision causes problems or on certain chips
7199in the mode where denormals are rounded to zero where denormals
7200generated by multiply and accumulate instructions cause exceptions
7201anyway.
7202
74291a4b 7203@item -mgp32
cd3bb277 7204@opindex mgp32
74291a4b
MM
7205Assume that 32 32-bit general purpose registers are available. This is
7206the default.
7207
7208@item -mgp64
cd3bb277 7209@opindex mgp64
74291a4b 7210Assume that 32 64-bit general purpose registers are available. This is
630d3d5a 7211the default when the @option{-mips3} option is used.
74291a4b
MM
7212
7213@item -mint64
cd3bb277 7214@opindex mint64
630d3d5a 7215Force int and long types to be 64 bits wide. See @option{-mlong32} for an
3ce1ba83 7216explanation of the default, and the width of pointers.
74291a4b
MM
7217
7218@item -mlong64
cd3bb277 7219@opindex mlong64
630d3d5a 7220Force long types to be 64 bits wide. See @option{-mlong32} for an
3ce1ba83 7221explanation of the default, and the width of pointers.
fb1bf66d 7222
3ce1ba83 7223@item -mlong32
cd3bb277 7224@opindex mlong32
3ce1ba83
GRK
7225Force long, int, and pointer types to be 32 bits wide.
7226
630d3d5a 7227If none of @option{-mlong32}, @option{-mlong64}, or @option{-mint64} are set,
b192711e 7228the size of ints, longs, and pointers depends on the ABI and ISA chosen.
630d3d5a
JM
7229For @option{-mabi=32}, and @option{-mabi=n32}, ints and longs are 32 bits
7230wide. For @option{-mabi=64}, ints are 32 bits, and longs are 64 bits wide.
7231For @option{-mabi=eabi} and either @option{-mips1} or @option{-mips2}, ints
7232and longs are 32 bits wide. For @option{-mabi=eabi} and higher ISAs, ints
3ce1ba83
GRK
7233are 32 bits, and longs are 64 bits wide. The width of pointer types is
7234the smaller of the width of longs or the width of general purpose
161d7b59 7235registers (which in turn depends on the ISA)@.
74291a4b 7236
62a1403d 7237@item -mabi=32
8b9243df 7238@itemx -mabi=o64
3398f47f
MM
7239@itemx -mabi=n32
7240@itemx -mabi=64
7241@itemx -mabi=eabi
cd3bb277
JM
7242@opindex mabi=32
7243@opindex mabi=o64
7244@opindex mabi=n32
7245@opindex mabi=64
7246@opindex mabi=eabi
161d7b59 7247Generate code for the indicated ABI@. The default instruction level is
630d3d5a
JM
7248@option{-mips1} for @samp{32}, @option{-mips3} for @samp{n32}, and
7249@option{-mips4} otherwise. Conversely, with @option{-mips1} or
7250@option{-mips2}, the default ABI is @samp{32}; otherwise, the default ABI
8b9243df 7251is @samp{64}.
3398f47f 7252
74291a4b 7253@item -mmips-as
cd3bb277 7254@opindex mmips-as
74291a4b
MM
7255Generate code for the MIPS assembler, and invoke @file{mips-tfile} to
7256add normal debug information. This is the default for all
7257platforms except for the OSF/1 reference platform, using the OSF/rose
630d3d5a 7258object format. If the either of the @option{-gstabs} or @option{-gstabs+}
74291a4b 7259switches are used, the @file{mips-tfile} program will encapsulate the
161d7b59 7260stabs within MIPS ECOFF@.
74291a4b
MM
7261
7262@item -mgas
cd3bb277 7263@opindex mgas
74291a4b 7264Generate code for the GNU assembler. This is the default on the OSF/1
861bb6c1 7265reference platform, using the OSF/rose object format. Also, this is
630d3d5a 7266the default if the configure option @option{--with-gnu-as} is used.
861bb6c1
JL
7267
7268@item -msplit-addresses
7269@itemx -mno-split-addresses
cd3bb277
JM
7270@opindex msplit-addresses
7271@opindex mno-split-addresses
861bb6c1 7272Generate code to load the high and low parts of address constants separately.
aee96fe9 7273This allows GCC to optimize away redundant loads of the high order
861bb6c1
JL
7274bits of addresses. This optimization requires GNU as and GNU ld.
7275This optimization is enabled by default for some embedded targets where
7276GNU as and GNU ld are standard.
74291a4b
MM
7277
7278@item -mrnames
7279@itemx -mno-rnames
cd3bb277
JM
7280@opindex mrnames
7281@opindex mno-rnames
630d3d5a 7282The @option{-mrnames} switch says to output code using the MIPS software
74291a4b
MM
7283names for the registers, instead of the hardware names (ie, @var{a0}
7284instead of @var{$4}). The only known assembler that supports this option
7285is the Algorithmics assembler.
7286
7287@item -mgpopt
7288@itemx -mno-gpopt
cd3bb277
JM
7289@opindex mgpopt
7290@opindex mno-gpopt
630d3d5a 7291The @option{-mgpopt} switch says to write all of the data declarations
74291a4b
MM
7292before the instructions in the text section, this allows the MIPS
7293assembler to generate one word memory references instead of using two
7294words for short global or static data items. This is on by default if
7295optimization is selected.
7296
7297@item -mstats
7298@itemx -mno-stats
cd3bb277
JM
7299@opindex mstats
7300@opindex mno-stats
630d3d5a 7301For each non-inline function processed, the @option{-mstats} switch
74291a4b
MM
7302causes the compiler to emit one line to the standard error file to
7303print statistics about the program (number of registers saved, stack
7304size, etc.).
7305
7306@item -mmemcpy
7307@itemx -mno-memcpy
cd3bb277
JM
7308@opindex mmemcpy
7309@opindex mno-memcpy
630d3d5a 7310The @option{-mmemcpy} switch makes all block moves call the appropriate
74291a4b
MM
7311string function (@samp{memcpy} or @samp{bcopy}) instead of possibly
7312generating inline code.
7313
7314@item -mmips-tfile
7315@itemx -mno-mips-tfile
cd3bb277
JM
7316@opindex mmips-tfile
7317@opindex mno-mips-tfile
630d3d5a 7318The @option{-mno-mips-tfile} switch causes the compiler not
74291a4b
MM
7319postprocess the object file with the @file{mips-tfile} program,
7320after the MIPS assembler has generated it to add debug support. If
7321@file{mips-tfile} is not run, then no local variables will be
7322available to the debugger. In addition, @file{stage2} and
7323@file{stage3} objects will have the temporary file names passed to the
7324assembler embedded in the object file, which means the objects will
630d3d5a 7325not compare the same. The @option{-mno-mips-tfile} switch should only
74291a4b
MM
7326be used when there are bugs in the @file{mips-tfile} program that
7327prevents compilation.
7328
7329@item -msoft-float
cd3bb277 7330@opindex msoft-float
74291a4b 7331Generate output containing library calls for floating point.
161d7b59 7332@strong{Warning:} the requisite libraries are not part of GCC@.
74291a4b
MM
7333Normally the facilities of the machine's usual C compiler are used, but
7334this can't be done directly in cross-compilation. You must make your
7335own arrangements to provide suitable library functions for
7336cross-compilation.
7337
7338@item -mhard-float
cd3bb277 7339@opindex mhard-float
74291a4b
MM
7340Generate output containing floating point instructions. This is the
7341default if you use the unmodified sources.
7342
7343@item -mabicalls
7344@itemx -mno-abicalls
cd3bb277
JM
7345@opindex mabicalls
7346@opindex mno-abicalls
74291a4b
MM
7347Emit (or do not emit) the pseudo operations @samp{.abicalls},
7348@samp{.cpload}, and @samp{.cprestore} that some System V.4 ports use for
7349position independent code.
7350
7351@item -mlong-calls
7352@itemx -mno-long-calls
cd3bb277
JM
7353@opindex mlong-calls
7354@opindex mno-long-calls
74291a4b
MM
7355Do all calls with the @samp{JALR} instruction, which requires
7356loading up a function's address into a register before the call.
7357You need to use this switch, if you call outside of the current
7358512 megabyte segment to functions that are not through pointers.
7359
7360@item -mhalf-pic
7361@itemx -mno-half-pic
cd3bb277
JM
7362@opindex mhalf-pic
7363@opindex mno-half-pic
74291a4b
MM
7364Put pointers to extern references into the data section and load them
7365up, rather than put the references in the text section.
7366
7367@item -membedded-pic
7368@itemx -mno-embedded-pic
cd3bb277
JM
7369@opindex membedded-pic
7370@opindex mno-embedded-pic
69fa83cf
JW
7371Generate PIC code suitable for some embedded systems. All calls are
7372made using PC relative address, and all data is addressed using the $gp
7373register. No more than 65536 bytes of global data may be used. This
7374requires GNU as and GNU ld which do most of the work. This currently
161d7b59 7375only works on targets which use ECOFF; it does not work with ELF@.
74291a4b
MM
7376
7377@item -membedded-data
7378@itemx -mno-embedded-data
cd3bb277
JM
7379@opindex membedded-data
7380@opindex mno-embedded-data
74291a4b
MM
7381Allocate variables to the read-only data section first if possible, then
7382next in the small data section if possible, otherwise in data. This gives
7383slightly slower code than the default, but reduces the amount of RAM required
7384when executing, and thus may be preferred for some embedded systems.
7385
919509ce
DN
7386@item -muninit-const-in-rodata
7387@itemx -mno-uninit-const-in-rodata
cd3bb277
JM
7388@opindex muninit-const-in-rodata
7389@opindex mno-uninit-const-in-rodata
695ac33f 7390When used together with @option{-membedded-data}, it will always store uninitialized
919509ce 7391const variables in the read-only data section.
02f52e19 7392
74291a4b
MM
7393@item -msingle-float
7394@itemx -mdouble-float
cd3bb277
JM
7395@opindex msingle-float
7396@opindex mdouble-float
630d3d5a 7397The @option{-msingle-float} switch tells gcc to assume that the floating
74291a4b 7398point coprocessor only supports single precision operations, as on the
630d3d5a 7399@samp{r4650} chip. The @option{-mdouble-float} switch permits gcc to use
74291a4b
MM
7400double precision operations. This is the default.
7401
7402@item -mmad
7403@itemx -mno-mad
cd3bb277
JM
7404@opindex mmad
7405@opindex mno-mad
74291a4b
MM
7406Permit use of the @samp{mad}, @samp{madu} and @samp{mul} instructions,
7407as on the @samp{r4650} chip.
7408
7409@item -m4650
cd3bb277 7410@opindex m4650
630d3d5a
JM
7411Turns on @option{-msingle-float}, @option{-mmad}, and, at least for now,
7412@option{-mcpu=r4650}.
74291a4b 7413
8b9243df
JJ
7414@item -mips16
7415@itemx -mno-mips16
cd3bb277
JM
7416@opindex mips16
7417@opindex mno-mips16
8b9243df
JJ
7418Enable 16-bit instructions.
7419
7420@item -mentry
cd3bb277 7421@opindex mentry
8b9243df 7422Use the entry and exit pseudo ops. This option can only be used with
630d3d5a 7423@option{-mips16}.
8b9243df 7424
74291a4b 7425@item -EL
cd3bb277 7426@opindex EL
74291a4b
MM
7427Compile code for the processor in little endian mode.
7428The requisite libraries are assumed to exist.
7429
7430@item -EB
cd3bb277 7431@opindex EB
74291a4b
MM
7432Compile code for the processor in big endian mode.
7433The requisite libraries are assumed to exist.
7434
7435@item -G @var{num}
cd3bb277 7436@opindex G
74291a4b
MM
7437@cindex smaller data references (MIPS)
7438@cindex gp-relative references (MIPS)
7439Put global and static items less than or equal to @var{num} bytes into
7440the small data or bss sections instead of the normal data or bss
7441section. This allows the assembler to emit one word memory reference
7442instructions based on the global pointer (@var{gp} or @var{$28}),
7443instead of the normal two words used. By default, @var{num} is 8 when
7444the MIPS assembler is used, and 0 when the GNU assembler is used. The
630d3d5a
JM
7445@option{-G @var{num}} switch is also passed to the assembler and linker.
7446All modules should be compiled with the same @option{-G @var{num}}
74291a4b
MM
7447value.
7448
7449@item -nocpp
cd3bb277 7450@opindex nocpp
9ec36da5 7451Tell the MIPS assembler to not run its preprocessor over user
74291a4b 7452assembler files (with a @samp{.s} suffix) when assembling them.
63357d93 7453
1e387156 7454@item -mfix7000
cd3bb277 7455@opindex mfix7000
1e387156
CM
7456Pass an option to gas which will cause nops to be inserted if
7457the read of the destination register of an mfhi or mflo instruction
7458occurs in the following two instructions.
7459
63357d93 7460@item -no-crt0
cd3bb277 7461@opindex no-crt0
63357d93 7462Do not include the default crt0.
d490e8ad
DD
7463
7464@item -mflush-func=@var{func}
7465@itemx -mno-flush-func
7466@opindex mflush-func
7467Specifies the function to call to flush the I and D caches, or to not
7468call any such function. If called, the function must take the same
7469arguments as the common @code{_flush_func()}, that is, the address of the
7470memory range for which the cache is being flushed, the size of the
7471memory range, and the number 3 (to flush both caches). The default
7472depends on the target gcc was configured for, but commonly is either
7473@samp{_flush_func} or @samp{__cpu_flush}.
74291a4b
MM
7474@end table
7475
74291a4b
MM
7476These options are defined by the macro
7477@code{TARGET_SWITCHES} in the machine description. The default for the
7478options is also defined by that macro, which enables you to change the
7479defaults.
74291a4b 7480
14f73b5a
JH
7481@node i386 and x86-64 Options
7482@subsection Intel 386 and AMD x86-64 Options
74291a4b 7483@cindex i386 Options
14f73b5a 7484@cindex x86-64 Options
74291a4b 7485@cindex Intel 386 Options
14f73b5a 7486@cindex AMD x86-64 Options
74291a4b 7487
14f73b5a
JH
7488These @samp{-m} options are defined for the i386 and x86-64 family of
7489computers:
74291a4b 7490
2642624b 7491@table @gcctabopt
630d3d5a 7492@item -mcpu=@var{cpu-type}
cd3bb277 7493@opindex mcpu
0dd0e980
JH
7494Tune to @var{cpu-type} everything applicable about the generated code, except
7495for the ABI and the set of available instructions. The choices for
7496@var{cpu-type} are @samp{i386}, @samp{i486}, @samp{i586}, @samp{i686},
7497@samp{pentium}, @samp{pentium-mmx}, @samp{pentiumpro}, @samp{pentium2},
7498@samp{pentium3}, @samp{pentium4}, @samp{k6}, @samp{k6-2}, @samp{k6-3},
7499@samp{athlon}, @samp{athlon-tbird}, @samp{athlon-4}, @samp{athlon-xp}
7500and @samp{athlon-mp}.
6f670fde 7501
630d3d5a 7502While picking a specific @var{cpu-type} will schedule things appropriately
6f670fde 7503for that particular chip, the compiler will not generate any code that
630d3d5a 7504does not run on the i386 without the @option{-march=@var{cpu-type}} option
7001ee2d 7505being used. @samp{i586} is equivalent to @samp{pentium} and @samp{i686}
6ca3ad1b 7506is equivalent to @samp{pentiumpro}. @samp{k6} and @samp{athlon} are the
b4e89e2d 7507AMD chips as opposed to the Intel ones.
a9f3e1a4 7508
630d3d5a 7509@item -march=@var{cpu-type}
cd3bb277 7510@opindex march
630d3d5a
JM
7511Generate instructions for the machine type @var{cpu-type}. The choices
7512for @var{cpu-type} are the same as for @option{-mcpu}. Moreover,
7513specifying @option{-march=@var{cpu-type}} implies @option{-mcpu=@var{cpu-type}}.
a9f3e1a4
JL
7514
7515@item -m386
7516@itemx -m486
7517@itemx -mpentium
7518@itemx -mpentiumpro
cd3bb277
JM
7519@opindex m386
7520@opindex m486
7521@opindex mpentium
7522@opindex mpentiumpro
9c34dbbf
ZW
7523These options are synonyms for @option{-mcpu=i386}, @option{-mcpu=i486},
7524@option{-mcpu=pentium}, and @option{-mcpu=pentiumpro} respectively.
7525These synonyms are deprecated.
74291a4b 7526
965f5423
JH
7527@item -mfpmath=@var{unit}
7528@opindex march
7529generate floating point arithmetics for selected unit @var{unit}. the choices
7530for @var{unit} are:
7531
7532@table @samp
7533@item 387
7534Use the standard 387 floating point coprocessor present majority of chips and
7535emulated otherwise. Code compiled with this option will run almost everywhere.
7536The temporary results are computed in 80bit precesion instead of precision
7537specified by the type resulting in slightly different results compared to most
7538of other chips. See @option{-ffloat-store} for more detailed description.
7539
7540This is the default choice for i386 compiler.
7541
7542@item sse
7543Use scalar floating point instructions present in the SSE instruction set.
7544This instruction set is supported by Pentium3 and newer chips, in the AMD line
7545by Athlon-4, Athlon-xp and Athlon-mp chips. The earlier version of SSE
7546instruction set supports only single precision arithmetics, thus the double and
7547extended precision arithmetics is still done using 387. Later version, present
7548only in Pentium4 and the future AMD x86-64 chips supports double precision
7549arithmetics too.
7550
7551For i387 you need to use @option{-march=@var{cpu-type}}, @option{-msse} or
7552@option{-msse2} switches to enable SSE extensions and make this option
7553effective. For x86-64 compiler, these extensions are enabled by default.
7554
7555The resulting code should be considerably faster in majority of cases and avoid
7556the numerical instability problems of 387 code, but may break some existing
7557code that expects temporaries to be 80bit.
7558
7559This is the default choice for x86-64 compiler.
7560
7561@item sse,387
7562Attempt to utilize both instruction sets at once. This effectivly double the
7563amount of available registers and on chips with separate execution units for
7564387 and SSE the execution resources too. Use this option with care, as it is
7565still experimental, because gcc register allocator does not model separate
7566functional units well resulting in instable performance.
7567@end table
7568
c93e80a5
JH
7569@item -masm=@var{dialect}
7570@opindex masm=@var{dialect}
7571Output asm instructions using selected @var{dialect}. Supported choices are
7572@samp{intel} or @samp{att} (the default one).
04e149ab 7573
74291a4b
MM
7574@item -mieee-fp
7575@itemx -mno-ieee-fp
cd3bb277
JM
7576@opindex mieee-fp
7577@opindex mno-ieee-fp
74291a4b
MM
7578Control whether or not the compiler uses IEEE floating point
7579comparisons. These handle correctly the case where the result of a
7580comparison is unordered.
7581
7582@item -msoft-float
cd3bb277 7583@opindex msoft-float
74291a4b 7584Generate output containing library calls for floating point.
161d7b59 7585@strong{Warning:} the requisite libraries are not part of GCC@.
74291a4b
MM
7586Normally the facilities of the machine's usual C compiler are used, but
7587this can't be done directly in cross-compilation. You must make your
7588own arrangements to provide suitable library functions for
7589cross-compilation.
7590
7591On machines where a function returns floating point results in the 80387
7592register stack, some floating point opcodes may be emitted even if
630d3d5a 7593@option{-msoft-float} is used.
74291a4b
MM
7594
7595@item -mno-fp-ret-in-387
cd3bb277 7596@opindex mno-fp-ret-in-387
74291a4b
MM
7597Do not use the FPU registers for return values of functions.
7598
7599The usual calling convention has functions return values of types
7600@code{float} and @code{double} in an FPU register, even if there
161d7b59
JM
7601is no FPU@. The idea is that the operating system should emulate
7602an FPU@.
74291a4b 7603
630d3d5a 7604The option @option{-mno-fp-ret-in-387} causes such values to be returned
74291a4b
MM
7605in ordinary CPU registers instead.
7606
7607@item -mno-fancy-math-387
cd3bb277 7608@opindex mno-fancy-math-387
74291a4b
MM
7609Some 387 emulators do not support the @code{sin}, @code{cos} and
7610@code{sqrt} instructions for the 387. Specify this option to avoid
161d7b59 7611generating those instructions. This option is the default on FreeBSD@.
74291a4b 7612As of revision 2.6.1, these instructions are not generated unless you
630d3d5a 7613also use the @option{-funsafe-math-optimizations} switch.
74291a4b
MM
7614
7615@item -malign-double
7616@itemx -mno-align-double
cd3bb277
JM
7617@opindex malign-double
7618@opindex mno-align-double
0c2d1a2a 7619Control whether GCC aligns @code{double}, @code{long double}, and
74291a4b
MM
7620@code{long long} variables on a two word boundary or a one word
7621boundary. Aligning @code{double} variables on a two word boundary will
7622produce code that runs somewhat faster on a @samp{Pentium} at the
7623expense of more memory.
7624
2b589241 7625@item -m128bit-long-double
cd3bb277 7626@opindex m128bit-long-double
2b589241
JH
7627Control the size of @code{long double} type. i386 application binary interface
7628specify the size to be 12 bytes, while modern architectures (Pentium and newer)
c771326b 7629prefer @code{long double} aligned to 8 or 16 byte boundary. This is
2b589241
JH
7630impossible to reach with 12 byte long doubles in the array accesses.
7631
630d3d5a 7632@strong{Warning:} if you use the @option{-m128bit-long-double} switch, the
2b589241
JH
7633structures and arrays containing @code{long double} will change their size as
7634well as function calling convention for function taking @code{long double}
02f52e19 7635will be modified.
2b589241
JH
7636
7637@item -m96bit-long-double
cd3bb277 7638@opindex m96bit-long-double
0a75e5c3 7639Set the size of @code{long double} to 96 bits as required by the i386
2b589241 7640application binary interface. This is the default.
74291a4b
MM
7641
7642@item -msvr3-shlib
7643@itemx -mno-svr3-shlib
cd3bb277
JM
7644@opindex msvr3-shlib
7645@opindex mno-svr3-shlib
9c34dbbf
ZW
7646Control whether GCC places uninitialized local variables into the
7647@code{bss} or @code{data} segments. @option{-msvr3-shlib} places them
7648into @code{bss}. These options are meaningful only on System V Release 3.
74291a4b 7649
74291a4b 7650@item -mrtd
cd3bb277 7651@opindex mrtd
74291a4b
MM
7652Use a different function-calling convention, in which functions that
7653take a fixed number of arguments return with the @code{ret} @var{num}
7654instruction, which pops their arguments while returning. This saves one
7655instruction in the caller since there is no need to pop the arguments
7656there.
7657
7658You can specify that an individual function is called with this calling
7659sequence with the function attribute @samp{stdcall}. You can also
630d3d5a 7660override the @option{-mrtd} option by using the function attribute
0b433de6 7661@samp{cdecl}. @xref{Function Attributes}.
74291a4b
MM
7662
7663@strong{Warning:} this calling convention is incompatible with the one
7664normally used on Unix, so you cannot use it if you need to call
7665libraries compiled with the Unix compiler.
7666
7667Also, you must provide function prototypes for all functions that
7668take variable numbers of arguments (including @code{printf});
7669otherwise incorrect code will be generated for calls to those
7670functions.
7671
7672In addition, seriously incorrect code will result if you call a
7673function with too many arguments. (Normally, extra arguments are
7674harmlessly ignored.)
7675
74291a4b 7676@item -mregparm=@var{num}
cd3bb277 7677@opindex mregparm
74291a4b
MM
7678Control how many registers are used to pass integer arguments. By
7679default, no registers are used to pass arguments, and at most 3
7680registers can be used. You can control this behavior for a specific
0b433de6
JL
7681function by using the function attribute @samp{regparm}.
7682@xref{Function Attributes}.
74291a4b
MM
7683
7684@strong{Warning:} if you use this switch, and
7685@var{num} is nonzero, then you must build all modules with the same
7686value, including any libraries. This includes the system libraries and
7687startup modules.
7688
3af4bd89 7689@item -mpreferred-stack-boundary=@var{num}
cd3bb277 7690@opindex mpreferred-stack-boundary
3af4bd89 7691Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
630d3d5a 7692byte boundary. If @option{-mpreferred-stack-boundary} is not specified,
fbb83b43
AO
7693the default is 4 (16 bytes or 128 bits), except when optimizing for code
7694size (@option{-Os}), in which case the default is the minimum correct
7695alignment (4 bytes for x86, and 8 bytes for x86-64).
3af4bd89 7696
fbb83b43
AO
7697On Pentium and PentiumPro, @code{double} and @code{long double} values
7698should be aligned to an 8 byte boundary (see @option{-malign-double}) or
7699suffer significant run time performance penalties. On Pentium III, the
b192711e 7700Streaming SIMD Extension (SSE) data type @code{__m128} suffers similar
3af4bd89
JH
7701penalties if it is not 16 byte aligned.
7702
7703To ensure proper alignment of this values on the stack, the stack boundary
02f52e19 7704must be as aligned as that required by any value stored on the stack.
3af4bd89
JH
7705Further, every function must be generated such that it keeps the stack
7706aligned. Thus calling a function compiled with a higher preferred
7707stack boundary from a function compiled with a lower preferred stack
7708boundary will most likely misalign the stack. It is recommended that
7709libraries that use callbacks always use the default setting.
7710
fbb83b43
AO
7711This extra alignment does consume extra stack space, and generally
7712increases code size. Code that is sensitive to stack space usage, such
7713as embedded systems and operating system kernels, may want to reduce the
7714preferred alignment to @option{-mpreferred-stack-boundary=2}.
f22a97d2 7715
1255c85c
BS
7716@item -mmmx
7717@itemx -mno-mmx
7718@item -msse
7719@itemx -mno-sse
965f5423
JH
7720@item -msse2
7721@itemx -mno-sse2
1255c85c
BS
7722@item -m3dnow
7723@itemx -mno-3dnow
7724@opindex mmmx
7725@opindex mno-mmx
7726@opindex msse
7727@opindex mno-sse
7728@opindex m3dnow
7729@opindex mno-3dnow
7730These switches enable or disable the use of built-in functions that allow
7731direct access to the MMX, SSE and 3Dnow extensions of the instruction set.
7732
80ebf43e 7733The following machine modes are available for use with MMX built-in functions
1255c85c
BS
7734(@pxref{Vector Extensions}): @code{V2SI} for a vector of two 32 bit integers,
7735@code{V4HI} for a vector of four 16 bit integers, and @code{V8QI} for a
80ebf43e
BS
7736vector of eight 8 bit integers. Some of the built-in functions operate on
7737MMX registers as a whole 64 bit entity, these use @code{DI} as their mode.
1255c85c
BS
7738
7739If 3Dnow extensions are enabled, @code{V2SF} is used as a mode for a vector
7740of two 32 bit floating point values.
7741
7742If SSE extensions are enabled, @code{V4SF} is used for a vector of four 32 bit
7743floating point values. Some instructions use a vector of four 32 bit
7744integers, these use @code{V4SI}. Finally, some instructions operate on an
7745entire vector register, interpreting it as a 128 bit integer, these use mode
7746@code{TI}.
7747
7cbe9bb7
RH
7748The following built-in functions are made available by @option{-mmmx}.
7749All of them generate the machine instruction that is part of the name.
1255c85c 7750
7cbe9bb7
RH
7751@example
7752v8qi __builtin_ia32_paddb (v8qi, v8qi)
7753v4hi __builtin_ia32_paddw (v4hi, v4hi)
7754v2si __builtin_ia32_paddd (v2si, v2si)
7755v8qi __builtin_ia32_psubb (v8qi, v8qi)
7756v4hi __builtin_ia32_psubw (v4hi, v4hi)
7757v2si __builtin_ia32_psubd (v2si, v2si)
7758v8qi __builtin_ia32_paddsb (v8qi, v8qi)
7759v4hi __builtin_ia32_paddsw (v4hi, v4hi)
7760v8qi __builtin_ia32_psubsb (v8qi, v8qi)
7761v4hi __builtin_ia32_psubsw (v4hi, v4hi)
7762v8qi __builtin_ia32_paddusb (v8qi, v8qi)
7763v4hi __builtin_ia32_paddusw (v4hi, v4hi)
7764v8qi __builtin_ia32_psubusb (v8qi, v8qi)
7765v4hi __builtin_ia32_psubusw (v4hi, v4hi)
7766v4hi __builtin_ia32_pmullw (v4hi, v4hi)
7767v4hi __builtin_ia32_pmulhw (v4hi, v4hi)
7768di __builtin_ia32_pand (di, di)
7769di __builtin_ia32_pandn (di,di)
7770di __builtin_ia32_por (di, di)
7771di __builtin_ia32_pxor (di, di)
7772v8qi __builtin_ia32_pcmpeqb (v8qi, v8qi)
7773v4hi __builtin_ia32_pcmpeqw (v4hi, v4hi)
7774v2si __builtin_ia32_pcmpeqd (v2si, v2si)
7775v8qi __builtin_ia32_pcmpgtb (v8qi, v8qi)
7776v4hi __builtin_ia32_pcmpgtw (v4hi, v4hi)
7777v2si __builtin_ia32_pcmpgtd (v2si, v2si)
7778v8qi __builtin_ia32_punpckhbw (v8qi, v8qi)
7779v4hi __builtin_ia32_punpckhwd (v4hi, v4hi)
7780v2si __builtin_ia32_punpckhdq (v2si, v2si)
7781v8qi __builtin_ia32_punpcklbw (v8qi, v8qi)
7782v4hi __builtin_ia32_punpcklwd (v4hi, v4hi)
7783v2si __builtin_ia32_punpckldq (v2si, v2si)
7784v8qi __builtin_ia32_packsswb (v4hi, v4hi)
7785v4hi __builtin_ia32_packssdw (v2si, v2si)
7786v8qi __builtin_ia32_packuswb (v4hi, v4hi)
7787@end example
1255c85c 7788
7cbe9bb7
RH
7789The following built-in functions are made available either with
7790@option{-msse}, or with a combination of @option{-m3dnow} and
7791@option{-march=athlon}. All of them generate the machine
7792instruction that is part of the name.
7793
7794@example
7795v4hi __builtin_ia32_pmulhuw (v4hi, v4hi)
7796v8qi __builtin_ia32_pavgb (v8qi, v8qi)
7797v4hi __builtin_ia32_pavgw (v4hi, v4hi)
7798v4hi __builtin_ia32_psadbw (v8qi, v8qi)
7799v8qi __builtin_ia32_pmaxub (v8qi, v8qi)
7800v4hi __builtin_ia32_pmaxsw (v4hi, v4hi)
7801v8qi __builtin_ia32_pminub (v8qi, v8qi)
7802v4hi __builtin_ia32_pminsw (v4hi, v4hi)
7803int __builtin_ia32_pextrw (v4hi, int)
7804v4hi __builtin_ia32_pinsrw (v4hi, int, int)
7805int __builtin_ia32_pmovmskb (v8qi)
7806void __builtin_ia32_maskmovq (v8qi, v8qi, char *)
7807void __builtin_ia32_movntq (di *, di)
7808void __builtin_ia32_sfence (void)
7809@end example
1255c85c 7810
7cbe9bb7
RH
7811The following built-in functions are available when @option{-msse} is used.
7812All of them generate the machine instruction that is part of the name.
1255c85c 7813
7cbe9bb7
RH
7814@example
7815int __builtin_ia32_comieq (v4sf, v4sf)
7816int __builtin_ia32_comineq (v4sf, v4sf)
7817int __builtin_ia32_comilt (v4sf, v4sf)
7818int __builtin_ia32_comile (v4sf, v4sf)
7819int __builtin_ia32_comigt (v4sf, v4sf)
7820int __builtin_ia32_comige (v4sf, v4sf)
7821int __builtin_ia32_ucomieq (v4sf, v4sf)
7822int __builtin_ia32_ucomineq (v4sf, v4sf)
7823int __builtin_ia32_ucomilt (v4sf, v4sf)
7824int __builtin_ia32_ucomile (v4sf, v4sf)
7825int __builtin_ia32_ucomigt (v4sf, v4sf)
7826int __builtin_ia32_ucomige (v4sf, v4sf)
7827v4sf __builtin_ia32_addps (v4sf, v4sf)
7828v4sf __builtin_ia32_subps (v4sf, v4sf)
7829v4sf __builtin_ia32_mulps (v4sf, v4sf)
7830v4sf __builtin_ia32_divps (v4sf, v4sf)
7831v4sf __builtin_ia32_addss (v4sf, v4sf)
7832v4sf __builtin_ia32_subss (v4sf, v4sf)
7833v4sf __builtin_ia32_mulss (v4sf, v4sf)
7834v4sf __builtin_ia32_divss (v4sf, v4sf)
7835v4si __builtin_ia32_cmpeqps (v4sf, v4sf)
7836v4si __builtin_ia32_cmpltps (v4sf, v4sf)
7837v4si __builtin_ia32_cmpleps (v4sf, v4sf)
7838v4si __builtin_ia32_cmpgtps (v4sf, v4sf)
7839v4si __builtin_ia32_cmpgeps (v4sf, v4sf)
7840v4si __builtin_ia32_cmpunordps (v4sf, v4sf)
7841v4si __builtin_ia32_cmpneqps (v4sf, v4sf)
7842v4si __builtin_ia32_cmpnltps (v4sf, v4sf)
7843v4si __builtin_ia32_cmpnleps (v4sf, v4sf)
7844v4si __builtin_ia32_cmpngtps (v4sf, v4sf)
7845v4si __builtin_ia32_cmpngeps (v4sf, v4sf)
7846v4si __builtin_ia32_cmpordps (v4sf, v4sf)
7847v4si __builtin_ia32_cmpeqss (v4sf, v4sf)
7848v4si __builtin_ia32_cmpltss (v4sf, v4sf)
7849v4si __builtin_ia32_cmpless (v4sf, v4sf)
7850v4si __builtin_ia32_cmpgtss (v4sf, v4sf)
7851v4si __builtin_ia32_cmpgess (v4sf, v4sf)
7852v4si __builtin_ia32_cmpunordss (v4sf, v4sf)
7853v4si __builtin_ia32_cmpneqss (v4sf, v4sf)
7854v4si __builtin_ia32_cmpnlts (v4sf, v4sf)
7855v4si __builtin_ia32_cmpnless (v4sf, v4sf)
7856v4si __builtin_ia32_cmpngtss (v4sf, v4sf)
7857v4si __builtin_ia32_cmpngess (v4sf, v4sf)
7858v4si __builtin_ia32_cmpordss (v4sf, v4sf)
7859v4sf __builtin_ia32_maxps (v4sf, v4sf)
7860v4sf __builtin_ia32_maxss (v4sf, v4sf)
7861v4sf __builtin_ia32_minps (v4sf, v4sf)
7862v4sf __builtin_ia32_minss (v4sf, v4sf)
7863v4sf __builtin_ia32_andps (v4sf, v4sf)
7864v4sf __builtin_ia32_andnps (v4sf, v4sf)
7865v4sf __builtin_ia32_orps (v4sf, v4sf)
7866v4sf __builtin_ia32_xorps (v4sf, v4sf)
7867v4sf __builtin_ia32_movss (v4sf, v4sf)
7868v4sf __builtin_ia32_movhlps (v4sf, v4sf)
7869v4sf __builtin_ia32_movlhps (v4sf, v4sf)
7870v4sf __builtin_ia32_unpckhps (v4sf, v4sf)
7871v4sf __builtin_ia32_unpcklps (v4sf, v4sf)
7872v4sf __builtin_ia32_cvtpi2ps (v4sf, v2si)
7873v4sf __builtin_ia32_cvtsi2ss (v4sf, int)
7874v2si __builtin_ia32_cvtps2pi (v4sf)
7875int __builtin_ia32_cvtss2si (v4sf)
7876v2si __builtin_ia32_cvttps2pi (v4sf)
7877int __builtin_ia32_cvttss2si (v4sf)
7878v4sf __builtin_ia32_rcpps (v4sf)
7879v4sf __builtin_ia32_rsqrtps (v4sf)
7880v4sf __builtin_ia32_sqrtps (v4sf)
7881v4sf __builtin_ia32_rcpss (v4sf)
7882v4sf __builtin_ia32_rsqrtss (v4sf)
7883v4sf __builtin_ia32_sqrtss (v4sf)
7884v4sf __builtin_ia32_shufps (v4sf, v4sf, int)
7885void __builtin_ia32_movntps (float *, v4sf)
7886int __builtin_ia32_movmskps (v4sf)
7887@end example
1255c85c 7888
80ebf43e 7889The following built-in functions are available when @option{-msse} is used.
1255c85c
BS
7890
7891@table @code
acb0aa65 7892@item v4sf __builtin_ia32_loadaps (float *)
1255c85c 7893Generates the @code{movaps} machine instruction as a load from memory.
acb0aa65 7894@item void __builtin_ia32_storeaps (float *, v4sf)
1255c85c 7895Generates the @code{movaps} machine instruction as a store to memory.
acb0aa65 7896@item v4sf __builtin_ia32_loadups (float *)
1255c85c 7897Generates the @code{movups} machine instruction as a load from memory.
acb0aa65 7898@item void __builtin_ia32_storeups (float *, v4sf)
1255c85c 7899Generates the @code{movups} machine instruction as a store to memory.
acb0aa65 7900@item v4sf __builtin_ia32_loadsss (float *)
1255c85c 7901Generates the @code{movss} machine instruction as a load from memory.
acb0aa65 7902@item void __builtin_ia32_storess (float *, v4sf)
1255c85c 7903Generates the @code{movss} machine instruction as a store to memory.
acb0aa65 7904@item v4sf __builtin_ia32_loadhps (v4sf, v2si *)
1255c85c 7905Generates the @code{movhps} machine instruction as a load from memory.
acb0aa65 7906@item v4sf __builtin_ia32_loadlps (v4sf, v2si *)
1255c85c 7907Generates the @code{movlps} machine instruction as a load from memory
acb0aa65 7908@item void __builtin_ia32_storehps (v4sf, v2si *)
1255c85c 7909Generates the @code{movhps} machine instruction as a store to memory.
acb0aa65 7910@item void __builtin_ia32_storelps (v4sf, v2si *)
1255c85c 7911Generates the @code{movlps} machine instruction as a store to memory.
7cbe9bb7 7912@end table
1255c85c 7913
7cbe9bb7
RH
7914The following built-in functions are available when @option{-m3dnow} is used.
7915All of them generate the machine instruction that is part of the name.
1255c85c 7916
7cbe9bb7
RH
7917@example
7918void __builtin_ia32_femms (void)
7919v8qi __builtin_ia32_pavgusb (v8qi, v8qi)
7920v2si __builtin_ia32_pf2id (v2sf)
7921v2sf __builtin_ia32_pfacc (v2sf, v2sf)
7922v2sf __builtin_ia32_pfadd (v2sf, v2sf)
7923v2si __builtin_ia32_pfcmpeq (v2sf, v2sf)
7924v2si __builtin_ia32_pfcmpge (v2sf, v2sf)
7925v2si __builtin_ia32_pfcmpgt (v2sf, v2sf)
7926v2sf __builtin_ia32_pfmax (v2sf, v2sf)
7927v2sf __builtin_ia32_pfmin (v2sf, v2sf)
7928v2sf __builtin_ia32_pfmul (v2sf, v2sf)
7929v2sf __builtin_ia32_pfrcp (v2sf)
7930v2sf __builtin_ia32_pfrcpit1 (v2sf, v2sf)
7931v2sf __builtin_ia32_pfrcpit2 (v2sf, v2sf)
7932v2sf __builtin_ia32_pfrsqrt (v2sf)
7933v2sf __builtin_ia32_pfrsqrtit1 (v2sf, v2sf)
7934v2sf __builtin_ia32_pfsub (v2sf, v2sf)
7935v2sf __builtin_ia32_pfsubr (v2sf, v2sf)
7936v2sf __builtin_ia32_pi2fd (v2si)
7937v4hi __builtin_ia32_pmulhrw (v4hi, v4hi)
7938@end example
7939
7940The following built-in functions are available when both @option{-m3dnow}
7941and @option{-march=athlon} are used. All of them generate the machine
7942instruction that is part of the name.
7943
7944@example
7945v2si __builtin_ia32_pf2iw (v2sf)
7946v2sf __builtin_ia32_pfnacc (v2sf, v2sf)
7947v2sf __builtin_ia32_pfpnacc (v2sf, v2sf)
7948v2sf __builtin_ia32_pi2fw (v2si)
7949v2sf __builtin_ia32_pswapdsf (v2sf)
7950v2si __builtin_ia32_pswapdsi (v2si)
7951@end example
1255c85c 7952
f73ad30e 7953@item -mpush-args
a7939b1d 7954@itemx -mno-push-args
cd3bb277 7955@opindex mpush-args
a7939b1d 7956@opindex mno-push-args
767094dd 7957Use PUSH operations to store outgoing parameters. This method is shorter
f73ad30e 7958and usually equally fast as method using SUB/MOV operations and is enabled
767094dd 7959by default. In some cases disabling it may improve performance because of
f73ad30e
JH
7960improved scheduling and reduced dependencies.
7961
7962@item -maccumulate-outgoing-args
cd3bb277 7963@opindex maccumulate-outgoing-args
f73ad30e 7964If enabled, the maximum amount of space required for outgoing arguments will be
a7939b1d 7965computed in the function prologue. This is faster on most modern CPUs
b192711e 7966because of reduced dependencies, improved scheduling and reduced stack usage
f73ad30e 7967when preferred stack boundary is not equal to 2. The drawback is a notable
767094dd 7968increase in code size. This switch implies @option{-mno-push-args}.
f73ad30e 7969
f22a97d2 7970@item -mthreads
cd3bb277 7971@opindex mthreads
767094dd 7972Support thread-safe exception handling on @samp{Mingw32}. Code that relies
02f52e19 7973on thread-safe exception handling must compile and link all code with the
767094dd 7974@option{-mthreads} option. When compiling, @option{-mthreads} defines
630d3d5a
JM
7975@option{-D_MT}; when linking, it links in a special thread helper library
7976@option{-lmingwthrd} which cleans up per thread exception handling data.
79f05c19
JH
7977
7978@item -mno-align-stringops
cd3bb277 7979@opindex mno-align-stringops
767094dd 7980Do not align destination of inlined string operations. This switch reduces
79f05c19
JH
7981code size and improves performance in case the destination is already aligned,
7982but gcc don't know about it.
7983
7984@item -minline-all-stringops
cd3bb277 7985@opindex minline-all-stringops
79f05c19 7986By default GCC inlines string operations only when destination is known to be
767094dd 7987aligned at least to 4 byte boundary. This enables more inlining, increase code
79f05c19
JH
7988size, but may improve performance of code that depends on fast memcpy, strlen
7989and memset for short lengths.
762e166b
AJ
7990
7991@item -momit-leaf-frame-pointer
cd3bb277 7992@opindex momit-leaf-frame-pointer
762e166b
AJ
7993Don't keep the frame pointer in a register for leaf functions. This
7994avoids the instructions to save, set up and restore frame pointers and
7995makes an extra register available in leaf functions. The option
630d3d5a 7996@option{-fomit-frame-pointer} removes the frame pointer for all functions
762e166b 7997which might make debugging harder.
3af4bd89
JH
7998@end table
7999
14f73b5a
JH
8000These @samp{-m} switches are supported in addition to the above
8001on AMD x86-64 processors in 64-bit environments.
8002
8003@table @gcctabopt
8004@item -m32
8005@itemx -m64
8006@opindex m32
8007@opindex m64
8008Generate code for a 32-bit or 64-bit environment.
8009The 32-bit environment sets int, long and pointer to 32 bits and
8010generates code that runs on any i386 system.
8011The 64-bit environment sets int to 32 bits and long and pointer
8012to 64 bits and generates code for AMD's x86-64 architecture.
8013
8014@item -mno-red-zone
8015@opindex no-red-zone
8016Do not use a so called red zone for x86-64 code. The red zone is mandated
8017by the x86-64 ABI, it is a 128-byte area beyond the location of the
8018stack pointer that will not be modified by signal or interrupt handlers
8019and therefore can be used for temporary data without adjusting the stack
8020pointer. The flag @option{-mno-red-zone} disables this red zone.
8021@end table
8022
74291a4b
MM
8023@node HPPA Options
8024@subsection HPPA Options
8025@cindex HPPA Options
8026
8027These @samp{-m} options are defined for the HPPA family of computers:
8028
2642624b 8029@table @gcctabopt
630d3d5a 8030@item -march=@var{architecture-type}
cd3bb277 8031@opindex march
ea3bfbfe 8032Generate code for the specified architecture. The choices for
630d3d5a 8033@var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
ea3bfbfe
JQ
80341.1, and @samp{2.0} for PA 2.0 processors. Refer to
8035@file{/usr/lib/sched.models} on an HP-UX system to determine the proper
8036architecture option for your machine. Code compiled for lower numbered
8037architectures will run on higher numbered architectures, but not the
8038other way around.
8039
8040PA 2.0 support currently requires gas snapshot 19990413 or later. The
8041next release of binutils (current is 2.9.1) will probably contain PA 2.0
02f52e19 8042support.
74291a4b 8043
ea3bfbfe 8044@item -mpa-risc-1-0
62a1403d
AS
8045@itemx -mpa-risc-1-1
8046@itemx -mpa-risc-2-0
cd3bb277
JM
8047@opindex mpa-risc-1-0
8048@opindex mpa-risc-1-1
8049@opindex mpa-risc-2-0
695ac33f 8050Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
74291a4b 8051
861bb6c1 8052@item -mbig-switch
cd3bb277 8053@opindex mbig-switch
861bb6c1
JL
8054Generate code suitable for big switch tables. Use this option only if
8055the assembler/linker complain about out of range branches within a switch
8056table.
8057
74291a4b 8058@item -mjump-in-delay
cd3bb277 8059@opindex mjump-in-delay
74291a4b
MM
8060Fill delay slots of function calls with unconditional jump instructions
8061by modifying the return pointer for the function call to be the target
8062of the conditional jump.
8063
8064@item -mdisable-fpregs
cd3bb277 8065@opindex mdisable-fpregs
74291a4b
MM
8066Prevent floating point registers from being used in any manner. This is
8067necessary for compiling kernels which perform lazy context switching of
8068floating point registers. If you use this option and attempt to perform
8069floating point operations, the compiler will abort.
8070
8071@item -mdisable-indexing
cd3bb277 8072@opindex mdisable-indexing
74291a4b 8073Prevent the compiler from using indexing address modes. This avoids some
161d7b59 8074rather obscure problems when compiling MIG generated code under MACH@.
74291a4b
MM
8075
8076@item -mno-space-regs
cd3bb277 8077@opindex mno-space-regs
74291a4b
MM
8078Generate code that assumes the target has no space registers. This allows
8079GCC to generate faster indirect calls and use unscaled index address modes.
8080
8081Such code is suitable for level 0 PA systems and kernels.
8082
8083@item -mfast-indirect-calls
cd3bb277 8084@opindex mfast-indirect-calls
74291a4b
MM
8085Generate code that assumes calls never cross space boundaries. This
8086allows GCC to emit code which performs faster indirect calls.
8087
b192711e 8088This option will not work in the presence of shared libraries or nested
74291a4b
MM
8089functions.
8090
74291a4b 8091@item -mlong-load-store
cd3bb277 8092@opindex mlong-load-store
74291a4b
MM
8093Generate 3-instruction load and store sequences as sometimes required by
8094the HP-UX 10 linker. This is equivalent to the @samp{+k} option to
8095the HP compilers.
8096
8097@item -mportable-runtime
cd3bb277 8098@opindex mportable-runtime
74291a4b
MM
8099Use the portable calling conventions proposed by HP for ELF systems.
8100
8101@item -mgas
cd3bb277 8102@opindex mgas
74291a4b
MM
8103Enable the use of assembler directives only GAS understands.
8104
630d3d5a 8105@item -mschedule=@var{cpu-type}
cd3bb277 8106@opindex mschedule
74291a4b 8107Schedule code according to the constraints for the machine type
630d3d5a 8108@var{cpu-type}. The choices for @var{cpu-type} are @samp{700}
02f52e19 8109@samp{7100}, @samp{7100LC}, @samp{7200}, and @samp{8000}. Refer to
732135bf
JL
8110@file{/usr/lib/sched.models} on an HP-UX system to determine the
8111proper scheduling option for your machine.
74291a4b
MM
8112
8113@item -mlinker-opt
cd3bb277 8114@opindex mlinker-opt
74291a4b
MM
8115Enable the optimization pass in the HPUX linker. Note this makes symbolic
8116debugging impossible. It also triggers a bug in the HPUX 8 and HPUX 9 linkers
8117in which they give bogus error messages when linking some programs.
8118
8119@item -msoft-float
cd3bb277 8120@opindex msoft-float
74291a4b
MM
8121Generate output containing library calls for floating point.
8122@strong{Warning:} the requisite libraries are not available for all HPPA
8123targets. Normally the facilities of the machine's usual C compiler are
8124used, but this cannot be done directly in cross-compilation. You must make
8125your own arrangements to provide suitable library functions for
8126cross-compilation. The embedded target @samp{hppa1.1-*-pro}
8127does provide software floating point support.
8128
630d3d5a 8129@option{-msoft-float} changes the calling convention in the output file;
74291a4b
MM
8130therefore, it is only useful if you compile @emph{all} of a program with
8131this option. In particular, you need to compile @file{libgcc.a}, the
630d3d5a 8132library that comes with GCC, with @option{-msoft-float} in order for
74291a4b
MM
8133this to work.
8134@end table
8135
8136@node Intel 960 Options
8137@subsection Intel 960 Options
8138
8139These @samp{-m} options are defined for the Intel 960 implementations:
8140
2642624b 8141@table @gcctabopt
cd3bb277
JM
8142@item -m@var{cpu-type}
8143@opindex mka
8144@opindex mkb
8145@opindex mmc
8146@opindex mca
8147@opindex mcf
8148@opindex msa
8149@opindex msb
8150Assume the defaults for the machine type @var{cpu-type} for some of
74291a4b 8151the other options, including instruction scheduling, floating point
cd3bb277 8152support, and addressing modes. The choices for @var{cpu-type} are
74291a4b
MM
8153@samp{ka}, @samp{kb}, @samp{mc}, @samp{ca}, @samp{cf},
8154@samp{sa}, and @samp{sb}.
8155The default is
8156@samp{kb}.
8157
8158@item -mnumerics
8159@itemx -msoft-float
cd3bb277
JM
8160@opindex mnumerics
8161@opindex msoft-float
630d3d5a
JM
8162The @option{-mnumerics} option indicates that the processor does support
8163floating-point instructions. The @option{-msoft-float} option indicates
74291a4b
MM
8164that floating-point support should not be assumed.
8165
8166@item -mleaf-procedures
8167@itemx -mno-leaf-procedures
cd3bb277
JM
8168@opindex mleaf-procedures
8169@opindex mno-leaf-procedures
74291a4b
MM
8170Do (or do not) attempt to alter leaf procedures to be callable with the
8171@code{bal} instruction as well as @code{call}. This will result in more
8172efficient code for explicit calls when the @code{bal} instruction can be
8173substituted by the assembler or linker, but less efficient code in other
8174cases, such as calls via function pointers, or using a linker that doesn't
8175support this optimization.
8176
8177@item -mtail-call
8178@itemx -mno-tail-call
cd3bb277
JM
8179@opindex mtail-call
8180@opindex mno-tail-call
74291a4b
MM
8181Do (or do not) make additional attempts (beyond those of the
8182machine-independent portions of the compiler) to optimize tail-recursive
8183calls into branches. You may not want to do this because the detection of
8184cases where this is not valid is not totally complete. The default is
630d3d5a 8185@option{-mno-tail-call}.
74291a4b
MM
8186
8187@item -mcomplex-addr
8188@itemx -mno-complex-addr
cd3bb277
JM
8189@opindex mcomplex-addr
8190@opindex mno-complex-addr
74291a4b
MM
8191Assume (or do not assume) that the use of a complex addressing mode is a
8192win on this implementation of the i960. Complex addressing modes may not
8193be worthwhile on the K-series, but they definitely are on the C-series.
630d3d5a 8194The default is currently @option{-mcomplex-addr} for all processors except
161d7b59 8195the CB and CC@.
74291a4b
MM
8196
8197@item -mcode-align
8198@itemx -mno-code-align
cd3bb277
JM
8199@opindex mcode-align
8200@opindex mno-code-align
74291a4b
MM
8201Align code to 8-byte boundaries for faster fetching (or don't bother).
8202Currently turned on by default for C-series implementations only.
8203
8204@ignore
8205@item -mclean-linkage
8206@itemx -mno-clean-linkage
cd3bb277
JM
8207@opindex mclean-linkage
8208@opindex mno-clean-linkage
74291a4b
MM
8209These options are not fully implemented.
8210@end ignore
8211
8212@item -mic-compat
8213@itemx -mic2.0-compat
8214@itemx -mic3.0-compat
cd3bb277
JM
8215@opindex mic-compat
8216@opindex mic2.0-compat
8217@opindex mic3.0-compat
74291a4b
MM
8218Enable compatibility with iC960 v2.0 or v3.0.
8219
8220@item -masm-compat
8221@itemx -mintel-asm
cd3bb277
JM
8222@opindex masm-compat
8223@opindex mintel-asm
74291a4b
MM
8224Enable compatibility with the iC960 assembler.
8225
8226@item -mstrict-align
8227@itemx -mno-strict-align
cd3bb277
JM
8228@opindex mstrict-align
8229@opindex mno-strict-align
74291a4b
MM
8230Do not permit (do permit) unaligned accesses.
8231
8232@item -mold-align
cd3bb277 8233@opindex mold-align
74291a4b 8234Enable structure-alignment compatibility with Intel's gcc release version
630d3d5a 82351.3 (based on gcc 1.37). This option implies @option{-mstrict-align}.
eaa4b44c
VM
8236
8237@item -mlong-double-64
cd3bb277 8238@opindex mlong-double-64
eaa4b44c
VM
8239Implement type @samp{long double} as 64-bit floating point numbers.
8240Without the option @samp{long double} is implemented by 80-bit
8241floating point numbers. The only reason we have it because there is
8242no 128-bit @samp{long double} support in @samp{fp-bit.c} yet. So it
8243is only useful for people using soft-float targets. Otherwise, we
8244should recommend against use of it.
8245
74291a4b
MM
8246@end table
8247
8248@node DEC Alpha Options
8249@subsection DEC Alpha Options
8250
8251These @samp{-m} options are defined for the DEC Alpha implementations:
8252
2642624b 8253@table @gcctabopt
74291a4b
MM
8254@item -mno-soft-float
8255@itemx -msoft-float
cd3bb277
JM
8256@opindex mno-soft-float
8257@opindex msoft-float
74291a4b 8258Use (do not use) the hardware floating-point instructions for
bedc7537 8259floating-point operations. When @option{-msoft-float} is specified,
7857f134 8260functions in @file{libgcc.a} will be used to perform floating-point
74291a4b
MM
8261operations. Unless they are replaced by routines that emulate the
8262floating-point operations, or compiled in such a way as to call such
8263emulations routines, these routines will issue floating-point
8264operations. If you are compiling for an Alpha without floating-point
8265operations, you must ensure that the library is built so as not to call
8266them.
8267
8268Note that Alpha implementations without floating-point operations are
8269required to have floating-point registers.
8270
8271@item -mfp-reg
8272@itemx -mno-fp-regs
cd3bb277
JM
8273@opindex mfp-reg
8274@opindex mno-fp-regs
74291a4b 8275Generate code that uses (does not use) the floating-point register set.
bedc7537 8276@option{-mno-fp-regs} implies @option{-msoft-float}. If the floating-point
74291a4b
MM
8277register set is not used, floating point operands are passed in integer
8278registers as if they were integers and floating-point results are passed
58605ba0
RH
8279in @code{$0} instead of @code{$f0}. This is a non-standard calling sequence,
8280so any function with a floating-point argument or return value called by code
bedc7537 8281compiled with @option{-mno-fp-regs} must also be compiled with that
74291a4b
MM
8282option.
8283
8284A typical use of this option is building a kernel that does not use,
8285and hence need not save and restore, any floating-point registers.
8286
8287@item -mieee
cd3bb277 8288@opindex mieee
74291a4b
MM
8289The Alpha architecture implements floating-point hardware optimized for
8290maximum performance. It is mostly compliant with the IEEE floating
8291point standard. However, for full compliance, software assistance is
8292required. This option generates code fully IEEE compliant code
630d3d5a 8293@emph{except} that the @var{inexact-flag} is not maintained (see below).
9c34dbbf
ZW
8294If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
8295defined during compilation. The resulting code is less efficient but is
8296able to correctly support denormalized numbers and exceptional IEEE
8297values such as not-a-number and plus/minus infinity. Other Alpha
8298compilers call this option @option{-ieee_with_no_inexact}.
74291a4b
MM
8299
8300@item -mieee-with-inexact
cd3bb277 8301@opindex mieee-with-inexact
9c34dbbf
ZW
8302This is like @option{-mieee} except the generated code also maintains
8303the IEEE @var{inexact-flag}. Turning on this option causes the
8304generated code to implement fully-compliant IEEE math. In addition to
8305@code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
8306macro. On some Alpha implementations the resulting code may execute
8307significantly slower than the code generated by default. Since there is
8308very little code that depends on the @var{inexact-flag}, you should
74291a4b 8309normally not specify this option. Other Alpha compilers call this
630d3d5a 8310option @option{-ieee_with_inexact}.
74291a4b 8311
630d3d5a 8312@item -mfp-trap-mode=@var{trap-mode}
cd3bb277 8313@opindex mfp-trap-mode
74291a4b 8314This option controls what floating-point related traps are enabled.
630d3d5a 8315Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
74291a4b
MM
8316The trap mode can be set to one of four values:
8317
8318@table @samp
8319@item n
8320This is the default (normal) setting. The only traps that are enabled
8321are the ones that cannot be disabled in software (e.g., division by zero
8322trap).
8323
8324@item u
8325In addition to the traps enabled by @samp{n}, underflow traps are enabled
8326as well.
8327
8328@item su
8329Like @samp{su}, but the instructions are marked to be safe for software
8330completion (see Alpha architecture manual for details).
8331
8332@item sui
8333Like @samp{su}, but inexact traps are enabled as well.
8334@end table
8335
630d3d5a 8336@item -mfp-rounding-mode=@var{rounding-mode}
cd3bb277 8337@opindex mfp-rounding-mode
74291a4b 8338Selects the IEEE rounding mode. Other Alpha compilers call this option
630d3d5a 8339@option{-fprm @var{rounding-mode}}. The @var{rounding-mode} can be one
74291a4b
MM
8340of:
8341
8342@table @samp
8343@item n
8344Normal IEEE rounding mode. Floating point numbers are rounded towards
8345the nearest machine number or towards the even machine number in case
8346of a tie.
8347
8348@item m
8349Round towards minus infinity.
8350
8351@item c
8352Chopped rounding mode. Floating point numbers are rounded towards zero.
8353
8354@item d
8355Dynamic rounding mode. A field in the floating point control register
8356(@var{fpcr}, see Alpha architecture reference manual) controls the
8357rounding mode in effect. The C library initializes this register for
8358rounding towards plus infinity. Thus, unless your program modifies the
ec4b2ecb
CB
8359@var{fpcr}, @samp{d} corresponds to round towards plus infinity.
8360@end table
74291a4b 8361
630d3d5a 8362@item -mtrap-precision=@var{trap-precision}
cd3bb277 8363@opindex mtrap-precision
74291a4b
MM
8364In the Alpha architecture, floating point traps are imprecise. This
8365means without software assistance it is impossible to recover from a
8366floating trap and program execution normally needs to be terminated.
0c2d1a2a 8367GCC can generate code that can assist operating system trap handlers
74291a4b
MM
8368in determining the exact location that caused a floating point trap.
8369Depending on the requirements of an application, different levels of
8370precisions can be selected:
8371
8372@table @samp
8373@item p
8374Program precision. This option is the default and means a trap handler
8375can only identify which program caused a floating point exception.
8376
8377@item f
8378Function precision. The trap handler can determine the function that
8379caused a floating point exception.
8380
8381@item i
8382Instruction precision. The trap handler can determine the exact
8383instruction that caused a floating point exception.
8384@end table
8385
8386Other Alpha compilers provide the equivalent options called
630d3d5a 8387@option{-scope_safe} and @option{-resumption_safe}.
74291a4b
MM
8388
8389@item -mieee-conformant
cd3bb277 8390@opindex mieee-conformant
74291a4b 8391This option marks the generated code as IEEE conformant. You must not
630d3d5a
JM
8392use this option unless you also specify @option{-mtrap-precision=i} and either
8393@option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}. Its only effect
74291a4b
MM
8394is to emit the line @samp{.eflag 48} in the function prologue of the
8395generated assembly file. Under DEC Unix, this has the effect that
8396IEEE-conformant math library routines will be linked in.
8397
8398@item -mbuild-constants
cd3bb277 8399@opindex mbuild-constants
0c2d1a2a 8400Normally GCC examines a 32- or 64-bit integer constant to
74291a4b
MM
8401see if it can construct it from smaller constants in two or three
8402instructions. If it cannot, it will output the constant as a literal and
956d6950 8403generate code to load it from the data segment at runtime.
74291a4b 8404
0c2d1a2a 8405Use this option to require GCC to construct @emph{all} integer constants
74291a4b
MM
8406using code, even if it takes more instructions (the maximum is six).
8407
8408You would typically use this option to build a shared library dynamic
8409loader. Itself a shared library, it must relocate itself in memory
8410before it can find the variables and constants in its own data segment.
956d6950
JL
8411
8412@item -malpha-as
8413@itemx -mgas
cd3bb277
JM
8414@opindex malpha-as
8415@opindex mgas
956d6950 8416Select whether to generate code to be assembled by the vendor-supplied
630d3d5a 8417assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
956d6950
JL
8418
8419@item -mbwx
8420@itemx -mno-bwx
8421@itemx -mcix
8422@itemx -mno-cix
58605ba0
RH
8423@itemx -mfix
8424@itemx -mno-fix
956d6950
JL
8425@itemx -mmax
8426@itemx -mno-max
cd3bb277
JM
8427@opindex mbwx
8428@opindex mno-bwx
8429@opindex mcix
8430@opindex mno-cix
58605ba0
RH
8431@opindex mfix
8432@opindex mno-fix
cd3bb277
JM
8433@opindex mmax
8434@opindex mno-max
0c2d1a2a 8435Indicate whether GCC should generate code to use the optional BWX,
58605ba0
RH
8436CIX, FIX and MAX instruction sets. The default is to use the instruction
8437sets supported by the CPU type specified via @option{-mcpu=} option or that
0c2d1a2a 8438of the CPU on which GCC was built if none was specified.
956d6950 8439
58605ba0
RH
8440@item -mfloat-vax
8441@itemx -mfloat-ieee
8442@opindex mfloat-vax
8443@opindex mfloat-ieee
8444Generate code that uses (does not use) VAX F and G floating point
8445arithmetic instead of IEEE single and double precision.
8446
8447@item -mexplicit-relocs
8448@itemx -mno-explicit-relocs
8449@opindex mexplicit-relocs
8450@opindex mno-explicit-relocs
8451Older Alpha assemblers provided no way to generate symbol relocations
8452except via assembler macros. Use of these macros does not allow
8453optimial instruction scheduling. GNU binutils as of version 2.12
8454supports a new syntax that allows the compiler to explicitly mark
8455which relocations should apply to which instructions. This option
8456is mostly useful for debugging, as GCC detects the capabilities of
8457the assembler when it is built and sets the default accordingly.
8458
8459@item -msmall-data
8460@itemx -mlarge-data
8461@opindex msmall-data
8462@opindex mlarge-data
8463When @option{-mexplicit-relocs} is in effect, static data is
8464accessed via @dfn{gp-relative} relocations. When @option{-msmall-data}
8465is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
8466(the @code{.sdata} and @code{.sbss} sections) and are accessed via
846716-bit relocations off of the @code{$gp} register. This limits the
8468size of the small data area to 64KB, but allows the variables to be
8469directly accessed via a single instruction.
8470
8471The default is @option{-mlarge-data}. With this option the data area
8472is limited to just below 2GB. Programs that require more than 2GB of
8473data must use @code{malloc} or @code{mmap} to allocate the data in the
8474heap instead of in the program's data segment.
8475
8476When generating code for shared libraries, @option{-fpic} implies
8477@option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
8478
956d6950 8479@item -mcpu=@var{cpu_type}
cd3bb277 8480@opindex mcpu
58605ba0
RH
8481Set the instruction set and instruction scheduling parameters for
8482machine type @var{cpu_type}. You can specify either the @samp{EV}
8483style name or the corresponding chip number. GCC supports scheduling
8484parameters for the EV4, EV5 and EV6 family of processors and will
8485choose the default values for the instruction set from the processor
8486you specify. If you do not specify a processor type, GCC will default
8487to the processor on which the compiler was built.
956d6950
JL
8488
8489Supported values for @var{cpu_type} are
8490
8491@table @samp
8492@item ev4
58605ba0 8493@item ev45
956d6950
JL
8494@itemx 21064
8495Schedules as an EV4 and has no instruction set extensions.
8496
8497@item ev5
8498@itemx 21164
8499Schedules as an EV5 and has no instruction set extensions.
8500
8501@item ev56
8502@itemx 21164a
8503Schedules as an EV5 and supports the BWX extension.
8504
8505@item pca56
4f69985c 8506@itemx 21164pc
956d6950
JL
8507@itemx 21164PC
8508Schedules as an EV5 and supports the BWX and MAX extensions.
8509
8510@item ev6
8511@itemx 21264
58605ba0
RH
8512Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
8513
8514@item ev67
8515@item 21264a
8516Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
4f69985c
RH
8517@end table
8518
58605ba0
RH
8519@item -mtune=@var{cpu_type}
8520@opindex mtune
8521Set only the instruction scheduling parameters for machine type
8522@var{cpu_type}. The instruction set is not changed.
8523
4f69985c 8524@item -mmemory-latency=@var{time}
cd3bb277 8525@opindex mmemory-latency
4f69985c
RH
8526Sets the latency the scheduler should assume for typical memory
8527references as seen by the application. This number is highly
b192711e 8528dependent on the memory access patterns used by the application
4f69985c
RH
8529and the size of the external cache on the machine.
8530
8531Valid options for @var{time} are
8532
8533@table @samp
8534@item @var{number}
8535A decimal number representing clock cycles.
8536
8537@item L1
8538@itemx L2
8539@itemx L3
8540@itemx main
8541The compiler contains estimates of the number of clock cycles for
8542``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
8543(also called Dcache, Scache, and Bcache), as well as to main memory.
8544Note that L3 is only valid for EV5.
8545
956d6950 8546@end table
74291a4b
MM
8547@end table
8548
d7c23cdc
DR
8549@node DEC Alpha/VMS Options
8550@subsection DEC Alpha/VMS Options
8551
8552These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
8553
8554@table @gcctabopt
8555@item -mvms-return-codes
8556@opindex mvms-return-codes
bf6cfc5e
RK
8557Return VMS condition codes from main. The default is to return POSIX
8558style condition (e.g.@ error) codes.
d7c23cdc
DR
8559@end table
8560
74291a4b
MM
8561@node Clipper Options
8562@subsection Clipper Options
8563
8564These @samp{-m} options are defined for the Clipper implementations:
8565
2642624b 8566@table @gcctabopt
74291a4b 8567@item -mc300
cd3bb277 8568@opindex mc300
767094dd 8569Produce code for a C300 Clipper processor. This is the default.
74291a4b 8570
62a1403d 8571@item -mc400
cd3bb277 8572@opindex mc400
9c34dbbf
ZW
8573Produce code for a C400 Clipper processor, i.e.@: use floating point
8574registers f8--f15.
74291a4b
MM
8575@end table
8576
8577@node H8/300 Options
8578@subsection H8/300 Options
8579
8580These @samp{-m} options are defined for the H8/300 implementations:
8581
2642624b 8582@table @gcctabopt
74291a4b 8583@item -mrelax
cd3bb277 8584@opindex mrelax
74291a4b 8585Shorten some address references at link time, when possible; uses the
630d3d5a 8586linker option @option{-relax}. @xref{H8/300,, @code{ld} and the H8/300,
74291a4b
MM
8587ld.info, Using ld}, for a fuller description.
8588
8589@item -mh
cd3bb277 8590@opindex mh
161d7b59 8591Generate code for the H8/300H@.
74291a4b 8592
dcb9d1f0 8593@item -ms
cd3bb277 8594@opindex ms
161d7b59 8595Generate code for the H8/S@.
dcb9d1f0 8596
17f0f8fa 8597@item -ms2600
cd3bb277 8598@opindex ms2600
695ac33f 8599Generate code for the H8/S2600. This switch must be used with @option{-ms}.
17f0f8fa 8600
74291a4b 8601@item -mint32
cd3bb277 8602@opindex mint32
74291a4b
MM
8603Make @code{int} data 32 bits by default.
8604
8605@item -malign-300
cd3bb277 8606@opindex malign-300
2c54abce
KH
8607On the H8/300H and H8/S, use the same alignment rules as for the H8/300.
8608The default for the H8/300H and H8/S is to align longs and floats on 4
8609byte boundaries.
630d3d5a 8610@option{-malign-300} causes them to be aligned on 2 byte boundaries.
2c54abce 8611This option has no effect on the H8/300.
74291a4b
MM
8612@end table
8613
8614@node SH Options
8615@subsection SH Options
8616
8617These @samp{-m} options are defined for the SH implementations:
8618
2642624b 8619@table @gcctabopt
74291a4b 8620@item -m1
cd3bb277 8621@opindex m1
74291a4b
MM
8622Generate code for the SH1.
8623
8624@item -m2
cd3bb277 8625@opindex m2
74291a4b
MM
8626Generate code for the SH2.
8627
8628@item -m3
cd3bb277 8629@opindex m3
74291a4b
MM
8630Generate code for the SH3.
8631
8632@item -m3e
cd3bb277 8633@opindex m3e
74291a4b
MM
8634Generate code for the SH3e.
8635
3cadd778 8636@item -m4-nofpu
cd3bb277 8637@opindex m4-nofpu
3cadd778
AO
8638Generate code for the SH4 without a floating-point unit.
8639
8640@item -m4-single-only
cd3bb277 8641@opindex m4-single-only
3cadd778 8642Generate code for the SH4 with a floating-point unit that only
c771326b 8643supports single-precision arithmetic.
3cadd778
AO
8644
8645@item -m4-single
cd3bb277 8646@opindex m4-single
3cadd778
AO
8647Generate code for the SH4 assuming the floating-point unit is in
8648single-precision mode by default.
8649
8650@item -m4
cd3bb277 8651@opindex m4
3cadd778
AO
8652Generate code for the SH4.
8653
74291a4b 8654@item -mb
cd3bb277 8655@opindex mb
74291a4b
MM
8656Compile code for the processor in big endian mode.
8657
8658@item -ml
cd3bb277 8659@opindex ml
74291a4b
MM
8660Compile code for the processor in little endian mode.
8661
3d5a0820 8662@item -mdalign
cd3bb277 8663@opindex mdalign
02f52e19 8664Align doubles at 64-bit boundaries. Note that this changes the calling
3d5a0820 8665conventions, and thus some functions from the standard C library will
695ac33f 8666not work unless you recompile it first with @option{-mdalign}.
3d5a0820 8667
74291a4b 8668@item -mrelax
cd3bb277 8669@opindex mrelax
74291a4b 8670Shorten some address references at link time, when possible; uses the
630d3d5a 8671linker option @option{-relax}.
3cadd778
AO
8672
8673@item -mbigtable
cd3bb277 8674@opindex mbigtable
3cadd778
AO
8675Use 32-bit offsets in @code{switch} tables. The default is to use
867616-bit offsets.
8677
8678@item -mfmovd
cd3bb277 8679@opindex mfmovd
3cadd778
AO
8680Enable the use of the instruction @code{fmovd}.
8681
8682@item -mhitachi
cd3bb277 8683@opindex mhitachi
3cadd778
AO
8684Comply with the calling conventions defined by Hitachi.
8685
8686@item -mnomacsave
cd3bb277 8687@opindex mnomacsave
3cadd778 8688Mark the @code{MAC} register as call-clobbered, even if
bedc7537 8689@option{-mhitachi} is given.
3cadd778 8690
c474f76b
AO
8691@item -mieee
8692@opindex mieee
8693Increase IEEE-compliance of floating-point code.
8694
3cadd778 8695@item -misize
cd3bb277 8696@opindex misize
3cadd778
AO
8697Dump instruction size and location in the assembly code.
8698
8699@item -mpadstruct
cd3bb277 8700@opindex mpadstruct
3cadd778 8701This option is deprecated. It pads structures to multiple of 4 bytes,
161d7b59 8702which is incompatible with the SH ABI@.
3cadd778
AO
8703
8704@item -mspace
cd3bb277 8705@opindex mspace
bedc7537 8706Optimize for space instead of speed. Implied by @option{-Os}.
1a66cd67
AO
8707
8708@item -mprefergot
cd3bb277 8709@opindex mprefergot
1a66cd67
AO
8710When generating position-independent code, emit function calls using
8711the Global Offset Table instead of the Procedure Linkage Table.
93ca1662
NY
8712
8713@item -musermode
cd3bb277 8714@opindex musermode
93ca1662
NY
8715Generate a library function call to invalidate instruction cache
8716entries, after fixing up a trampoline. This library function call
8717doesn't assume it can write to the whole memory address space. This
8718is the default when the target is @code{sh-*-linux*}.
74291a4b
MM
8719@end table
8720
8721@node System V Options
8722@subsection Options for System V
8723
8724These additional options are available on System V Release 4 for
8725compatibility with other compilers on those systems:
8726
2642624b 8727@table @gcctabopt
74291a4b 8728@item -G
cd3bb277 8729@opindex G
74291a4b 8730Create a shared object.
630d3d5a 8731It is recommended that @option{-symbolic} or @option{-shared} be used instead.
74291a4b
MM
8732
8733@item -Qy
cd3bb277 8734@opindex Qy
74291a4b
MM
8735Identify the versions of each tool used by the compiler, in a
8736@code{.ident} assembler directive in the output.
8737
8738@item -Qn
cd3bb277 8739@opindex Qn
74291a4b
MM
8740Refrain from adding @code{.ident} directives to the output file (this is
8741the default).
8742
aee96fe9 8743@item -YP,@var{dirs}
cd3bb277 8744@opindex YP
74291a4b 8745Search the directories @var{dirs}, and no others, for libraries
630d3d5a 8746specified with @option{-l}.
74291a4b 8747
aee96fe9 8748@item -Ym,@var{dir}
cd3bb277 8749@opindex Ym
bedc7537 8750Look in the directory @var{dir} to find the M4 preprocessor.
74291a4b
MM
8751The assembler uses this option.
8752@c This is supposed to go with a -Yd for predefined M4 macro files, but
8753@c the generic assembler that comes with Solaris takes just -Ym.
8754@end table
8755
282a61e6
MH
8756@node TMS320C3x/C4x Options
8757@subsection TMS320C3x/C4x Options
8758@cindex TMS320C3x/C4x Options
8759
8760These @samp{-m} options are defined for TMS320C3x/C4x implementations:
8761
2642624b 8762@table @gcctabopt
282a61e6
MH
8763
8764@item -mcpu=@var{cpu_type}
cd3bb277 8765@opindex mcpu
282a61e6
MH
8766Set the instruction set, register set, and instruction scheduling
8767parameters for machine type @var{cpu_type}. Supported values for
8768@var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
8769@samp{c44}. The default is @samp{c40} to generate code for the
8770TMS320C40.
8771
8772@item -mbig-memory
8773@item -mbig
8774@itemx -msmall-memory
8775@itemx -msmall
cd3bb277
JM
8776@opindex mbig-memory
8777@opindex mbig
8778@opindex msmall-memory
8779@opindex msmall
282a61e6
MH
8780Generates code for the big or small memory model. The small memory
8781model assumed that all data fits into one 64K word page. At run-time
8782the data page (DP) register must be set to point to the 64K page
8783containing the .bss and .data program sections. The big memory model is
8784the default and requires reloading of the DP register for every direct
8785memory access.
8786
8787@item -mbk
8788@itemx -mno-bk
cd3bb277
JM
8789@opindex mbk
8790@opindex mno-bk
282a61e6 8791Allow (disallow) allocation of general integer operands into the block
161d7b59 8792count register BK@.
282a61e6
MH
8793
8794@item -mdb
8795@itemx -mno-db
cd3bb277
JM
8796@opindex mdb
8797@opindex mno-db
282a61e6
MH
8798Enable (disable) generation of code using decrement and branch,
8799DBcond(D), instructions. This is enabled by default for the C4x. To be
8800on the safe side, this is disabled for the C3x, since the maximum
aee96fe9
JM
8801iteration count on the C3x is @math{2^23 + 1} (but who iterates loops more than
8802@math{2^23} times on the C3x?). Note that GCC will try to reverse a loop so
282a61e6
MH
8803that it can utilise the decrement and branch instruction, but will give
8804up if there is more than one memory reference in the loop. Thus a loop
8805where the loop counter is decremented can generate slightly more
8806efficient code, in cases where the RPTB instruction cannot be utilised.
8807
8808@item -mdp-isr-reload
8809@itemx -mparanoid
cd3bb277
JM
8810@opindex mdp-isr-reload
8811@opindex mparanoid
282a61e6
MH
8812Force the DP register to be saved on entry to an interrupt service
8813routine (ISR), reloaded to point to the data section, and restored on
161d7b59 8814exit from the ISR@. This should not be required unless someone has
282a61e6
MH
8815violated the small memory model by modifying the DP register, say within
8816an object library.
8817
8818@item -mmpyi
8819@itemx -mno-mpyi
cd3bb277
JM
8820@opindex mmpyi
8821@opindex mno-mpyi
282a61e6
MH
8822For the C3x use the 24-bit MPYI instruction for integer multiplies
8823instead of a library call to guarantee 32-bit results. Note that if one
8824of the operands is a constant, then the multiplication will be performed
695ac33f 8825using shifts and adds. If the @option{-mmpyi} option is not specified for the C3x,
282a61e6
MH
8826then squaring operations are performed inline instead of a library call.
8827
8828@item -mfast-fix
8829@itemx -mno-fast-fix
cd3bb277
JM
8830@opindex mfast-fix
8831@opindex mno-fast-fix
282a61e6
MH
8832The C3x/C4x FIX instruction to convert a floating point value to an
8833integer value chooses the nearest integer less than or equal to the
8834floating point value rather than to the nearest integer. Thus if the
8835floating point number is negative, the result will be incorrectly
8836truncated an additional code is necessary to detect and correct this
8837case. This option can be used to disable generation of the additional
8838code required to correct the result.
8839
8840@item -mrptb
8841@itemx -mno-rptb
cd3bb277
JM
8842@opindex mrptb
8843@opindex mno-rptb
282a61e6
MH
8844Enable (disable) generation of repeat block sequences using the RPTB
8845instruction for zero overhead looping. The RPTB construct is only used
8846for innermost loops that do not call functions or jump across the loop
8847boundaries. There is no advantage having nested RPTB loops due to the
8848overhead required to save and restore the RC, RS, and RE registers.
695ac33f 8849This is enabled by default with @option{-O2}.
282a61e6
MH
8850
8851@item -mrpts=@var{count}
8852@itemx -mno-rpts
cd3bb277
JM
8853@opindex mrpts
8854@opindex mno-rpts
282a61e6 8855Enable (disable) the use of the single instruction repeat instruction
161d7b59 8856RPTS@. If a repeat block contains a single instruction, and the loop
282a61e6 8857count can be guaranteed to be less than the value @var{count}, GCC will
161d7b59 8858emit a RPTS instruction instead of a RPTB@. If no value is specified,
282a61e6
MH
8859then a RPTS will be emitted even if the loop count cannot be determined
8860at compile time. Note that the repeated instruction following RPTS does
8861not have to be reloaded from memory each iteration, thus freeing up the
b192711e 8862CPU buses for operands. However, since interrupts are blocked by this
282a61e6
MH
8863instruction, it is disabled by default.
8864
8865@item -mloop-unsigned
8866@itemx -mno-loop-unsigned
cd3bb277
JM
8867@opindex mloop-unsigned
8868@opindex mno-loop-unsigned
282a61e6 8869The maximum iteration count when using RPTS and RPTB (and DB on the C40)
aee96fe9 8870is @math{2^31 + 1} since these instructions test if the iteration count is
282a61e6 8871negative to terminate the loop. If the iteration count is unsigned
aee96fe9 8872there is a possibility than the @math{2^31 + 1} maximum iteration count may be
282a61e6
MH
8873exceeded. This switch allows an unsigned iteration count.
8874
8875@item -mti
cd3bb277 8876@opindex mti
282a61e6
MH
8877Try to emit an assembler syntax that the TI assembler (asm30) is happy
8878with. This also enforces compatibility with the API employed by the TI
8879C3x C compiler. For example, long doubles are passed as structures
8880rather than in floating point registers.
8881
8882@item -mregparm
8883@itemx -mmemparm
cd3bb277
JM
8884@opindex mregparm
8885@opindex mmemparm
282a61e6
MH
8886Generate code that uses registers (stack) for passing arguments to functions.
8887By default, arguments are passed in registers where possible rather
8888than by pushing arguments on to the stack.
8889
8890@item -mparallel-insns
8891@itemx -mno-parallel-insns
cd3bb277
JM
8892@opindex mparallel-insns
8893@opindex mno-parallel-insns
282a61e6 8894Allow the generation of parallel instructions. This is enabled by
695ac33f 8895default with @option{-O2}.
282a61e6
MH
8896
8897@item -mparallel-mpy
8898@itemx -mno-parallel-mpy
cd3bb277
JM
8899@opindex mparallel-mpy
8900@opindex mno-parallel-mpy
282a61e6 8901Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
695ac33f 8902provided @option{-mparallel-insns} is also specified. These instructions have
282a61e6
MH
8903tight register constraints which can pessimize the code generation
8904of large functions.
8905
8906@end table
8907
f84271d9
JL
8908@node V850 Options
8909@subsection V850 Options
8910@cindex V850 Options
8911
8912These @samp{-m} options are defined for V850 implementations:
8913
2642624b 8914@table @gcctabopt
f84271d9
JL
8915@item -mlong-calls
8916@itemx -mno-long-calls
cd3bb277
JM
8917@opindex mlong-calls
8918@opindex mno-long-calls
f84271d9
JL
8919Treat all calls as being far away (near). If calls are assumed to be
8920far away, the compiler will always load the functions address up into a
8921register, and call indirect through the pointer.
8922
8923@item -mno-ep
bd762873 8924@itemx -mep
cd3bb277
JM
8925@opindex mno-ep
8926@opindex mep
f84271d9
JL
8927Do not optimize (do optimize) basic blocks that use the same index
8928pointer 4 or more times to copy pointer into the @code{ep} register, and
630d3d5a 8929use the shorter @code{sld} and @code{sst} instructions. The @option{-mep}
f84271d9
JL
8930option is on by default if you optimize.
8931
8932@item -mno-prolog-function
8933@itemx -mprolog-function
cd3bb277
JM
8934@opindex mno-prolog-function
8935@opindex mprolog-function
f84271d9
JL
8936Do not use (do use) external functions to save and restore registers at
8937the prolog and epilog of a function. The external functions are slower,
8938but use less code space if more than one function saves the same number
630d3d5a 8939of registers. The @option{-mprolog-function} option is on by default if
f84271d9
JL
8940you optimize.
8941
8942@item -mspace
cd3bb277 8943@opindex mspace
f84271d9 8944Try to make the code as small as possible. At present, this just turns
630d3d5a 8945on the @option{-mep} and @option{-mprolog-function} options.
f84271d9
JL
8946
8947@item -mtda=@var{n}
cd3bb277 8948@opindex mtda
f84271d9
JL
8949Put static or global variables whose size is @var{n} bytes or less into
8950the tiny data area that register @code{ep} points to. The tiny data
8951area can hold up to 256 bytes in total (128 bytes for byte references).
8952
8953@item -msda=@var{n}
cd3bb277 8954@opindex msda
f84271d9
JL
8955Put static or global variables whose size is @var{n} bytes or less into
8956the small data area that register @code{gp} points to. The small data
8957area can hold up to 64 kilobytes.
8958
8959@item -mzda=@var{n}
cd3bb277 8960@opindex mzda
f84271d9
JL
8961Put static or global variables whose size is @var{n} bytes or less into
8962the first 32 kilobytes of memory.
02f52e19 8963
48f0be1b 8964@item -mv850
cd3bb277 8965@opindex mv850
48f0be1b
SC
8966Specify that the target processor is the V850.
8967
e9a25f70 8968@item -mbig-switch
cd3bb277 8969@opindex mbig-switch
e9a25f70
JL
8970Generate code suitable for big switch tables. Use this option only if
8971the assembler/linker complain about out of range branches within a switch
8972table.
f84271d9
JL
8973@end table
8974
56b2d7a7
JL
8975@node ARC Options
8976@subsection ARC Options
8977@cindex ARC Options
8978
8979These options are defined for ARC implementations:
8980
2642624b 8981@table @gcctabopt
56b2d7a7 8982@item -EL
cd3bb277 8983@opindex EL
56b2d7a7
JL
8984Compile code for little endian mode. This is the default.
8985
8986@item -EB
cd3bb277 8987@opindex EB
56b2d7a7
JL
8988Compile code for big endian mode.
8989
8990@item -mmangle-cpu
cd3bb277 8991@opindex mmangle-cpu
56b2d7a7
JL
8992Prepend the name of the cpu to all public symbol names.
8993In multiple-processor systems, there are many ARC variants with different
8994instruction and register set characteristics. This flag prevents code
8995compiled for one cpu to be linked with code compiled for another.
695ac33f 8996No facility exists for handling variants that are ``almost identical''.
56b2d7a7
JL
8997This is an all or nothing option.
8998
8999@item -mcpu=@var{cpu}
cd3bb277 9000@opindex mcpu
56b2d7a7
JL
9001Compile code for ARC variant @var{cpu}.
9002Which variants are supported depend on the configuration.
630d3d5a 9003All variants support @option{-mcpu=base}, this is the default.
56b2d7a7 9004
630d3d5a
JM
9005@item -mtext=@var{text-section}
9006@itemx -mdata=@var{data-section}
9007@itemx -mrodata=@var{readonly-data-section}
cd3bb277
JM
9008@opindex mtext
9009@opindex mdata
9010@opindex mrodata
630d3d5a
JM
9011Put functions, data, and readonly data in @var{text-section},
9012@var{data-section}, and @var{readonly-data-section} respectively
56b2d7a7 9013by default. This can be overridden with the @code{section} attribute.
0b433de6 9014@xref{Variable Attributes}.
56b2d7a7
JL
9015
9016@end table
9017
83575957
ID
9018@node NS32K Options
9019@subsection NS32K Options
9020@cindex NS32K options
9021
9022These are the @samp{-m} options defined for the 32000 series. The default
9023values for these options depends on which style of 32000 was selected when
9024the compiler was configured; the defaults for the most common choices are
9025given below.
9026
2642624b 9027@table @gcctabopt
83575957
ID
9028@item -m32032
9029@itemx -m32032
cd3bb277
JM
9030@opindex m32032
9031@opindex m32032
83575957
ID
9032Generate output for a 32032. This is the default
9033when the compiler is configured for 32032 and 32016 based systems.
9034
9035@item -m32332
9036@itemx -m32332
cd3bb277
JM
9037@opindex m32332
9038@opindex m32332
83575957
ID
9039Generate output for a 32332. This is the default
9040when the compiler is configured for 32332-based systems.
9041
9042@item -m32532
9043@itemx -m32532
cd3bb277
JM
9044@opindex m32532
9045@opindex m32532
83575957
ID
9046Generate output for a 32532. This is the default
9047when the compiler is configured for 32532-based systems.
9048
9049@item -m32081
cd3bb277 9050@opindex m32081
83575957
ID
9051Generate output containing 32081 instructions for floating point.
9052This is the default for all systems.
9053
9054@item -m32381
cd3bb277 9055@opindex m32381
83575957 9056Generate output containing 32381 instructions for floating point. This
767094dd
JM
9057also implies @option{-m32081}. The 32381 is only compatible with the 32332
9058and 32532 cpus. This is the default for the pc532-netbsd configuration.
83575957
ID
9059
9060@item -mmulti-add
cd3bb277 9061@opindex mmulti-add
83575957 9062Try and generate multiply-add floating point instructions @code{polyF}
767094dd 9063and @code{dotF}. This option is only available if the @option{-m32381}
14976c58 9064option is in effect. Using these instructions requires changes to
83575957
ID
9065register allocation which generally has a negative impact on
9066performance. This option should only be enabled when compiling code
9067particularly likely to make heavy use of multiply-add instructions.
9068
9069@item -mnomulti-add
cd3bb277 9070@opindex mnomulti-add
83575957 9071Do not try and generate multiply-add floating point instructions
767094dd 9072@code{polyF} and @code{dotF}. This is the default on all platforms.
83575957
ID
9073
9074@item -msoft-float
cd3bb277 9075@opindex msoft-float
83575957
ID
9076Generate output containing library calls for floating point.
9077@strong{Warning:} the requisite libraries may not be available.
9078
9079@item -mnobitfield
cd3bb277 9080@opindex mnobitfield
767094dd
JM
9081Do not use the bit-field instructions. On some machines it is faster to
9082use shifting and masking operations. This is the default for the pc532.
83575957
ID
9083
9084@item -mbitfield
cd3bb277 9085@opindex mbitfield
767094dd 9086Do use the bit-field instructions. This is the default for all platforms
83575957
ID
9087except the pc532.
9088
9089@item -mrtd
cd3bb277 9090@opindex mrtd
83575957
ID
9091Use a different function-calling convention, in which functions
9092that take a fixed number of arguments return pop their
9093arguments on return with the @code{ret} instruction.
9094
9095This calling convention is incompatible with the one normally
9096used on Unix, so you cannot use it if you need to call libraries
9097compiled with the Unix compiler.
9098
9099Also, you must provide function prototypes for all functions that
9100take variable numbers of arguments (including @code{printf});
9101otherwise incorrect code will be generated for calls to those
9102functions.
9103
9104In addition, seriously incorrect code will result if you call a
9105function with too many arguments. (Normally, extra arguments are
9106harmlessly ignored.)
9107
9108This option takes its name from the 680x0 @code{rtd} instruction.
9109
9110
9111@item -mregparam
cd3bb277 9112@opindex mregparam
83575957
ID
9113Use a different function-calling convention where the first two arguments
9114are passed in registers.
9115
9116This calling convention is incompatible with the one normally
9117used on Unix, so you cannot use it if you need to call libraries
9118compiled with the Unix compiler.
9119
9120@item -mnoregparam
cd3bb277 9121@opindex mnoregparam
767094dd 9122Do not pass any arguments in registers. This is the default for all
83575957
ID
9123targets.
9124
9125@item -msb
cd3bb277 9126@opindex msb
83575957 9127It is OK to use the sb as an index register which is always loaded with
767094dd 9128zero. This is the default for the pc532-netbsd target.
83575957
ID
9129
9130@item -mnosb
cd3bb277 9131@opindex mnosb
83575957 9132The sb register is not available for use or has not been initialized to
767094dd
JM
9133zero by the run time system. This is the default for all targets except
9134the pc532-netbsd. It is also implied whenever @option{-mhimem} or
630d3d5a 9135@option{-fpic} is set.
83575957
ID
9136
9137@item -mhimem
cd3bb277 9138@opindex mhimem
161d7b59 9139Many ns32000 series addressing modes use displacements of up to 512MB@.
83575957 9140If an address is above 512MB then displacements from zero can not be used.
161d7b59 9141This option causes code to be generated which can be loaded above 512MB@.
83575957
ID
9142This may be useful for operating systems or ROM code.
9143
9144@item -mnohimem
cd3bb277 9145@opindex mnohimem
83575957
ID
9146Assume code will be loaded in the first 512MB of virtual address space.
9147This is the default for all platforms.
9148
9149
9150@end table
9151
052a4b28
DC
9152@node AVR Options
9153@subsection AVR Options
9154@cindex AVR Options
9155
9156These options are defined for AVR implementations:
9157
2642624b 9158@table @gcctabopt
052a4b28 9159@item -mmcu=@var{mcu}
cd3bb277 9160@opindex mmcu
3a69a7d5
MM
9161Specify ATMEL AVR instruction set or MCU type.
9162
9163Instruction set avr1 is for the minimal AVR core, not supported by the C
9164compiler, only for assembler programs (MCU types: at90s1200, attiny10,
9165attiny11, attiny12, attiny15, attiny28).
9166
9167Instruction set avr2 (default) is for the classic AVR core with up to
91688K program memory space (MCU types: at90s2313, at90s2323, attiny22,
9169at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
9170at90c8534, at90s8535).
9171
9172Instruction set avr3 is for the classic AVR core with up to 128K program
c7f3e0b0 9173memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
3a69a7d5
MM
9174
9175Instruction set avr4 is for the enhanced AVR core with up to 8K program
c7f3e0b0 9176memory space (MCU types: atmega8, atmega83, atmega85).
3a69a7d5
MM
9177
9178Instruction set avr5 is for the enhanced AVR core with up to 128K program
c7f3e0b0
MM
9179memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
9180atmega64, atmega128, at43usb355, at94k).
052a4b28
DC
9181
9182@item -msize
cd3bb277 9183@opindex msize
3a69a7d5 9184Output instruction sizes to the asm file.
052a4b28
DC
9185
9186@item -minit-stack=@var{N}
cd3bb277 9187@opindex minit-stack
3a69a7d5 9188Specify the initial stack address, which may be a symbol or numeric value,
aee96fe9 9189@samp{__stack} is the default.
052a4b28
DC
9190
9191@item -mno-interrupts
cd3bb277 9192@opindex mno-interrupts
052a4b28
DC
9193Generated code is not compatible with hardware interrupts.
9194Code size will be smaller.
9195
9196@item -mcall-prologues
cd3bb277 9197@opindex mcall-prologues
052a4b28 9198Functions prologues/epilogues expanded as call to appropriate
767094dd 9199subroutines. Code size will be smaller.
3a69a7d5
MM
9200
9201@item -mno-tablejump
cd3bb277 9202@opindex mno-tablejump
3a69a7d5
MM
9203Do not generate tablejump insns which sometimes increase code size.
9204
9205@item -mtiny-stack
cd3bb277 9206@opindex mtiny-stack
3a69a7d5 9207Change only the low 8 bits of the stack pointer.
052a4b28
DC
9208@end table
9209
789a3090
NC
9210@node MCore Options
9211@subsection MCore Options
9212@cindex MCore options
9213
9214These are the @samp{-m} options defined for the Motorola M*Core
02f52e19 9215processors.
789a3090 9216
2642624b 9217@table @gcctabopt
789a3090
NC
9218
9219@item -mhardlit
9220@itemx -mhardlit
9221@itemx -mno-hardlit
cd3bb277
JM
9222@opindex mhardlit
9223@opindex mhardlit
9224@opindex mno-hardlit
789a3090
NC
9225Inline constants into the code stream if it can be done in two
9226instructions or less.
9227
9228@item -mdiv
9229@itemx -mdiv
9230@itemx -mno-div
cd3bb277
JM
9231@opindex mdiv
9232@opindex mdiv
9233@opindex mno-div
789a3090
NC
9234Use the divide instruction. (Enabled by default).
9235
9236@item -mrelax-immediate
9237@itemx -mrelax-immediate
9238@itemx -mno-relax-immediate
cd3bb277
JM
9239@opindex mrelax-immediate
9240@opindex mrelax-immediate
9241@opindex mno-relax-immediate
b192711e 9242Allow arbitrary sized immediates in bit operations.
789a3090
NC
9243
9244@item -mwide-bitfields
9245@itemx -mwide-bitfields
9246@itemx -mno-wide-bitfields
cd3bb277
JM
9247@opindex mwide-bitfields
9248@opindex mwide-bitfields
9249@opindex mno-wide-bitfields
c771326b 9250Always treat bit-fields as int-sized.
789a3090
NC
9251
9252@item -m4byte-functions
9253@itemx -m4byte-functions
9254@itemx -mno-4byte-functions
cd3bb277
JM
9255@opindex m4byte-functions
9256@opindex m4byte-functions
9257@opindex mno-4byte-functions
b192711e 9258Force all functions to be aligned to a four byte boundary.
789a3090
NC
9259
9260@item -mcallgraph-data
9261@itemx -mcallgraph-data
9262@itemx -mno-callgraph-data
cd3bb277
JM
9263@opindex mcallgraph-data
9264@opindex mcallgraph-data
9265@opindex mno-callgraph-data
789a3090
NC
9266Emit callgraph information.
9267
9268@item -mslow-bytes
9269@itemx -mslow-bytes
9270@itemx -mno-slow-bytes
cd3bb277
JM
9271@opindex mslow-bytes
9272@opindex mslow-bytes
9273@opindex mno-slow-bytes
789a3090
NC
9274Prefer word access when reading byte quantities.
9275
9276@item -mlittle-endian
9277@itemx -mlittle-endian
9278@itemx -mbig-endian
cd3bb277
JM
9279@opindex mlittle-endian
9280@opindex mlittle-endian
9281@opindex mbig-endian
b192711e 9282Generate code for a little endian target.
789a3090
NC
9283
9284@item -m210
9285@itemx -m210
9286@itemx -m340
cd3bb277
JM
9287@opindex m210
9288@opindex m210
9289@opindex m340
789a3090 9290Generate code for the 210 processor.
789a3090 9291@end table
83575957 9292
df6194d4
JW
9293@node IA-64 Options
9294@subsection IA-64 Options
9295@cindex IA-64 Options
9296
9297These are the @samp{-m} options defined for the Intel IA-64 architecture.
9298
9299@table @gcctabopt
9300@item -mbig-endian
cd3bb277 9301@opindex mbig-endian
161d7b59 9302Generate code for a big endian target. This is the default for HPUX@.
df6194d4
JW
9303
9304@item -mlittle-endian
cd3bb277 9305@opindex mlittle-endian
df6194d4
JW
9306Generate code for a little endian target. This is the default for AIX5
9307and Linux.
9308
9309@item -mgnu-as
9310@itemx -mno-gnu-as
cd3bb277
JM
9311@opindex mgnu-as
9312@opindex mno-gnu-as
15d3a111 9313Generate (or don't) code for the GNU assembler. This is the default.
630d3d5a 9314@c Also, this is the default if the configure option @option{--with-gnu-as}
15d3a111 9315@c is used.
df6194d4
JW
9316
9317@item -mgnu-ld
9318@itemx -mno-gnu-ld
cd3bb277
JM
9319@opindex mgnu-ld
9320@opindex mno-gnu-ld
15d3a111 9321Generate (or don't) code for the GNU linker. This is the default.
630d3d5a 9322@c Also, this is the default if the configure option @option{--with-gnu-ld}
15d3a111 9323@c is used.
df6194d4
JW
9324
9325@item -mno-pic
cd3bb277 9326@opindex mno-pic
15d3a111 9327Generate code that does not use a global pointer register. The result
161d7b59 9328is not position independent code, and violates the IA-64 ABI@.
df6194d4
JW
9329
9330@item -mvolatile-asm-stop
9331@itemx -mno-volatile-asm-stop
cd3bb277
JM
9332@opindex mvolatile-asm-stop
9333@opindex mno-volatile-asm-stop
15d3a111
JW
9334Generate (or don't) a stop bit immediately before and after volatile asm
9335statements.
df6194d4
JW
9336
9337@item -mb-step
cd3bb277 9338@opindex mb-step
df6194d4
JW
9339Generate code that works around Itanium B step errata.
9340
9341@item -mregister-names
9342@itemx -mno-register-names
cd3bb277
JM
9343@opindex mregister-names
9344@opindex mno-register-names
15d3a111
JW
9345Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
9346the stacked registers. This may make assembler output more readable.
df6194d4
JW
9347
9348@item -mno-sdata
9349@itemx -msdata
cd3bb277
JM
9350@opindex mno-sdata
9351@opindex msdata
15d3a111
JW
9352Disable (or enable) optimizations that use the small data section. This may
9353be useful for working around optimizer bugs.
df6194d4
JW
9354
9355@item -mconstant-gp
cd3bb277 9356@opindex mconstant-gp
df6194d4
JW
9357Generate code that uses a single constant global pointer value. This is
9358useful when compiling kernel code.
9359
9360@item -mauto-pic
cd3bb277 9361@opindex mauto-pic
630d3d5a 9362Generate code that is self-relocatable. This implies @option{-mconstant-gp}.
df6194d4
JW
9363This is useful when compiling firmware code.
9364
9365@item -minline-divide-min-latency
cd3bb277 9366@opindex minline-divide-min-latency
df6194d4
JW
9367Generate code for inline divides using the minimum latency algorithm.
9368
9369@item -minline-divide-max-throughput
cd3bb277 9370@opindex minline-divide-max-throughput
df6194d4
JW
9371Generate code for inline divides using the maximum throughput algorithm.
9372
9373@item -mno-dwarf2-asm
9374@itemx -mdwarf2-asm
cd3bb277
JM
9375@opindex mno-dwarf2-asm
9376@opindex mdwarf2-asm
15d3a111
JW
9377Don't (or do) generate assembler code for the DWARF2 line number debugging
9378info. This may be useful when not using the GNU assembler.
df6194d4 9379
630d3d5a 9380@item -mfixed-range=@var{register-range}
cd3bb277 9381@opindex mfixed-range
df6194d4
JW
9382Generate code treating the given register range as fixed registers.
9383A fixed register is one that the register allocator can not use. This is
9384useful when compiling kernel code. A register range is specified as
9385two registers separated by a dash. Multiple register ranges can be
9386specified separated by a comma.
9387@end table
9388
e8ad90e5
MM
9389@node D30V Options
9390@subsection D30V Options
9391@cindex D30V Options
9392
9393These @samp{-m} options are defined for D30V implementations:
9394
2642624b 9395@table @gcctabopt
e8ad90e5 9396@item -mextmem
cd3bb277 9397@opindex mextmem
e8ad90e5
MM
9398Link the @samp{.text}, @samp{.data}, @samp{.bss}, @samp{.strings},
9399@samp{.rodata}, @samp{.rodata1}, @samp{.data1} sections into external
9400memory, which starts at location @code{0x80000000}.
9401
9402@item -mextmemory
cd3bb277 9403@opindex mextmemory
630d3d5a 9404Same as the @option{-mextmem} switch.
e8ad90e5
MM
9405
9406@item -monchip
cd3bb277 9407@opindex monchip
e8ad90e5
MM
9408Link the @samp{.text} section into onchip text memory, which starts at
9409location @code{0x0}. Also link @samp{.data}, @samp{.bss},
9410@samp{.strings}, @samp{.rodata}, @samp{.rodata1}, @samp{.data1} sections
9411into onchip data memory, which starts at location @code{0x20000000}.
9412
9413@item -mno-asm-optimize
9414@itemx -masm-optimize
cd3bb277
JM
9415@opindex mno-asm-optimize
9416@opindex masm-optimize
630d3d5a
JM
9417Disable (enable) passing @option{-O} to the assembler when optimizing.
9418The assembler uses the @option{-O} option to automatically parallelize
e8ad90e5
MM
9419adjacent short instructions where possible.
9420
9421@item -mbranch-cost=@var{n}
cd3bb277 9422@opindex mbranch-cost
e8ad90e5
MM
9423Increase the internal costs of branches to @var{n}. Higher costs means
9424that the compiler will issue more instructions to avoid doing a branch.
9425The default is 2.
9426
9427@item -mcond-exec=@var{n}
cd3bb277 9428@opindex mcond-exec
e8ad90e5
MM
9429Specify the maximum number of conditionally executed instructions that
9430replace a branch. The default is 4.
9431@end table
56b2d7a7 9432
91abf72d
HP
9433@node S/390 and zSeries Options
9434@subsection S/390 and zSeries Options
9435@cindex S/390 and zSeries Options
9436
9437These are the @samp{-m} options defined for the S/390 and zSeries architecture.
9438
9439@table @gcctabopt
9440@item -mhard-float
9441@itemx -msoft-float
9442@opindex mhard-float
9443@opindex msoft-float
9444Use (do not use) the hardware floating-point instructions and registers
9445for floating-point operations. When @option{-msoft-float} is specified,
9446functions in @file{libgcc.a} will be used to perform floating-point
9447operations. When @option{-mhard-float} is specified, the compiler
9448generates IEEE floating-point instructions. This is the default.
9449
9450@item -mbackchain
9451@itemx -mno-backchain
9452@opindex mbackchain
9453@opindex mno-backchain
9454Generate (or do not generate) code which maintains an explicit
9455backchain within the stack frame that points to the caller's frame.
9456This is currently needed to allow debugging. The default is to
9457generate the backchain.
9458
9459@item -msmall-exec
9460@itemx -mno-small-exec
9461@opindex msmall-exec
9462@opindex mno-small-exec
9463Generate (or do not generate) code using the @code{bras} instruction
9464to do subroutine calls.
9465This only works reliably if the total executable size does not
9466exceed 64k. The default is to use the @code{basr} instruction instead,
9467which does not have this limitation.
9468
9469@item -m64
9470@itemx -m31
9471@opindex m64
9472@opindex m31
9473When @option{-m31} is specified, generate code compliant to the
9474Linux for S/390 ABI@. When @option{-m64} is specified, generate
9475code compliant to the Linux for zSeries ABI@. This allows GCC in
9476particular to generate 64-bit instructions. For the @samp{s390}
9477targets, the default is @option{-m31}, while the @samp{s390x}
9478targets default to @option{-m64}.
9479
9480@item -mmvcle
9481@itemx -mno-mvcle
9482@opindex mmvcle
9483@opindex mno-mvcle
9484Generate (or do not generate) code using the @code{mvcle} instruction
9485to perform block moves. When @option{-mno-mvcle} is specifed,
9486use a @code{mvc} loop instead. This is the default.
9487
9488@item -mdebug
9489@itemx -mno-debug
9490@opindex mdebug
9491@opindex mno-debug
9492Print (or do not print) additional debug information when compiling.
9493The default is to not print debug information.
9494
9495@end table
9496
0b85d816
HPN
9497@node CRIS Options
9498@subsection CRIS Options
9499@cindex CRIS Options
9500
9501These options are defined specifically for the CRIS ports.
9502
9503@table @gcctabopt
9504@item -march=@var{architecture-type}
9505@itemx -mcpu=@var{architecture-type}
9506@opindex march
9507@opindex mcpu
9508Generate code for the specified architecture. The choices for
9509@var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
9510respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX.
9511Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
9512@samp{v10}.
9513
9514@item -mtune=@var{architecture-type}
9515@opindex mtune
9516Tune to @var{architecture-type} everything applicable about the generated
9517code, except for the ABI and the set of available instructions. The
9518choices for @var{architecture-type} are the same as for
9519@option{-march=@var{architecture-type}}.
9520
9521@item -mmax-stack-frame=@var{n}
9522@opindex mmax-stack-frame
9523Warn when the stack frame of a function exceeds @var{n} bytes.
9524
9525@item -melinux-stacksize=@var{n}
9526@opindex melinux-stacksize
9527Only available with the @samp{cris-axis-aout} target. Arranges for
9528indications in the program to the kernel loader that the stack of the
9529program should be set to @var{n} bytes.
9530
9531@item -metrax4
9532@itemx -metrax100
9533@opindex metrax4
9534@opindex metrax100
9535The options @option{-metrax4} and @option{-metrax100} are synonyms for
9536@option{-march=v3} and @option{-march=v8} respectively.
9537
9538@item -mpdebug
9539@opindex mpdebug
9540Enable CRIS-specific verbose debug-related information in the assembly
9541code. This option also has the effect to turn off the @samp{#NO_APP}
9542formatted-code indicator to the assembler at the beginning of the
9543assembly file.
9544
9545@item -mcc-init
9546@opindex mcc-init
9547Do not use condition-code results from previous instruction; always emit
9548compare and test instructions before use of condition codes.
9549
9550@item -mno-side-effects
9551@opindex mno-side-effects
9552Do not emit instructions with side-effects in addressing modes other than
9553post-increment.
9554
9555@item -mstack-align
9556@itemx -mno-stack-align
9557@itemx -mdata-align
9558@itemx -mno-data-align
9559@itemx -mconst-align
9560@itemx -mno-const-align
9561@opindex mstack-align
9562@opindex mno-stack-align
9563@opindex mdata-align
9564@opindex mno-data-align
9565@opindex mconst-align
9566@opindex mno-const-align
9567These options (no-options) arranges (eliminate arrangements) for the
9568stack-frame, individual data and constants to be aligned for the maximum
9569single data access size for the chosen CPU model. The default is to
9570arrange for 32-bit alignment. ABI details such as structure layout are
9571not affected by these options.
9572
9573@item -m32-bit
9574@itemx -m16-bit
9575@itemx -m8-bit
9576@opindex m32-bit
9577@opindex m16-bit
9578@opindex m8-bit
9579Similar to the stack- data- and const-align options above, these options
9580arrange for stack-frame, writable data and constants to all be 32-bit,
958116-bit or 8-bit aligned. The default is 32-bit alignment.
9582
9583@item -mno-prologue-epilogue
9584@itemx -mprologue-epilogue
9585@opindex mno-prologue-epilogue
9586@opindex mprologue-epilogue
9587With @option{-mno-prologue-epilogue}, the normal function prologue and
9588epilogue that sets up the stack-frame are omitted and no return
9589instructions or return sequences are generated in the code. Use this
9590option only together with visual inspection of the compiled code: no
9591warnings or errors are generated when call-saved registers must be saved,
9592or storage for local variable needs to be allocated.
9593
9594@item -mno-gotplt
9595@itemx -mgotplt
9596@opindex mno-gotplt
9597@opindex mgotplt
9598With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
9599instruction sequences that load addresses for functions from the PLT part
9600of the GOT rather than (traditional on other architectures) calls to the
9601PLT. The default is @option{-mgotplt}.
9602
9603@item -maout
9604@opindex maout
9605Legacy no-op option only recognized with the cris-axis-aout target.
9606
9607@item -melf
9608@opindex melf
9609Legacy no-op option only recognized with the cris-axis-elf and
9610cris-axis-linux-gnu targets.
9611
9612@item -melinux
9613@opindex melinux
9614Only recognized with the cris-axis-aout target, where it selects a
9615GNU/linux-like multilib, include files and instruction set for
9616@option{-march=v8}.
9617
9618@item -mlinux
9619@opindex mlinux
9620Legacy no-op option only recognized with the cris-axis-linux-gnu target.
9621
9622@item -sim
9623@opindex sim
9624This option, recognized for the cris-axis-aout and cris-axis-elf arranges
9625to link with input-output functions from a simulator library. Code,
9626initialized data and zero-initialized data are allocated consecutively.
9627
9628@item -sim2
9629@opindex sim2
9630Like @option{-sim}, but pass linker options to locate initialized data at
96310x40000000 and zero-initialized data at 0x80000000.
9632@end table
9633
bcf684c7
HPN
9634@node MMIX Options
9635@subsection MMIX Options
9636@cindex MMIX Options
9637
9638These options are defined for the MMIX:
9639
5d22c1a5 9640@table @gcctabopt
bcf684c7
HPN
9641@item -mlibfuncs
9642@itemx -mno-libfuncs
5d22c1a5
JM
9643@opindex mlibfuncs
9644@opindex mno-libfuncs
bcf684c7
HPN
9645Specify that intrinsic library functions are being compiled, passing all
9646values in registers, no matter the size.
9647
9648@item -mepsilon
9649@itemx -mno-epsilon
5d22c1a5
JM
9650@opindex mepsilon
9651@opindex mno-epsilon
bcf684c7
HPN
9652Generate floating-point comparison instructions that compare with respect
9653to the @code{rE} epsilon register.
9654
9655@item -mabi=mmixware
9656@itemx -mabi=gnu
5d22c1a5
JM
9657@opindex mabi-mmixware
9658@opindex mabi=gnu
bcf684c7
HPN
9659Generate code that passes function parameters and return values that (in
9660the called function) are seen as registers @code{$0} and up, as opposed to
9661the GNU ABI which uses global registers @code{$231} and up.
9662
9663@item -mzero-extend
3e0f61ac 9664@itemx -mno-zero-extend
5d22c1a5
JM
9665@opindex mzero-extend
9666@opindex mno-zero-extend
bcf684c7
HPN
9667When reading data from memory in sizes shorter than 64 bits, use (do not
9668use) zero-extending load instructions by default, rather than
9669sign-extending ones.
9670
9671@item -mknuthdiv
9672@itemx -mno-knuthdiv
5d22c1a5
JM
9673@opindex mknuthdiv
9674@opindex mno-knuthdiv
bcf684c7
HPN
9675Make the result of a division yielding a remainder have the same sign as
9676the divisor. With the default, @option{-mno-knuthdiv}, the sign of the
7fba3293
HPN
9677remainder follows the sign of the dividend. Both methods are
9678arithmetically valid, the latter being almost exclusively used.
bcf684c7
HPN
9679
9680@item -mtoplevel-symbols
9681@itemx -mno-toplevel-symbols
5d22c1a5
JM
9682@opindex mtoplevel-symbols
9683@opindex mno-toplevel-symbols
7fba3293 9684Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
bcf684c7
HPN
9685code can be used with the @code{PREFIX} assembly directive.
9686
9687@item -melf
5d22c1a5 9688@opindex melf
7fba3293 9689Generate an executable in the ELF format, rather than the default
bcf684c7 9690@samp{mmo} format used by the @command{mmix} simulator.
3e0f61ac
HPN
9691
9692@item -mbranch-predict
9693@itemx -mno-branch-predict
5d22c1a5
JM
9694@opindex mbranch-predict
9695@opindex mno-branch-predict
3e0f61ac
HPN
9696Use (do not use) the probable-branch instructions, when static branch
9697prediction indicates a probable branch.
9698
9699@item -mreg-stack-fill-bug-workaround
9700@itemx -mno-reg-stack-fill-bug-workaround
5d22c1a5
JM
9701@opindex mreg-stack-fill-bug-workaround
9702@opindex mno-reg-stack-fill-bug-workaround
3e0f61ac
HPN
9703Work around (do not work around) an inconsistency in the circular
9704register stack mechanism in the @command{mmix} simulator, which
9705causes entries in the register stack to not be flushed to memory if
9706the instruction causing the fill-up is @code{PUSHJ} or @code{PUSHGO}.
bcf684c7
HPN
9707@end table
9708
9f85bca7
JM
9709@node PDP-11 Options
9710@subsection PDP-11 Options
9711@cindex PDP-11 Options
9712
9713These options are defined for the PDP-11:
9714
9715@table @gcctabopt
9716@item -mfpu
9717@opindex mfpu
9718Use hardware FPP floating point. This is the default. (FIS floating
9719point on the PDP-11/40 is not supported.)
9720
9721@item -msoft-float
9722@opindex msoft-float
9723Do not use hardware floating point.
9724
9725@item -mac0
9726@opindex mac0
9727Return floating-point results in ac0 (fr0 in Unix assembler syntax).
9728
9729@item -mno-ac0
9730@opindex mno-ac0
9731Return floating-point results in memory. This is the default.
9732
9733@item -m40
9734@opindex m40
9735Generate code for a PDP-11/40.
9736
9737@item -m45
9738@opindex m45
9739Generate code for a PDP-11/45. This is the default.
9740
9741@item -m10
9742@opindex m10
9743Generate code for a PDP-11/10.
9744
9745@item -mbcopy-builtin
9746@opindex bcopy-builtin
9747Use inline @code{movstrhi} patterns for copying memory. This is the
9748default.
9749
9750@item -mbcopy
9751@opindex mbcopy
9752Do not use inline @code{movstrhi} patterns for copying memory.
9753
9754@item -mint16
9755@itemx -mno-int32
9756@opindex mint16
9757@opindex mno-int32
9758Use 16-bit @code{int}. This is the default.
9759
9760@item -mint32
9761@itemx -mno-int16
9762@opindex mint32
9763@opindex mno-int16
9764Use 32-bit @code{int}.
9765
9766@item -mfloat64
9767@itemx -mno-float32
9768@opindex mfloat64
9769@opindex mno-float32
9770Use 64-bit @code{float}. This is the default.
9771
9772@item -mfloat32
9773@item -mno-float64
9774@opindex mfloat32
9775@opindex mno-float64
9776Use 32-bit @code{float}.
9777
9778@item -mabshi
9779@opindex mabshi
9780Use @code{abshi2} pattern. This is the default.
9781
9782@item -mno-abshi
9783@opindex mno-abshi
9784Do not use @code{abshi2} pattern.
9785
9786@item -mbranch-expensive
9787@opindex mbranch-expensive
9788Pretend that branches are expensive. This is for experimenting with
9789code generation only.
9790
9791@item -mbranch-cheap
9792@opindex mbranch-cheap
9793Do not pretend that branches are expensive. This is the default.
9794
9795@item -msplit
9796@opindex msplit
9797Generate code for a system with split I&D.
9798
9799@item -mno-split
9800@opindex mno-split
9801Generate code for a system without split I&D. This is the default.
9802
9803@item -munix-asm
9804@opindex munix-asm
9805Use Unix assembler syntax. This is the default when configured for
9806@samp{pdp11-*-bsd}.
9807
9808@item -mdec-asm
9809@opindex mdec-asm
9810Use DEC assembler syntax. This is the default when configured for any
9811PDP-11 target other than @samp{pdp11-*-bsd}.
9812@end table
9813
74291a4b
MM
9814@node Code Gen Options
9815@section Options for Code Generation Conventions
9816@cindex code generation conventions
9817@cindex options, code generation
9818@cindex run-time options
9819
9820These machine-independent options control the interface conventions
9821used in code generation.
9822
9823Most of them have both positive and negative forms; the negative form
630d3d5a 9824of @option{-ffoo} would be @option{-fno-foo}. In the table below, only
74291a4b
MM
9825one of the forms is listed---the one which is not the default. You
9826can figure out the other form by either removing @samp{no-} or adding
9827it.
9828
2642624b 9829@table @gcctabopt
956d6950 9830@item -fexceptions
cd3bb277 9831@opindex fexceptions
767094dd 9832Enable exception handling. Generates extra code needed to propagate
f0523f02 9833exceptions. For some targets, this implies GCC will generate frame
c5c76735
JL
9834unwind information for all functions, which can produce significant data
9835size overhead, although it does not affect execution. If you do not
f0523f02 9836specify this option, GCC will enable it by default for languages like
90ecce3e 9837C++ which normally require exception handling, and disable it for
c5c76735
JL
9838languages like C that do not normally require it. However, you may need
9839to enable this option when compiling C code that needs to interoperate
9840properly with exception handlers written in C++. You may also wish to
9841disable this option if you are compiling older C++ programs that don't
9842use exception handling.
956d6950 9843
6cfc0341
RH
9844@item -fnon-call-exceptions
9845@opindex fnon-call-exceptions
9846Generate code that allows trapping instructions to throw exceptions.
9847Note that this requires platform-specific runtime support that does
9848not exist everywhere. Moreover, it only allows @emph{trapping}
e979f9e8 9849instructions to throw exceptions, i.e.@: memory references or floating
6cfc0341
RH
9850point instructions. It does not allow exceptions to be thrown from
9851arbitrary signal handlers such as @code{SIGALRM}.
9852
14a774a9 9853@item -funwind-tables
cd3bb277 9854@opindex funwind-tables
bedc7537 9855Similar to @option{-fexceptions}, except that it will just generate any needed
14a774a9
RK
9856static data, but will not affect the generated code in any other way.
9857You will normally not enable this option; instead, a language processor
9858that needs this handling would enable it on your behalf.
9859
b932f770
JH
9860@item -fasynchronous-unwind-tables
9861@opindex funwind-tables
9862Generate unwind table in dwarf2 format, if supported by target machine. The
9863table is exact at each instruction boundary, so it can be used for stack
9864unwinding from asynchronous events (such as debugger or garbage collector).
9865
74291a4b 9866@item -fpcc-struct-return
cd3bb277 9867@opindex fpcc-struct-return
74291a4b
MM
9868Return ``short'' @code{struct} and @code{union} values in memory like
9869longer ones, rather than in registers. This convention is less
9870efficient, but it has the advantage of allowing intercallability between
0c2d1a2a 9871GCC-compiled files and files compiled with other compilers.
74291a4b
MM
9872
9873The precise convention for returning structures in memory depends
9874on the target configuration macros.
9875
9876Short structures and unions are those whose size and alignment match
9877that of some integer type.
9878
9879@item -freg-struct-return
cd3bb277 9880@opindex freg-struct-return
9c34dbbf
ZW
9881Return @code{struct} and @code{union} values in registers when possible.
9882This is more efficient for small structures than
9883@option{-fpcc-struct-return}.
74291a4b 9884
9c34dbbf 9885If you specify neither @option{-fpcc-struct-return} nor
630d3d5a 9886@option{-freg-struct-return}, GCC defaults to whichever convention is
0c2d1a2a 9887standard for the target. If there is no standard convention, GCC
9c34dbbf
ZW
9888defaults to @option{-fpcc-struct-return}, except on targets where GCC is
9889the principal compiler. In those cases, we can choose the standard, and
9890we chose the more efficient register return alternative.
74291a4b
MM
9891
9892@item -fshort-enums
cd3bb277 9893@opindex fshort-enums
74291a4b
MM
9894Allocate to an @code{enum} type only as many bytes as it needs for the
9895declared range of possible values. Specifically, the @code{enum} type
9896will be equivalent to the smallest integer type which has enough room.
9897
9898@item -fshort-double
cd3bb277 9899@opindex fshort-double
74291a4b
MM
9900Use the same size for @code{double} as for @code{float}.
9901
9902@item -fshared-data
cd3bb277 9903@opindex fshared-data
74291a4b
MM
9904Requests that the data and non-@code{const} variables of this
9905compilation be shared data rather than private data. The distinction
9906makes sense only on certain operating systems, where shared data is
9907shared between processes running the same program, while private data
9908exists in one copy per process.
9909
9910@item -fno-common
cd3bb277 9911@opindex fno-common
90ecce3e 9912In C, allocate even uninitialized global variables in the data section of the
74291a4b
MM
9913object file, rather than generating them as common blocks. This has the
9914effect that if the same variable is declared (without @code{extern}) in
9915two different compilations, you will get an error when you link them.
9916The only reason this might be useful is if you wish to verify that the
9917program will work on other systems which always work this way.
9918
9919@item -fno-ident
cd3bb277 9920@opindex fno-ident
74291a4b
MM
9921Ignore the @samp{#ident} directive.
9922
9923@item -fno-gnu-linker
cd3bb277 9924@opindex fno-gnu-linker
74291a4b
MM
9925Do not output global initializations (such as C++ constructors and
9926destructors) in the form used by the GNU linker (on systems where the GNU
9927linker is the standard method of handling them). Use this option when
9928you want to use a non-GNU linker, which also requires using the
bedc7537
NC
9929@command{collect2} program to make sure the system linker includes
9930constructors and destructors. (@command{collect2} is included in the GCC
9931distribution.) For systems which @emph{must} use @command{collect2}, the
9932compiler driver @command{gcc} is configured to do this automatically.
74291a4b
MM
9933
9934@item -finhibit-size-directive
cd3bb277 9935@opindex finhibit-size-directive
74291a4b
MM
9936Don't output a @code{.size} assembler directive, or anything else that
9937would cause trouble if the function is split in the middle, and the
9938two halves are placed at locations far apart in memory. This option is
9939used when compiling @file{crtstuff.c}; you should not need to use it
9940for anything else.
9941
9942@item -fverbose-asm
cd3bb277 9943@opindex fverbose-asm
74291a4b
MM
9944Put extra commentary information in the generated assembly code to
9945make it more readable. This option is generally only of use to those
9946who actually need to read the generated assembly code (perhaps while
9947debugging the compiler itself).
9948
630d3d5a 9949@option{-fno-verbose-asm}, the default, causes the
74291a4b
MM
9950extra information to be omitted and is useful when comparing two assembler
9951files.
9952
9953@item -fvolatile
cd3bb277 9954@opindex fvolatile
74291a4b
MM
9955Consider all memory references through pointers to be volatile.
9956
9957@item -fvolatile-global
cd3bb277 9958@opindex fvolatile-global
74291a4b 9959Consider all memory references to extern and global data items to
0c2d1a2a 9960be volatile. GCC does not consider static data items to be volatile
ab87f8c8
JL
9961because of this switch.
9962
9963@item -fvolatile-static
cd3bb277 9964@opindex fvolatile-static
ab87f8c8 9965Consider all memory references to static data to be volatile.
74291a4b
MM
9966
9967@item -fpic
cd3bb277 9968@opindex fpic
74291a4b
MM
9969@cindex global offset table
9970@cindex PIC
9971Generate position-independent code (PIC) suitable for use in a shared
9972library, if supported for the target machine. Such code accesses all
161d7b59 9973constant addresses through a global offset table (GOT)@. The dynamic
861bb6c1 9974loader resolves the GOT entries when the program starts (the dynamic
0c2d1a2a 9975loader is not part of GCC; it is part of the operating system). If
861bb6c1
JL
9976the GOT size for the linked executable exceeds a machine-specific
9977maximum size, you get an error message from the linker indicating that
630d3d5a 9978@option{-fpic} does not work; in that case, recompile with @option{-fPIC}
861bb6c1
JL
9979instead. (These maximums are 16k on the m88k, 8k on the Sparc, and 32k
9980on the m68k and RS/6000. The 386 has no such limit.)
74291a4b
MM
9981
9982Position-independent code requires special support, and therefore works
0c2d1a2a 9983only on certain machines. For the 386, GCC supports PIC for System V
74291a4b
MM
9984but not for the Sun 386i. Code generated for the IBM RS/6000 is always
9985position-independent.
9986
74291a4b 9987@item -fPIC
cd3bb277 9988@opindex fPIC
74291a4b
MM
9989If supported for the target machine, emit position-independent code,
9990suitable for dynamic linking and avoiding any limit on the size of the
9991global offset table. This option makes a difference on the m68k, m88k,
9992and the Sparc.
9993
9994Position-independent code requires special support, and therefore works
9995only on certain machines.
9996
9997@item -ffixed-@var{reg}
cd3bb277 9998@opindex ffixed
74291a4b
MM
9999Treat the register named @var{reg} as a fixed register; generated code
10000should never refer to it (except perhaps as a stack pointer, frame
10001pointer or in some other fixed role).
10002
10003@var{reg} must be the name of a register. The register names accepted
10004are machine-specific and are defined in the @code{REGISTER_NAMES}
10005macro in the machine description macro file.
10006
10007This flag does not have a negative form, because it specifies a
10008three-way choice.
10009
10010@item -fcall-used-@var{reg}
cd3bb277 10011@opindex fcall-used
956d6950 10012Treat the register named @var{reg} as an allocable register that is
74291a4b
MM
10013clobbered by function calls. It may be allocated for temporaries or
10014variables that do not live across a call. Functions compiled this way
10015will not save and restore the register @var{reg}.
10016
cb2fdc84
GRK
10017It is an error to used this flag with the frame pointer or stack pointer.
10018Use of this flag for other registers that have fixed pervasive roles in
10019the machine's execution model will produce disastrous results.
74291a4b
MM
10020
10021This flag does not have a negative form, because it specifies a
10022three-way choice.
10023
10024@item -fcall-saved-@var{reg}
cd3bb277 10025@opindex fcall-saved
956d6950 10026Treat the register named @var{reg} as an allocable register saved by
74291a4b
MM
10027functions. It may be allocated even for temporaries or variables that
10028live across a call. Functions compiled this way will save and restore
10029the register @var{reg} if they use it.
10030
cb2fdc84
GRK
10031It is an error to used this flag with the frame pointer or stack pointer.
10032Use of this flag for other registers that have fixed pervasive roles in
10033the machine's execution model will produce disastrous results.
74291a4b
MM
10034
10035A different sort of disaster will result from the use of this flag for
10036a register in which function values may be returned.
10037
10038This flag does not have a negative form, because it specifies a
10039three-way choice.
10040
10041@item -fpack-struct
cd3bb277 10042@opindex fpack-struct
74291a4b
MM
10043Pack all structure members together without holes. Usually you would
10044not want to use this option, since it makes the code suboptimal, and
10045the offsets of structure members won't agree with system libraries.
10046
07417085 10047@item -finstrument-functions
cd3bb277 10048@opindex finstrument-functions
07417085
KR
10049Generate instrumentation calls for entry and exit to functions. Just
10050after function entry and just before function exit, the following
10051profiling functions will be called with the address of the current
10052function and its call site. (On some platforms,
10053@code{__builtin_return_address} does not work beyond the current
10054function, so the call site information may not be available to the
10055profiling functions otherwise.)
10056
10057@example
310668e8
JM
10058void __cyg_profile_func_enter (void *this_fn,
10059 void *call_site);
10060void __cyg_profile_func_exit (void *this_fn,
10061 void *call_site);
07417085
KR
10062@end example
10063
10064The first argument is the address of the start of the current function,
10065which may be looked up exactly in the symbol table.
10066
10067This instrumentation is also done for functions expanded inline in other
10068functions. The profiling calls will indicate where, conceptually, the
10069inline function is entered and exited. This means that addressable
10070versions of such functions must be available. If all your uses of a
10071function are expanded inline, this may mean an additional expansion of
10072code size. If you use @samp{extern inline} in your C code, an
10073addressable version of such functions must be provided. (This is
10074normally the case anyways, but if you get lucky and the optimizer always
10075expands the functions inline, you might have gotten away without
10076providing static copies.)
10077
10078A function may be given the attribute @code{no_instrument_function}, in
10079which case this instrumentation will not be done. This can be used, for
10080example, for the profiling functions listed above, high-priority
10081interrupt routines, and any functions from which the profiling functions
10082cannot safely be called (perhaps signal handlers, if the profiling
10083routines generate output or allocate memory).
10084
861bb6c1 10085@item -fstack-check
cd3bb277 10086@opindex fstack-check
861bb6c1
JL
10087Generate code to verify that you do not go beyond the boundary of the
10088stack. You should specify this flag if you are running in an
10089environment with multiple threads, but only rarely need to specify it in
10090a single-threaded environment since stack overflow is automatically
10091detected on nearly all systems if there is only one stack.
10092
a157febd
GK
10093Note that this switch does not actually cause checking to be done; the
10094operating system must do that. The switch causes generation of code
10095to ensure that the operating system sees the stack being extended.
10096
10097@item -fstack-limit-register=@var{reg}
10098@itemx -fstack-limit-symbol=@var{sym}
10099@itemx -fno-stack-limit
cd3bb277
JM
10100@opindex fstack-limit-register
10101@opindex fstack-limit-symbol
10102@opindex fno-stack-limit
a157febd
GK
10103Generate code to ensure that the stack does not grow beyond a certain value,
10104either the value of a register or the address of a symbol. If the stack
10105would grow beyond the value, a signal is raised. For most targets,
10106the signal is raised before the stack overruns the boundary, so
10107it is possible to catch the signal without taking special precautions.
10108
9c34dbbf
ZW
10109For instance, if the stack starts at absolute address @samp{0x80000000}
10110and grows downwards, you can use the flags
10111@option{-fstack-limit-symbol=__stack_limit} and
10112@option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
10113of 128KB@. Note that this may only work with the GNU linker.
a157febd 10114
e5eb27e5
JL
10115@cindex aliasing of parameters
10116@cindex parameters, aliased
10117@item -fargument-alias
04afd9d6
JL
10118@itemx -fargument-noalias
10119@itemx -fargument-noalias-global
cd3bb277
JM
10120@opindex fargument-alias
10121@opindex fargument-noalias
10122@opindex fargument-noalias-global
e5eb27e5
JL
10123Specify the possible relationships among parameters and between
10124parameters and global data.
10125
630d3d5a 10126@option{-fargument-alias} specifies that arguments (parameters) may
9c34dbbf 10127alias each other and may alias global storage.@*
630d3d5a 10128@option{-fargument-noalias} specifies that arguments do not alias
9c34dbbf 10129each other, but may alias global storage.@*
630d3d5a 10130@option{-fargument-noalias-global} specifies that arguments do not
e5eb27e5
JL
10131alias each other and do not alias global storage.
10132
10133Each language will automatically use whatever option is required by
10134the language standard. You should not need to use these options yourself.
19283265
RH
10135
10136@item -fleading-underscore
cd3bb277 10137@opindex fleading-underscore
695ac33f 10138This option and its counterpart, @option{-fno-leading-underscore}, forcibly
19283265
RH
10139change the way C symbols are represented in the object file. One use
10140is to help link with legacy assembly code.
10141
10142Be warned that you should know what you are doing when invoking this
10143option, and that not all targets provide complete support for it.
74291a4b
MM
10144@end table
10145
ee457005
JM
10146@c man end
10147
74291a4b 10148@node Environment Variables
0c2d1a2a 10149@section Environment Variables Affecting GCC
74291a4b
MM
10150@cindex environment variables
10151
ee457005
JM
10152@c man begin ENVIRONMENT
10153
0c2d1a2a
JB
10154This section describes several environment variables that affect how GCC
10155operates. Some of them work by specifying directories or prefixes to use
767094dd 10156when searching for various kinds of files. Some are used to specify other
46103ab4 10157aspects of the compilation environment.
74291a4b 10158
74291a4b 10159Note that you can also specify places to search using options such as
630d3d5a 10160@option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}). These
74291a4b 10161take precedence over places specified using environment variables, which
161d7b59 10162in turn take precedence over those specified by the configuration of GCC@.
b11cc610
JM
10163@xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
10164GNU Compiler Collection (GCC) Internals}.
74291a4b 10165
bedc7537 10166@table @env
ab87f8c8
JL
10167@item LANG
10168@itemx LC_CTYPE
10169@c @itemx LC_COLLATE
10170@itemx LC_MESSAGES
10171@c @itemx LC_MONETARY
10172@c @itemx LC_NUMERIC
10173@c @itemx LC_TIME
10174@itemx LC_ALL
10175@findex LANG
10176@findex LC_CTYPE
10177@c @findex LC_COLLATE
10178@findex LC_MESSAGES
10179@c @findex LC_MONETARY
10180@c @findex LC_NUMERIC
10181@c @findex LC_TIME
10182@findex LC_ALL
10183@cindex locale
0c2d1a2a
JB
10184These environment variables control the way that GCC uses
10185localization information that allow GCC to work with different
10186national conventions. GCC inspects the locale categories
bedc7537 10187@env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
ab87f8c8
JL
10188so. These locale categories can be set to any value supported by your
10189installation. A typical value is @samp{en_UK} for English in the United
10190Kingdom.
10191
bedc7537 10192The @env{LC_CTYPE} environment variable specifies character
0c2d1a2a 10193classification. GCC uses it to determine the character boundaries in
ab87f8c8
JL
10194a string; this is needed for some multibyte encodings that contain quote
10195and escape characters that would otherwise be interpreted as a string
10196end or escape.
10197
bedc7537 10198The @env{LC_MESSAGES} environment variable specifies the language to
ab87f8c8
JL
10199use in diagnostic messages.
10200
bedc7537
NC
10201If the @env{LC_ALL} environment variable is set, it overrides the value
10202of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
10203and @env{LC_MESSAGES} default to the value of the @env{LANG}
0c2d1a2a 10204environment variable. If none of these variables are set, GCC
ab87f8c8
JL
10205defaults to traditional C English behavior.
10206
74291a4b
MM
10207@item TMPDIR
10208@findex TMPDIR
bedc7537 10209If @env{TMPDIR} is set, it specifies the directory to use for temporary
0c2d1a2a 10210files. GCC uses temporary files to hold the output of one stage of
74291a4b
MM
10211compilation which is to be used as input to the next stage: for example,
10212the output of the preprocessor, which is the input to the compiler
10213proper.
10214
10215@item GCC_EXEC_PREFIX
10216@findex GCC_EXEC_PREFIX
bedc7537 10217If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
74291a4b
MM
10218names of the subprograms executed by the compiler. No slash is added
10219when this prefix is combined with the name of a subprogram, but you can
10220specify a prefix that ends with a slash if you wish.
10221
f0523f02 10222If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
0deb20df
TT
10223an appropriate prefix to use based on the pathname it was invoked with.
10224
0c2d1a2a 10225If GCC cannot find the subprogram using the specified prefix, it
74291a4b
MM
10226tries looking in the usual places for the subprogram.
10227
bedc7537 10228The default value of @env{GCC_EXEC_PREFIX} is
74291a4b
MM
10229@file{@var{prefix}/lib/gcc-lib/} where @var{prefix} is the value
10230of @code{prefix} when you ran the @file{configure} script.
10231
630d3d5a 10232Other prefixes specified with @option{-B} take precedence over this prefix.
74291a4b
MM
10233
10234This prefix is also used for finding files such as @file{crt0.o} that are
10235used for linking.
10236
10237In addition, the prefix is used in an unusual way in finding the
10238directories to search for header files. For each of the standard
10239directories whose name normally begins with @samp{/usr/local/lib/gcc-lib}
bedc7537 10240(more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
74291a4b 10241replacing that beginning with the specified prefix to produce an
630d3d5a 10242alternate directory name. Thus, with @option{-Bfoo/}, GCC will search
74291a4b
MM
10243@file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
10244These alternate directories are searched first; the standard directories
10245come next.
10246
10247@item COMPILER_PATH
10248@findex COMPILER_PATH
bedc7537
NC
10249The value of @env{COMPILER_PATH} is a colon-separated list of
10250directories, much like @env{PATH}. GCC tries the directories thus
74291a4b 10251specified when searching for subprograms, if it can't find the
bedc7537 10252subprograms using @env{GCC_EXEC_PREFIX}.
74291a4b
MM
10253
10254@item LIBRARY_PATH
10255@findex LIBRARY_PATH
bedc7537
NC
10256The value of @env{LIBRARY_PATH} is a colon-separated list of
10257directories, much like @env{PATH}. When configured as a native compiler,
0c2d1a2a 10258GCC tries the directories thus specified when searching for special
bedc7537 10259linker files, if it can't find them using @env{GCC_EXEC_PREFIX}. Linking
0c2d1a2a 10260using GCC also uses these directories when searching for ordinary
630d3d5a
JM
10261libraries for the @option{-l} option (but directories specified with
10262@option{-L} come first).
74291a4b
MM
10263
10264@item C_INCLUDE_PATH
10265@itemx CPLUS_INCLUDE_PATH
10266@itemx OBJC_INCLUDE_PATH
10267@findex C_INCLUDE_PATH
10268@findex CPLUS_INCLUDE_PATH
10269@findex OBJC_INCLUDE_PATH
10270@c @itemx OBJCPLUS_INCLUDE_PATH
10271These environment variables pertain to particular languages. Each
10272variable's value is a colon-separated list of directories, much like
bedc7537 10273@env{PATH}. When GCC searches for header files, it tries the
74291a4b 10274directories listed in the variable for the language you are using, after
630d3d5a 10275the directories specified with @option{-I} but before the standard header
74291a4b
MM
10276file directories.
10277
10278@item DEPENDENCIES_OUTPUT
10279@findex DEPENDENCIES_OUTPUT
10280@cindex dependencies for make as output
10281If this variable is set, its value specifies how to output dependencies
10282for Make based on the header files processed by the compiler. This
630d3d5a 10283output looks much like the output from the @option{-M} option
74291a4b
MM
10284(@pxref{Preprocessor Options}), but it goes to a separate file, and is
10285in addition to the usual results of compilation.
10286
bedc7537 10287The value of @env{DEPENDENCIES_OUTPUT} can be just a file name, in
74291a4b
MM
10288which case the Make rules are written to that file, guessing the target
10289name from the source file name. Or the value can have the form
10290@samp{@var{file} @var{target}}, in which case the rules are written to
10291file @var{file} using @var{target} as the target name.
56f48ce9
DB
10292
10293@item LANG
10294@findex LANG
10295@cindex locale definition
767094dd 10296This variable is used to pass locale information to the compiler. One way in
56f48ce9
DB
10297which this information is used is to determine the character set to be used
10298when character literals, string literals and comments are parsed in C and C++.
10299When the compiler is configured to allow multibyte characters,
bedc7537 10300the following values for @env{LANG} are recognized:
56f48ce9 10301
2642624b 10302@table @samp
56f48ce9
DB
10303@item C-JIS
10304Recognize JIS characters.
10305@item C-SJIS
10306Recognize SJIS characters.
10307@item C-EUCJP
10308Recognize EUCJP characters.
10309@end table
10310
bedc7537 10311If @env{LANG} is not defined, or if it has some other value, then the
56f48ce9
DB
10312compiler will use mblen and mbtowc as defined by the default locale to
10313recognize and translate multibyte characters.
74291a4b
MM
10314@end table
10315
9d86bffc
JM
10316@c man end
10317
74291a4b
MM
10318@node Running Protoize
10319@section Running Protoize
10320
161d7b59 10321The program @code{protoize} is an optional part of GCC@. You can use
c1030c7c 10322it to add prototypes to a program, thus converting the program to ISO
74291a4b
MM
10323C in one respect. The companion program @code{unprotoize} does the
10324reverse: it removes argument types from any prototypes that are found.
10325
10326When you run these programs, you must specify a set of source files as
10327command line arguments. The conversion programs start out by compiling
10328these files to see what functions they define. The information gathered
10329about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
10330
10331After scanning comes actual conversion. The specified files are all
10332eligible to be converted; any files they include (whether sources or
10333just headers) are eligible as well.
10334
10335But not all the eligible files are converted. By default,
10336@code{protoize} and @code{unprotoize} convert only source and header
10337files in the current directory. You can specify additional directories
630d3d5a 10338whose files should be converted with the @option{-d @var{directory}}
74291a4b 10339option. You can also specify particular files to exclude with the
630d3d5a 10340@option{-x @var{file}} option. A file is converted if it is eligible, its
74291a4b
MM
10341directory name matches one of the specified directory names, and its
10342name within the directory has not been excluded.
10343
10344Basic conversion with @code{protoize} consists of rewriting most
10345function definitions and function declarations to specify the types of
10346the arguments. The only ones not rewritten are those for varargs
10347functions.
10348
10349@code{protoize} optionally inserts prototype declarations at the
10350beginning of the source file, to make them available for any calls that
10351precede the function's definition. Or it can insert prototype
10352declarations with block scope in the blocks where undeclared functions
10353are called.
10354
10355Basic conversion with @code{unprotoize} consists of rewriting most
10356function declarations to remove any argument types, and rewriting
c1030c7c 10357function definitions to the old-style pre-ISO form.
74291a4b
MM
10358
10359Both conversion programs print a warning for any function declaration or
10360definition that they can't convert. You can suppress these warnings
630d3d5a 10361with @option{-q}.
74291a4b
MM
10362
10363The output from @code{protoize} or @code{unprotoize} replaces the
10364original source file. The original file is renamed to a name ending
02f52e19 10365with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
a7db8bbb
MK
10366without the original @samp{.c} suffix). If the @samp{.save} (@samp{.sav}
10367for DOS) file already exists, then the source file is simply discarded.
74291a4b 10368
0c2d1a2a 10369@code{protoize} and @code{unprotoize} both depend on GCC itself to
74291a4b 10370scan the program and collect information about the functions it uses.
0c2d1a2a 10371So neither of these programs will work until GCC is installed.
74291a4b
MM
10372
10373Here is a table of the options you can use with @code{protoize} and
10374@code{unprotoize}. Each option works with both programs unless
10375otherwise stated.
10376
10377@table @code
10378@item -B @var{directory}
10379Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
10380usual directory (normally @file{/usr/local/lib}). This file contains
10381prototype information about standard system functions. This option
10382applies only to @code{protoize}.
10383
10384@item -c @var{compilation-options}
10385Use @var{compilation-options} as the options when running @code{gcc} to
630d3d5a 10386produce the @samp{.X} files. The special option @option{-aux-info} is
74291a4b
MM
10387always passed in addition, to tell @code{gcc} to write a @samp{.X} file.
10388
10389Note that the compilation options must be given as a single argument to
10390@code{protoize} or @code{unprotoize}. If you want to specify several
10391@code{gcc} options, you must quote the entire set of compilation options
10392to make them a single word in the shell.
10393
10394There are certain @code{gcc} arguments that you cannot use, because they
630d3d5a
JM
10395would produce the wrong kind of output. These include @option{-g},
10396@option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
74291a4b
MM
10397the @var{compilation-options}, they are ignored.
10398
10399@item -C
a7db8bbb 10400Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
02f52e19 10401systems) instead of @samp{.c}. This is convenient if you are converting
ee77eda5 10402a C program to C++. This option applies only to @code{protoize}.
74291a4b
MM
10403
10404@item -g
10405Add explicit global declarations. This means inserting explicit
10406declarations at the beginning of each source file for each function
10407that is called in the file and was not declared. These declarations
10408precede the first function definition that contains a call to an
10409undeclared function. This option applies only to @code{protoize}.
10410
10411@item -i @var{string}
10412Indent old-style parameter declarations with the string @var{string}.
10413This option applies only to @code{protoize}.
10414
10415@code{unprotoize} converts prototyped function definitions to old-style
10416function definitions, where the arguments are declared between the
10417argument list and the initial @samp{@{}. By default, @code{unprotoize}
10418uses five spaces as the indentation. If you want to indent with just
630d3d5a 10419one space instead, use @option{-i " "}.
74291a4b
MM
10420
10421@item -k
10422Keep the @samp{.X} files. Normally, they are deleted after conversion
10423is finished.
10424
10425@item -l
630d3d5a 10426Add explicit local declarations. @code{protoize} with @option{-l} inserts
74291a4b
MM
10427a prototype declaration for each function in each block which calls the
10428function without any declaration. This option applies only to
10429@code{protoize}.
10430
10431@item -n
10432Make no real changes. This mode just prints information about the conversions
630d3d5a 10433that would have been done without @option{-n}.
74291a4b
MM
10434
10435@item -N
10436Make no @samp{.save} files. The original files are simply deleted.
10437Use this option with caution.
10438
10439@item -p @var{program}
10440Use the program @var{program} as the compiler. Normally, the name
10441@file{gcc} is used.
10442
10443@item -q
10444Work quietly. Most warnings are suppressed.
10445
10446@item -v
630d3d5a 10447Print the version number, just like @option{-v} for @code{gcc}.
74291a4b
MM
10448@end table
10449
10450If you need special compiler options to compile one of your program's
10451source files, then you should generate that file's @samp{.X} file
10452specially, by running @code{gcc} on that source file with the
630d3d5a 10453appropriate options and the option @option{-aux-info}. Then run
74291a4b
MM
10454@code{protoize} on the entire set of files. @code{protoize} will use
10455the existing @samp{.X} file because it is newer than the source file.
10456For example:
10457
10458@example
b1018de6 10459gcc -Dfoo=bar file1.c -aux-info file1.X
74291a4b
MM
10460protoize *.c
10461@end example
10462
10463@noindent
10464You need to include the special files along with the rest in the
10465@code{protoize} command, even though their @samp{.X} files already
10466exist, because otherwise they won't get converted.
10467
10468@xref{Protoize Caveats}, for more information on how to use
10469@code{protoize} successfully.
This page took 2.92984 seconds and 5 git commands to generate.