8301 lines
380 KiB
HTML
8301 lines
380 KiB
HTML
<HTML>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<!-- Created on March, 17 2001 by texi2html 1.64 -->
|
|
<!--
|
|
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
|
|
Karl Berry <karl@freefriends.org>
|
|
Olaf Bachmann <obachman@mathematik.uni-kl.de>
|
|
and many others.
|
|
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
|
|
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
|
|
|
|
-->
|
|
<HEAD>
|
|
<TITLE>Using and Porting the GNU Compiler Collection (GCC): Invoking GCC</TITLE>
|
|
|
|
<META NAME="description" CONTENT="Using and Porting the GNU Compiler Collection (GCC): Invoking GCC">
|
|
<META NAME="keywords" CONTENT="Using and Porting the GNU Compiler Collection (GCC): Invoking GCC">
|
|
<META NAME="resource-type" CONTENT="document">
|
|
<META NAME="distribution" CONTENT="global">
|
|
<META NAME="Generator" CONTENT="texi2html 1.64">
|
|
|
|
</HEAD>
|
|
|
|
<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
|
|
|
|
<A NAME="SEC2"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_1.html#SEC1" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_1.html#SEC1"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC3" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC3"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H1> 2. GCC Command Options </H1>
|
|
<!--docid::SEC2::-->
|
|
<P>
|
|
|
|
When you invoke GCC, it normally does preprocessing, compilation,
|
|
assembly and linking. The "overall options" allow you to stop this
|
|
process at an intermediate stage. For example, the <SAMP>`-c'</SAMP> option
|
|
says not to run the linker. Then the output consists of object files
|
|
output by the assembler.
|
|
</P><P>
|
|
|
|
Other options are passed on to one stage of processing. Some options
|
|
control the preprocessor and others the compiler itself. Yet other
|
|
options control the assembler and linker; most of these are not
|
|
documented here, since you rarely need to use any of them.
|
|
</P><P>
|
|
|
|
<A NAME="IDX9"></A>
|
|
Most of the command line options that you can use with GCC are useful
|
|
for C programs; when an option is only useful with another language
|
|
(usually C++), the explanation says so explicitly. If the description
|
|
for a particular option does not mention a source language, you can use
|
|
that option with all supported languages.
|
|
</P><P>
|
|
|
|
<A NAME="IDX10"></A>
|
|
See section <A HREF="gcc_2.html#SEC5" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC5">Compiling C++ Programs</A>, for a summary of special
|
|
options for compiling C++ programs.
|
|
</P><P>
|
|
|
|
<A NAME="IDX11"></A>
|
|
<A NAME="IDX12"></A>
|
|
The <CODE>gcc</CODE> program accepts options and file names as operands. Many
|
|
options have multiletter names; therefore multiple single-letter options
|
|
may <EM>not</EM> be grouped: <SAMP>`-dr'</SAMP> is very different from <SAMP>`-d
|
|
-r'</SAMP>.
|
|
</P><P>
|
|
|
|
<A NAME="IDX13"></A>
|
|
<A NAME="IDX14"></A>
|
|
You can mix options and other arguments. For the most part, the order
|
|
you use doesn't matter. Order does matter when you use several options
|
|
of the same kind; for example, if you specify <SAMP>`-L'</SAMP> more than once,
|
|
the directories are searched in the order specified.
|
|
</P><P>
|
|
|
|
Many options have long names starting with <SAMP>`-f'</SAMP> or with
|
|
<SAMP>`-W'</SAMP>---for example, <SAMP>`-fforce-mem'</SAMP>,
|
|
<SAMP>`-fstrength-reduce'</SAMP>, <SAMP>`-Wformat'</SAMP> and so on. Most of
|
|
these have both positive and negative forms; the negative form of
|
|
<SAMP>`-ffoo'</SAMP> would be <SAMP>`-fno-foo'</SAMP>. This manual documents
|
|
only one of these two forms, whichever one is not the default.
|
|
</P><P>
|
|
|
|
<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC3" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC3">2.1 Option Summary</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Brief list of all options, without explanations.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC4" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC4">2.2 Options Controlling the Kind of Output</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Controlling the kind of output:
|
|
an executable, object files, assembler files,
|
|
or preprocessed source.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC5" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC5">2.3 Compiling C++ Programs</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Compiling C++ programs.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC6" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC6">2.4 Options Controlling C Dialect</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Controlling the variant of C language compiled.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC7" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC7">2.5 Options Controlling C++ Dialect</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Variations on C++.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC8" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC8">2.6 Options to Request or Suppress Warnings</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How picky should the compiler be?</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC9" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC9">2.7 Options for Debugging Your Program or GCC</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Symbol tables, measurements, and debugging dumps.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC10" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC10">2.8 Options That Control Optimization</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How much optimization?</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC11" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC11">2.9 Options Controlling the Preprocessor</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Controlling header files and macro definitions.
|
|
Also, getting dependency information for Make.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC12" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC12">2.10 Passing Options to the Assembler</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Passing options to the assembler.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC13" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC13">2.11 Options for Linking</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Specifying libraries and so on.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC14" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC14">2.12 Options for Directory Search</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Where to find header files and libraries.
|
|
Where to find the compiler executable files.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC15" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC15">2.13 Specifying Target Machine and Compiler Version</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Running a cross-compiler, or an old version of GCC.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16">2.14 Hardware Models and Configurations</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Specifying minor hardware or convention variations,
|
|
such as 68010 vs 68020.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43">2.15 Options for Code Generation Conventions</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Specifying conventions for function calls, data layout
|
|
and register usage.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC44" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC44">2.16 Environment Variables Affecting GCC</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Env vars that affect GCC.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC45" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC45">2.17 Running Protoize</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Automatically adding or removing function prototypes.</TD></TR>
|
|
</TABLE></BLOCKQUOTE>
|
|
<P>
|
|
|
|
<A NAME="Option Summary"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC3"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC4" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC4"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 2.1 Option Summary </H2>
|
|
<!--docid::SEC3::-->
|
|
<P>
|
|
|
|
Here is a summary of all the options, grouped by type. Explanations are
|
|
in the following sections.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><EM>Overall Options</EM>
|
|
<DD>See section <A HREF="gcc_2.html#SEC4" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC4">Options Controlling the Kind of Output</A>.
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>-c -S -E -o <VAR>file</VAR> -pipe -v --help -x <VAR>language</VAR>
|
|
</FONT></pre></td></tr></table><P>
|
|
|
|
<DT><EM>C Language Options</EM>
|
|
<DD>See section <A HREF="gcc_2.html#SEC6" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC6">Options Controlling C Dialect</A>.
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>-ansi -fstd -fallow-single-precision -fcond-mismatch -fno-asm
|
|
-fno-builtin -ffreestanding -fhosted -fsigned-bitfields -fsigned-char
|
|
-funsigned-bitfields -funsigned-char -fwritable-strings
|
|
-traditional -traditional-cpp -trigraphs
|
|
</FONT></pre></td></tr></table><P>
|
|
|
|
<DT><EM>C++ Language Options</EM>
|
|
<DD>See section <A HREF="gcc_2.html#SEC7" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC7">Options Controlling C++ Dialect</A>.
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>-fno-access-control -fcheck-new -fconserve-space -fdollars-in-identifiers
|
|
-fno-elide-constructors -fexternal-templates -ffor-scope
|
|
-fno-for-scope -fno-gnu-keywords -fguiding-decls -fhandle-signatures
|
|
-fhonor-std -fhuge-objects -fno-implicit-templates -finit-priority
|
|
-fno-implement-inlines -fname-mangling-version-<VAR>n</VAR> -fno-default-inline
|
|
-foperator-names -fno-optional-diags -fpermissive -frepo -fstrict-prototype
|
|
-fsquangle -ftemplate-depth-<VAR>n</VAR> -fthis-is-variable -fvtable-thunks
|
|
-nostdinc++ -Wctor-dtor-privacy -Wno-deprecated -Weffc++
|
|
-Wno-non-template-friend
|
|
-Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual
|
|
-Wno-pmf-conversions -Wreorder -Wsign-promo -Wsynth
|
|
</FONT></pre></td></tr></table><P>
|
|
|
|
<DT><EM>Warning Options</EM>
|
|
<DD>See section <A HREF="gcc_2.html#SEC8" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC8">Options to Request or Suppress Warnings</A>.
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>-fsyntax-only -pedantic -pedantic-errors
|
|
-w -W -Wall -Waggregate-return -Wbad-function-cast
|
|
-Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment
|
|
-Wconversion -Werror -Wformat
|
|
-Wid-clash-<VAR>len</VAR> -Wimplicit -Wimplicit-int
|
|
-Wimplicit-function-declaration -Wimport
|
|
-Werror-implicit-function-declaration -Winline
|
|
-Wlarger-than-<VAR>len</VAR> -Wlong-long
|
|
-Wmain -Wmissing-declarations -Wmissing-noreturn
|
|
-Wmissing-prototypes -Wmultichar -Wnested-externs -Wno-import
|
|
-Wparentheses -Wpointer-arith -Wredundant-decls
|
|
-Wreturn-type -Wshadow -Wsign-compare -Wstrict-prototypes
|
|
-Wswitch -Wtraditional
|
|
-Wtrigraphs -Wundef -Wuninitialized -Wunused -Wwrite-strings
|
|
-Wunknown-pragmas
|
|
</FONT></pre></td></tr></table><P>
|
|
|
|
<DT><EM>Debugging Options</EM>
|
|
<DD>See section <A HREF="gcc_2.html#SEC9" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC9">Options for Debugging Your Program or GCC</A>.
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>-a -ax -d<VAR>letters</VAR> -fdump-unnumbered -fpretend-float
|
|
-fprofile-arcs -ftest-coverage
|
|
-g -g<VAR>level</VAR> -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2
|
|
-ggdb -gstabs -gstabs+ -gxcoff -gxcoff+
|
|
-p -pg -print-file-name=<VAR>library</VAR> -print-libgcc-file-name
|
|
-print-prog-name=<VAR>program</VAR> -print-search-dirs -save-temps
|
|
</FONT></pre></td></tr></table><P>
|
|
|
|
<DT><EM>Optimization Options</EM>
|
|
<DD>See section <A HREF="gcc_2.html#SEC10" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC10">Options that Control Optimization</A>.
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>-fbranch-probabilities -foptimize-register-moves
|
|
-fcaller-saves -fcse-follow-jumps -fcse-skip-blocks
|
|
-fdelayed-branch -fexpensive-optimizations
|
|
-ffast-math -ffloat-store -fforce-addr -fforce-mem
|
|
-fdata-sections -ffunction-sections -fgcse
|
|
-finline-functions -finline-limit-<VAR>n</VAR> -fkeep-inline-functions
|
|
-fno-default-inline -fno-defer-pop -fno-function-cse
|
|
-fno-inline -fno-peephole -fomit-frame-pointer -fregmove
|
|
-frerun-cse-after-loop -frerun-loop-opt -fschedule-insns
|
|
-fschedule-insns2 -fstrength-reduce -fthread-jumps
|
|
-funroll-all-loops -funroll-loops
|
|
-fmove-all-movables -freduce-all-givs -fstrict-aliasing
|
|
-O -O0 -O1 -O2 -O3 -Os
|
|
</FONT></pre></td></tr></table><P>
|
|
|
|
<DT><EM>Preprocessor Options</EM>
|
|
<DD>See section <A HREF="gcc_2.html#SEC11" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC11">Options Controlling the Preprocessor</A>.
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>-A<VAR>question</VAR>(<VAR>answer</VAR>) -C -dD -dM -dN
|
|
-D<VAR>macro</VAR>[=<VAR>defn</VAR>] -E -H
|
|
-idirafter <VAR>dir</VAR>
|
|
-include <VAR>file</VAR> -imacros <VAR>file</VAR>
|
|
-iprefix <VAR>file</VAR> -iwithprefix <VAR>dir</VAR>
|
|
-iwithprefixbefore <VAR>dir</VAR> -isystem <VAR>dir</VAR> -isystem-c++ <VAR>dir</VAR>
|
|
-M -MD -MM -MMD -MG -nostdinc -P -trigraphs
|
|
-undef -U<VAR>macro</VAR> -Wp,<VAR>option</VAR>
|
|
</FONT></pre></td></tr></table><P>
|
|
|
|
<DT><EM>Assembler Option</EM>
|
|
<DD>See section <A HREF="gcc_2.html#SEC12" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC12">Passing Options to the Assembler</A>.
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>-Wa,<VAR>option</VAR>
|
|
</FONT></pre></td></tr></table><P>
|
|
|
|
<DT><EM>Linker Options</EM>
|
|
<DD>See section <A HREF="gcc_2.html#SEC13" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC13">Options for Linking</A>.
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre><VAR>object-file-name</VAR> -l<VAR>library</VAR>
|
|
-nostartfiles -nodefaultlibs -nostdlib
|
|
-s -static -shared -symbolic
|
|
-Wl,<VAR>option</VAR> -Xlinker <VAR>option</VAR>
|
|
-u <VAR>symbol</VAR>
|
|
</FONT></pre></td></tr></table><P>
|
|
|
|
<DT><EM>Directory Options</EM>
|
|
<DD>See section <A HREF="gcc_2.html#SEC14" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC14">Options for Directory Search</A>.
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>-B<VAR>prefix</VAR> -I<VAR>dir</VAR> -I- -L<VAR>dir</VAR> -specs=<VAR>file</VAR>
|
|
</FONT></pre></td></tr></table><P>
|
|
|
|
<DT><EM>Target Options</EM>
|
|
<DD>See section <A HREF="gcc_2.html#SEC15" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC15">2.13 Specifying Target Machine and Compiler Version</A>.
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>-b <VAR>machine</VAR> -V <VAR>version</VAR>
|
|
</FONT></pre></td></tr></table><P>
|
|
|
|
<DT><EM>Machine Dependent Options</EM>
|
|
<DD>See section <A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16">Hardware Models and Configurations</A>.
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre><EM>M680x0 Options</EM>
|
|
-m68000 -m68020 -m68020-40 -m68020-60 -m68030 -m68040
|
|
-m68060 -mcpu32 -m5200 -m68881 -mbitfield -mc68000 -mc68020
|
|
-mfpa -mnobitfield -mrtd -mshort -msoft-float
|
|
-malign-int
|
|
|
|
<EM>VAX Options</EM>
|
|
-mg -mgnu -munix
|
|
|
|
<EM>SPARC Options</EM>
|
|
-mcpu=<VAR>cpu type</VAR>
|
|
-mtune=<VAR>cpu type</VAR>
|
|
-mcmodel=<VAR>code model</VAR>
|
|
-malign-jumps=<VAR>num</VAR> -malign-loops=<VAR>num</VAR>
|
|
-malign-functions=<VAR>num</VAR>
|
|
-m32 -m64
|
|
-mapp-regs -mbroken-saverestore -mcypress -mepilogue
|
|
-mflat -mfpu -mhard-float -mhard-quad-float
|
|
-mimpure-text -mlive-g0 -mno-app-regs -mno-epilogue
|
|
-mno-flat -mno-fpu -mno-impure-text
|
|
-mno-stack-bias -mno-unaligned-doubles
|
|
-msoft-float -msoft-quad-float -msparclite -mstack-bias
|
|
-msupersparc -munaligned-doubles -mv8
|
|
|
|
<EM>Convex Options</EM>
|
|
-mc1 -mc2 -mc32 -mc34 -mc38
|
|
-margcount -mnoargcount
|
|
-mlong32 -mlong64
|
|
-mvolatile-cache -mvolatile-nocache
|
|
|
|
<EM>AMD29K Options</EM>
|
|
-m29000 -m29050 -mbw -mnbw -mdw -mndw
|
|
-mlarge -mnormal -msmall
|
|
-mkernel-registers -mno-reuse-arg-regs
|
|
-mno-stack-check -mno-storem-bug
|
|
-mreuse-arg-regs -msoft-float -mstack-check
|
|
-mstorem-bug -muser-registers
|
|
|
|
<EM>ARM Options</EM>
|
|
-mapcs-frame -mno-apcs-frame
|
|
-mapcs-26 -mapcs-32
|
|
-mapcs-stack-check -mno-apcs-stack-check
|
|
-mapcs-float -mno-apcs-float
|
|
-mapcs-reentrant -mno-apcs-reentrant
|
|
-msched-prolog -mno-sched-prolog
|
|
-mlittle-endian -mbig-endian -mwords-little-endian
|
|
-mshort-load-bytes -mno-short-load-bytes -mshort-load-words -mno-short-load-words
|
|
-msoft-float -mhard-float -mfpe
|
|
-mthumb-interwork -mno-thumb-interwork
|
|
-mcpu= -march= -mfpe=
|
|
-mstructure-size-boundary=
|
|
-mbsd -mxopen -mno-symrename
|
|
-mabort-on-noreturn
|
|
-mno-sched-prolog
|
|
|
|
<EM>Thumb Options</EM>
|
|
-mtpcs-frame -mno-tpcs-frame
|
|
-mtpcs-leaf-frame -mno-tpcs-leaf-frame
|
|
-mlittle-endian -mbig-endian
|
|
-mthumb-interwork -mno-thumb-interwork
|
|
-mstructure-size-boundary=
|
|
|
|
<EM>MN10200 Options</EM>
|
|
-mrelax
|
|
|
|
<EM>MN10300 Options</EM>
|
|
-mmult-bug
|
|
-mno-mult-bug
|
|
-mrelax
|
|
|
|
<EM>M32R/D Options</EM>
|
|
-mcode-model=<VAR>model type</VAR> -msdata=<VAR>sdata type</VAR>
|
|
-G <VAR>num</VAR>
|
|
|
|
<EM>M88K Options</EM>
|
|
-m88000 -m88100 -m88110 -mbig-pic
|
|
-mcheck-zero-division -mhandle-large-shift
|
|
-midentify-revision -mno-check-zero-division
|
|
-mno-ocs-debug-info -mno-ocs-frame-position
|
|
-mno-optimize-arg-area -mno-serialize-volatile
|
|
-mno-underscores -mocs-debug-info
|
|
-mocs-frame-position -moptimize-arg-area
|
|
-mserialize-volatile -mshort-data-<VAR>num</VAR> -msvr3
|
|
-msvr4 -mtrap-large-shift -muse-div-instruction
|
|
-mversion-03.00 -mwarn-passed-structs
|
|
|
|
<EM>RS/6000 and PowerPC Options</EM>
|
|
-mcpu=<VAR>cpu type</VAR>
|
|
-mtune=<VAR>cpu type</VAR>
|
|
-mpower -mno-power -mpower2 -mno-power2
|
|
-mpowerpc -mno-powerpc
|
|
-mpowerpc-gpopt -mno-powerpc-gpopt
|
|
-mpowerpc-gfxopt -mno-powerpc-gfxopt
|
|
-mnew-mnemonics -mno-new-mnemonics
|
|
-mfull-toc -mminimal-toc -mno-fop-in-toc -mno-sum-in-toc
|
|
-maix64 -maix32 -mxl-call -mno-xl-call -mthreads -mpe
|
|
-msoft-float -mhard-float -mmultiple -mno-multiple
|
|
-mstring -mno-string -mupdate -mno-update
|
|
-mfused-madd -mno-fused-madd -mbit-align -mno-bit-align
|
|
-mstrict-align -mno-strict-align -mrelocatable
|
|
-mno-relocatable -mrelocatable-lib -mno-relocatable-lib
|
|
-mtoc -mno-toc -mlittle -mlittle-endian -mbig -mbig-endian
|
|
-mcall-aix -mcall-sysv -mprototype -mno-prototype
|
|
-msim -mmvme -mads -myellowknife -memb -msdata
|
|
-msdata=<VAR>opt</VAR> -G <VAR>num</VAR>
|
|
|
|
<EM>RT Options</EM>
|
|
-mcall-lib-mul -mfp-arg-in-fpregs -mfp-arg-in-gregs
|
|
-mfull-fp-blocks -mhc-struct-return -min-line-mul
|
|
-mminimum-fp-blocks -mnohc-struct-return
|
|
|
|
<EM>MIPS Options</EM>
|
|
-mabicalls -mcpu=<VAR>cpu type</VAR> -membedded-data
|
|
-membedded-pic -mfp32 -mfp64 -mgas -mgp32 -mgp64
|
|
-mgpopt -mhalf-pic -mhard-float -mint64 -mips1
|
|
-mips2 -mips3 -mips4 -mlong64 -mlong32 -mlong-calls -mmemcpy
|
|
-mmips-as -mmips-tfile -mno-abicalls
|
|
-mno-embedded-data -mno-embedded-pic
|
|
-mno-gpopt -mno-long-calls
|
|
-mno-memcpy -mno-mips-tfile -mno-rnames -mno-stats
|
|
-mrnames -msoft-float
|
|
-m4650 -msingle-float -mmad
|
|
-mstats -EL -EB -G <VAR>num</VAR> -nocpp
|
|
-mabi=32 -mabi=n32 -mabi=64 -mabi=eabi
|
|
|
|
<EM>i386 Options</EM>
|
|
-mcpu=<VAR>cpu type</VAR>
|
|
-march=<VAR>cpu type</VAR>
|
|
-mieee-fp -mno-fancy-math-387
|
|
-mno-fp-ret-in-387 -msoft-float -msvr3-shlib
|
|
-mno-wide-multiply -mrtd -malign-double
|
|
-mreg-alloc=<VAR>list</VAR> -mregparm=<VAR>num</VAR>
|
|
-malign-jumps=<VAR>num</VAR> -malign-loops=<VAR>num</VAR>
|
|
-malign-functions=<VAR>num</VAR> -mpreferred-stack-boundary=<VAR>num</VAR>
|
|
|
|
<EM>HPPA Options</EM>
|
|
-march=<VAR>architecture type</VAR>
|
|
-mbig-switch -mdisable-fpregs -mdisable-indexing
|
|
-mfast-indirect-calls -mgas -mjump-in-delay
|
|
-mlong-load-store -mno-big-switch -mno-disable-fpregs
|
|
-mno-disable-indexing -mno-fast-indirect-calls -mno-gas
|
|
-mno-jump-in-delay -mno-long-load-store
|
|
-mno-portable-runtime -mno-soft-float -mno-space
|
|
-mno-space-regs -msoft-float -mpa-risc-1-0
|
|
-mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime
|
|
-mschedule=<VAR>cpu type</VAR> -mspace -mspace-regs
|
|
|
|
<EM>Intel 960 Options</EM>
|
|
-m<VAR>cpu type</VAR> -masm-compat -mclean-linkage
|
|
-mcode-align -mcomplex-addr -mleaf-procedures
|
|
-mic-compat -mic2.0-compat -mic3.0-compat
|
|
-mintel-asm -mno-clean-linkage -mno-code-align
|
|
-mno-complex-addr -mno-leaf-procedures
|
|
-mno-old-align -mno-strict-align -mno-tail-call
|
|
-mnumerics -mold-align -msoft-float -mstrict-align
|
|
-mtail-call
|
|
|
|
<EM>DEC Alpha Options</EM>
|
|
-mfp-regs -mno-fp-regs -mno-soft-float -msoft-float
|
|
-malpha-as -mgas
|
|
-mieee -mieee-with-inexact -mieee-conformant
|
|
-mfp-trap-mode=<VAR>mode</VAR> -mfp-rounding-mode=<VAR>mode</VAR>
|
|
-mtrap-precision=<VAR>mode</VAR> -mbuild-constants
|
|
-mcpu=<VAR>cpu type</VAR>
|
|
-mbwx -mno-bwx -mcix -mno-cix -mmax -mno-max
|
|
-mmemory-latency=<VAR>time</VAR>
|
|
|
|
<EM>Clipper Options</EM>
|
|
-mc300 -mc400
|
|
|
|
<EM>H8/300 Options</EM>
|
|
-mrelax -mh -ms -mint32 -malign-300
|
|
|
|
<EM>SH Options</EM>
|
|
-m1 -m2 -m3 -m3e -mb -ml -mdalign -mrelax
|
|
|
|
<EM>System V Options</EM>
|
|
-Qy -Qn -YP,<VAR>paths</VAR> -Ym,<VAR>dir</VAR>
|
|
|
|
<EM>ARC Options</EM>
|
|
-EB -EL
|
|
-mmangle-cpu -mcpu=<VAR>cpu</VAR> -mtext=<VAR>text section</VAR>
|
|
-mdata=<VAR>data section</VAR> -mrodata=<VAR>readonly data section</VAR>
|
|
|
|
<EM>TMS320C3x/C4x Options</EM>
|
|
-mcpu=<VAR>cpu</VAR> -mbig -msmall -mregparm -mmemparm
|
|
-mfast-fix -mmpyi -mbk -mti -mdp-isr-reload
|
|
-mrpts=<VAR>count</VAR> -mrptb -mdb -mloop-unsigned
|
|
-mparallel-insns -mparallel-mpy -mpreserve-float
|
|
|
|
<EM>V850 Options</EM>
|
|
-mlong-calls -mno-long-calls -mep -mno-ep
|
|
-mprolog-function -mno-prolog-function -mspace
|
|
-mtda=<VAR>n</VAR> -msda=<VAR>n</VAR> -mzda=<VAR>n</VAR>
|
|
-mv850 -mbig-switch
|
|
|
|
<EM>NS32K Options</EM>
|
|
-m32032 -m32332 -m32532 -m32081 -m32381 -mmult-add -mnomult-add
|
|
-msoft-float -mrtd -mnortd -mregparam -mnoregparam -msb -mnosb
|
|
-mbitfield -mnobitfield -mhimem -mnohimem
|
|
</FONT></pre></td></tr></table><P>
|
|
|
|
<DT><EM>Code Generation Options</EM>
|
|
<DD>See section <A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43">Options for Code Generation Conventions</A>.
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>-fcall-saved-<VAR>reg</VAR> -fcall-used-<VAR>reg</VAR>
|
|
-fexceptions -ffixed-<VAR>reg</VAR> -finhibit-size-directive
|
|
-fcheck-memory-usage -fprefix-function-name
|
|
-fno-common -fno-ident -fno-gnu-linker
|
|
-fpcc-struct-return -fpic -fPIC
|
|
-freg-struct-return -fshared-data -fshort-enums
|
|
-fshort-double -fvolatile -fvolatile-global -fvolatile-static
|
|
-fverbose-asm -fpack-struct -fstack-check
|
|
-fargument-alias -fargument-noalias
|
|
-fargument-noalias-global
|
|
-fleading-underscore
|
|
</FONT></pre></td></tr></table></DL>
|
|
<P>
|
|
|
|
<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC4" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC4">2.2 Options Controlling the Kind of Output</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Controlling the kind of output:
|
|
an executable, object files, assembler files,
|
|
or preprocessed source.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC6" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC6">2.4 Options Controlling C Dialect</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Controlling the variant of C language compiled.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC7" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC7">2.5 Options Controlling C++ Dialect</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Variations on C++.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC8" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC8">2.6 Options to Request or Suppress Warnings</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How picky should the compiler be?</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC9" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC9">2.7 Options for Debugging Your Program or GCC</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Symbol tables, measurements, and debugging dumps.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC10" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC10">2.8 Options That Control Optimization</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">How much optimization?</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC11" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC11">2.9 Options Controlling the Preprocessor</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Controlling header files and macro definitions.
|
|
Also, getting dependency information for Make.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC12" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC12">2.10 Passing Options to the Assembler</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Passing options to the assembler.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC13" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC13">2.11 Options for Linking</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Specifying libraries and so on.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC14" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC14">2.12 Options for Directory Search</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Where to find header files and libraries.
|
|
Where to find the compiler executable files.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC15" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC15">2.13 Specifying Target Machine and Compiler Version</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Running a cross-compiler, or an old version of GCC.</TD></TR>
|
|
</TABLE></BLOCKQUOTE>
|
|
<P>
|
|
|
|
<A NAME="Overall Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC4"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC3" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC3"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC5" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC5"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC5" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC5"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 2.2 Options Controlling the Kind of Output </H2>
|
|
<!--docid::SEC4::-->
|
|
<P>
|
|
|
|
Compilation can involve up to four stages: preprocessing, compilation
|
|
proper, assembly and linking, always in that order. The first three
|
|
stages apply to an individual source file, and end by producing an
|
|
object file; linking combines all the object files (those newly
|
|
compiled, and those specified as input) into an executable file.
|
|
</P><P>
|
|
|
|
<A NAME="IDX15"></A>
|
|
For any given input file, the file name suffix determines what kind of
|
|
compilation is done:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE><VAR>file</VAR>.c</CODE>
|
|
<DD>C source code which must be preprocessed.
|
|
<P>
|
|
|
|
<DT><CODE><VAR>file</VAR>.i</CODE>
|
|
<DD>C source code which should not be preprocessed.
|
|
<P>
|
|
|
|
<DT><CODE><VAR>file</VAR>.ii</CODE>
|
|
<DD>C++ source code which should not be preprocessed.
|
|
<P>
|
|
|
|
<DT><CODE><VAR>file</VAR>.m</CODE>
|
|
<DD>Objective-C source code. Note that you must link with the library
|
|
<TT>`libobjc.a'</TT> to make an Objective-C program work.
|
|
<P>
|
|
|
|
<DT><CODE><VAR>file</VAR>.h</CODE>
|
|
<DD>C header file (not to be compiled or linked).
|
|
<P>
|
|
|
|
<DT><CODE><VAR>file</VAR>.cc</CODE>
|
|
<DD><DT><CODE><VAR>file</VAR>.cxx</CODE>
|
|
<DD><DT><CODE><VAR>file</VAR>.cpp</CODE>
|
|
<DD><DT><CODE><VAR>file</VAR>.C</CODE>
|
|
<DD>C++ source code which must be preprocessed. Note that in <SAMP>`.cxx'</SAMP>,
|
|
the last two letters must both be literally <SAMP>`x'</SAMP>. Likewise,
|
|
<SAMP>`.C'</SAMP> refers to a literal capital C.
|
|
<P>
|
|
|
|
<DT><CODE><VAR>file</VAR>.s</CODE>
|
|
<DD>Assembler code.
|
|
<P>
|
|
|
|
<DT><CODE><VAR>file</VAR>.S</CODE>
|
|
<DD>Assembler code which must be preprocessed.
|
|
<P>
|
|
|
|
<DT><CODE><VAR>other</VAR></CODE>
|
|
<DD>An object file to be fed straight into linking.
|
|
Any file name with no recognized suffix is treated this way.
|
|
</DL>
|
|
<P>
|
|
|
|
You can specify the input language explicitly with the <SAMP>`-x'</SAMP> option:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-x <VAR>language</VAR></CODE>
|
|
<DD>Specify explicitly the <VAR>language</VAR> for the following input files
|
|
(rather than letting the compiler choose a default based on the file
|
|
name suffix). This option applies to all following input files until
|
|
the next <SAMP>`-x'</SAMP> option. Possible values for <VAR>language</VAR> are:
|
|
<TABLE><tr><td> </td><td class=example><pre>c objective-c c++
|
|
c-header cpp-output c++-cpp-output
|
|
assembler assembler-with-cpp
|
|
</pre></td></tr></table><P>
|
|
|
|
<DT><CODE>-x none</CODE>
|
|
<DD>Turn off any specification of a language, so that subsequent files are
|
|
handled according to their file name suffixes (as they are if <SAMP>`-x'</SAMP>
|
|
has not been used at all).
|
|
</DL>
|
|
<P>
|
|
|
|
If you only want some of the stages of compilation, you can use
|
|
<SAMP>`-x'</SAMP> (or filename suffixes) to tell <CODE>gcc</CODE> where to start, and
|
|
one of the options <SAMP>`-c'</SAMP>, <SAMP>`-S'</SAMP>, or <SAMP>`-E'</SAMP> to say where
|
|
<CODE>gcc</CODE> is to stop. Note that some combinations (for example,
|
|
<SAMP>`-x cpp-output -E'</SAMP> instruct <CODE>gcc</CODE> to do nothing at all.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-c</CODE>
|
|
<DD>Compile or assemble the source files, but do not link. The linking
|
|
stage simply is not done. The ultimate output is in the form of an
|
|
object file for each source file.
|
|
<P>
|
|
|
|
By default, the object file name for a source file is made by replacing
|
|
the suffix <SAMP>`.c'</SAMP>, <SAMP>`.i'</SAMP>, <SAMP>`.s'</SAMP>, etc., with <SAMP>`.o'</SAMP>.
|
|
</P><P>
|
|
|
|
Unrecognized input files, not requiring compilation or assembly, are
|
|
ignored.
|
|
</P><P>
|
|
|
|
<DT><CODE>-S</CODE>
|
|
<DD>Stop after the stage of compilation proper; do not assemble. The output
|
|
is in the form of an assembler code file for each non-assembler input
|
|
file specified.
|
|
<P>
|
|
|
|
By default, the assembler file name for a source file is made by
|
|
replacing the suffix <SAMP>`.c'</SAMP>, <SAMP>`.i'</SAMP>, etc., with <SAMP>`.s'</SAMP>.
|
|
</P><P>
|
|
|
|
Input files that don't require compilation are ignored.
|
|
</P><P>
|
|
|
|
<DT><CODE>-E</CODE>
|
|
<DD>Stop after the preprocessing stage; do not run the compiler proper. The
|
|
output is in the form of preprocessed source code, which is sent to the
|
|
standard output.
|
|
<P>
|
|
|
|
Input files which don't require preprocessing are ignored.
|
|
</P><P>
|
|
|
|
<A NAME="IDX16"></A>
|
|
<DT><CODE>-o <VAR>file</VAR></CODE>
|
|
<DD>Place output in file <VAR>file</VAR>. This applies regardless to whatever
|
|
sort of output is being produced, whether it be an executable file,
|
|
an object file, an assembler file or preprocessed C code.
|
|
<P>
|
|
|
|
Since only one output file can be specified, it does not make sense to
|
|
use <SAMP>`-o'</SAMP> when compiling more than one input file, unless you are
|
|
producing an executable file as output.
|
|
</P><P>
|
|
|
|
If <SAMP>`-o'</SAMP> is not specified, the default is to put an executable file
|
|
in <TT>`a.out'</TT>, the object file for <TT>`<VAR>source</VAR>.<VAR>suffix</VAR>'</TT> in
|
|
<TT>`<VAR>source</VAR>.o'</TT>, its assembler file in <TT>`<VAR>source</VAR>.s'</TT>, and
|
|
all preprocessed C source on standard output.</P><P>
|
|
|
|
<DT><CODE>-v</CODE>
|
|
<DD>Print (on standard error output) the commands executed to run the stages
|
|
of compilation. Also print the version number of the compiler driver
|
|
program and of the preprocessor and the compiler proper.
|
|
<P>
|
|
|
|
<DT><CODE>-pipe</CODE>
|
|
<DD>Use pipes rather than temporary files for communication between the
|
|
various stages of compilation. This fails to work on some systems where
|
|
the assembler is unable to read from a pipe; but the GNU assembler has
|
|
no trouble.
|
|
<P>
|
|
|
|
<DT><CODE>--help</CODE>
|
|
<DD>Print (on the standard output) a description of the command line options
|
|
understood by <CODE>gcc</CODE>. If the <CODE>-v</CODE> option is also specified
|
|
then <CODE>--help</CODE> will also be passed on to the various processes
|
|
invoked by <CODE>gcc</CODE>, so that they can display the command line options
|
|
they accept. If the <CODE>-W</CODE> option is also specified then command
|
|
line options which have no documentation associated with them will also
|
|
be displayed.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Invoking G++"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC5"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC4" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC4"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC6" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC6"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC6" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC6"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 2.3 Compiling C++ Programs </H2>
|
|
<!--docid::SEC5::-->
|
|
<P>
|
|
|
|
<A NAME="IDX17"></A>
|
|
<A NAME="IDX18"></A>
|
|
C++ source files conventionally use one of the suffixes <SAMP>`.C'</SAMP>,
|
|
<SAMP>`.cc'</SAMP>, <SAMP>`.cpp'</SAMP>, <SAMP>`.c++'</SAMP>, <SAMP>`.cp'</SAMP>, or <SAMP>`.cxx'</SAMP>;
|
|
preprocessed C++ files use the suffix <SAMP>`.ii'</SAMP>. GCC recognizes
|
|
files with these names and compiles them as C++ programs even if you
|
|
call the compiler the same way as for compiling C programs (usually with
|
|
the name <CODE>gcc</CODE>).
|
|
</P><P>
|
|
|
|
<A NAME="IDX19"></A>
|
|
<A NAME="IDX20"></A>
|
|
However, C++ programs often require class libraries as well as a
|
|
compiler that understands the C++ language--and under some
|
|
circumstances, you might want to compile programs from standard input,
|
|
or otherwise without a suffix that flags them as C++ programs.
|
|
<CODE>g++</CODE> is a program that calls GCC with the default language
|
|
set to C++, and automatically specifies linking against the C++
|
|
library. On many systems, the script <CODE>g++</CODE> is also
|
|
installed with the name <CODE>c++</CODE>.
|
|
</P><P>
|
|
|
|
<A NAME="IDX21"></A>
|
|
When you compile C++ programs, you may specify many of the same
|
|
command-line options that you use for compiling programs in any
|
|
language; or command-line options meaningful for C and related
|
|
languages; or options that are meaningful only for C++ programs.
|
|
See section <A HREF="gcc_2.html#SEC6" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC6">Options Controlling C Dialect</A>, for
|
|
explanations of options for languages related to C.
|
|
See section <A HREF="gcc_2.html#SEC7" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC7">Options Controlling C++ Dialect</A>, for
|
|
explanations of options that are meaningful only for C++ programs.
|
|
</P><P>
|
|
|
|
<A NAME="C Dialect Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC6"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC5" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC5"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC7" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC7"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC7" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC7"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 2.4 Options Controlling C Dialect </H2>
|
|
<!--docid::SEC6::-->
|
|
<P>
|
|
|
|
The following options control the dialect of C (or languages derived
|
|
from C, such as C++ and Objective C) that the compiler accepts:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<A NAME="IDX22"></A>
|
|
<DT><CODE>-ansi</CODE>
|
|
<DD>In C mode, support all ANSI standard C programs. In C++ mode,
|
|
remove GNU extensions that conflict with ANSI C++.
|
|
<P>
|
|
|
|
This turns off certain features of GCC that are incompatible with ANSI
|
|
C (when compiling C code), or of ANSI standard C++ (when compiling C++ code),
|
|
such as the <CODE>asm</CODE> and <CODE>typeof</CODE> keywords, and
|
|
predefined macros such as <CODE>unix</CODE> and <CODE>vax</CODE> that identify the
|
|
type of system you are using. It also enables the undesirable and
|
|
rarely used ANSI trigraph feature. For the C compiler,
|
|
it disables recognition of C++ style <SAMP>`//'</SAMP> comments as well as
|
|
the <CODE>inline</CODE> keyword. For the C++ compiler,
|
|
<SAMP>`-foperator-names'</SAMP> is enabled as well.
|
|
</P><P>
|
|
|
|
The alternate keywords <CODE>__asm__</CODE>, <CODE>__extension__</CODE>,
|
|
<CODE>__inline__</CODE> and <CODE>__typeof__</CODE> continue to work despite
|
|
<SAMP>`-ansi'</SAMP>. You would not want to use them in an ANSI C program, of
|
|
course, but it is useful to put them in header files that might be included
|
|
in compilations done with <SAMP>`-ansi'</SAMP>. Alternate predefined macros
|
|
such as <CODE>__unix__</CODE> and <CODE>__vax__</CODE> are also available, with or
|
|
without <SAMP>`-ansi'</SAMP>.
|
|
</P><P>
|
|
|
|
The <SAMP>`-ansi'</SAMP> option does not cause non-ANSI programs to be
|
|
rejected gratuitously. For that, <SAMP>`-pedantic'</SAMP> is required in
|
|
addition to <SAMP>`-ansi'</SAMP>. See section <A HREF="gcc_2.html#SEC8" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC8">2.6 Options to Request or Suppress Warnings</A>.
|
|
</P><P>
|
|
|
|
The macro <CODE>__STRICT_ANSI__</CODE> is predefined when the <SAMP>`-ansi'</SAMP>
|
|
option is used. Some header files may notice this macro and refrain
|
|
from declaring certain functions or defining certain macros that the
|
|
ANSI standard doesn't call for; this is to avoid interfering with any
|
|
programs that might use these names for other things.
|
|
</P><P>
|
|
|
|
The functions <CODE>alloca</CODE>, <CODE>abort</CODE>, <CODE>exit</CODE>, and
|
|
<CODE>_exit</CODE> are not builtin functions when <SAMP>`-ansi'</SAMP> is used.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fstd=</CODE>
|
|
<DD>Determine the language standard. A value for this option must be provided;
|
|
possible values are
|
|
<P>
|
|
|
|
<UL>
|
|
<LI>iso9899:1990
|
|
Same as -ansi
|
|
<P>
|
|
|
|
<LI>iso9899:199409
|
|
ISO C as modified in amend. 1
|
|
<P>
|
|
|
|
<LI>iso9899:199x
|
|
ISO C 9x
|
|
<P>
|
|
|
|
<LI>c89
|
|
same as -std=iso9899:1990
|
|
<P>
|
|
|
|
<LI>c9x
|
|
same as -std=iso9899:199x
|
|
<P>
|
|
|
|
<LI>gnu89
|
|
default, iso9899:1990 + gnu extensions
|
|
<P>
|
|
|
|
<LI>gnu9x
|
|
iso9899:199x + gnu extensions
|
|
</UL>
|
|
<P>
|
|
|
|
Even when this option is not specified, you can still use some of the
|
|
features of newer standards in so far as they do not conflict with
|
|
previous C standards. For example, you may use <CODE>__restrict__</CODE> even
|
|
when -fstd=c9x is not specified.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fno-asm</CODE>
|
|
<DD>Do not recognize <CODE>asm</CODE>, <CODE>inline</CODE> or <CODE>typeof</CODE> as a
|
|
keyword, so that code can use these words as identifiers. You can use
|
|
the keywords <CODE>__asm__</CODE>, <CODE>__inline__</CODE> and <CODE>__typeof__</CODE>
|
|
instead. <SAMP>`-ansi'</SAMP> implies <SAMP>`-fno-asm'</SAMP>.
|
|
<P>
|
|
|
|
In C++, this switch only affects the <CODE>typeof</CODE> keyword, since
|
|
<CODE>asm</CODE> and <CODE>inline</CODE> are standard keywords. You may want to
|
|
use the <SAMP>`-fno-gnu-keywords'</SAMP> flag instead, as it also disables the
|
|
other, C++-specific, extension keywords such as <CODE>headof</CODE>.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fno-builtin</CODE>
|
|
<DD><A NAME="IDX23"></A>
|
|
<A NAME="IDX24"></A>
|
|
<A NAME="IDX25"></A>
|
|
<A NAME="IDX26"></A>
|
|
<A NAME="IDX27"></A>
|
|
<A NAME="IDX28"></A>
|
|
<A NAME="IDX29"></A>
|
|
<A NAME="IDX30"></A>
|
|
<A NAME="IDX31"></A>
|
|
<A NAME="IDX32"></A>
|
|
<A NAME="IDX33"></A>
|
|
<A NAME="IDX34"></A>
|
|
<A NAME="IDX35"></A>
|
|
<A NAME="IDX36"></A>
|
|
<A NAME="IDX37"></A>
|
|
<A NAME="IDX38"></A>
|
|
Don't recognize builtin functions that do not begin with <SAMP>`__builtin_'</SAMP>
|
|
as prefix. Currently, the functions affected include <CODE>abort</CODE>,
|
|
<CODE>abs</CODE>, <CODE>alloca</CODE>, <CODE>cos</CODE>, <CODE>exit</CODE>, <CODE>fabs</CODE>,
|
|
<CODE>ffs</CODE>, <CODE>labs</CODE>, <CODE>memcmp</CODE>, <CODE>memcpy</CODE>, <CODE>sin</CODE>,
|
|
<CODE>sqrt</CODE>, <CODE>strcmp</CODE>, <CODE>strcpy</CODE>, and <CODE>strlen</CODE>.
|
|
<P>
|
|
|
|
GCC normally generates special code to handle certain builtin functions
|
|
more efficiently; for instance, calls to <CODE>alloca</CODE> may become single
|
|
instructions that adjust the stack directly, and calls to <CODE>memcpy</CODE>
|
|
may become inline copy loops. The resulting code is often both smaller
|
|
and faster, but since the function calls no longer appear as such, you
|
|
cannot set a breakpoint on those calls, nor can you change the behavior
|
|
of the functions by linking with a different library.
|
|
</P><P>
|
|
|
|
The <SAMP>`-ansi'</SAMP> option prevents <CODE>alloca</CODE> and <CODE>ffs</CODE> from being
|
|
builtin functions, since these functions do not have an ANSI standard
|
|
meaning.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fhosted</CODE>
|
|
<DD><A NAME="IDX39"></A>
|
|
<P>
|
|
|
|
Assert that compilation takes place in a hosted environment. This implies
|
|
<SAMP>`-fbuiltin'</SAMP>. A hosted environment is one in which the
|
|
entire standard library is available, and in which <CODE>main</CODE> has a return
|
|
type of <CODE>int</CODE>. Examples are nearly everything except a kernel.
|
|
This is equivalent to <SAMP>`-fno-freestanding'</SAMP>.
|
|
</P><P>
|
|
|
|
<DT><CODE>-ffreestanding</CODE>
|
|
<DD><A NAME="IDX40"></A>
|
|
<P>
|
|
|
|
Assert that compilation takes place in a freestanding environment. This
|
|
implies <SAMP>`-fno-builtin'</SAMP>. A freestanding environment
|
|
is one in which the standard library may not exist, and program startup may
|
|
not necessarily be at <CODE>main</CODE>. The most obvious example is an OS kernel.
|
|
This is equivalent to <SAMP>`-fno-hosted'</SAMP>.
|
|
</P><P>
|
|
|
|
<DT><CODE>-trigraphs</CODE>
|
|
<DD>Support ANSI C trigraphs. You don't want to know about this
|
|
brain-damage. The <SAMP>`-ansi'</SAMP> option implies <SAMP>`-trigraphs'</SAMP>.
|
|
<P>
|
|
|
|
<A NAME="IDX41"></A>
|
|
<A NAME="IDX42"></A>
|
|
<DT><CODE>-traditional</CODE>
|
|
<DD>Attempt to support some aspects of traditional C compilers.
|
|
Specifically:
|
|
<P>
|
|
|
|
<UL>
|
|
<LI>
|
|
All <CODE>extern</CODE> declarations take effect globally even if they
|
|
are written inside of a function definition. This includes implicit
|
|
declarations of functions.
|
|
<P>
|
|
|
|
<LI>
|
|
The newer keywords <CODE>typeof</CODE>, <CODE>inline</CODE>, <CODE>signed</CODE>, <CODE>const</CODE>
|
|
and <CODE>volatile</CODE> are not recognized. (You can still use the
|
|
alternative keywords such as <CODE>__typeof__</CODE>, <CODE>__inline__</CODE>, and
|
|
so on.)
|
|
<P>
|
|
|
|
<LI>
|
|
Comparisons between pointers and integers are always allowed.
|
|
<P>
|
|
|
|
<LI>
|
|
Integer types <CODE>unsigned short</CODE> and <CODE>unsigned char</CODE> promote
|
|
to <CODE>unsigned int</CODE>.
|
|
<P>
|
|
|
|
<LI>
|
|
Out-of-range floating point literals are not an error.
|
|
<P>
|
|
|
|
<LI>
|
|
Certain constructs which ANSI regards as a single invalid preprocessing
|
|
number, such as <SAMP>`0xe-0xd'</SAMP>, are treated as expressions instead.
|
|
<P>
|
|
|
|
<LI>
|
|
String "constants" are not necessarily constant; they are stored in
|
|
writable space, and identical looking constants are allocated
|
|
separately. (This is the same as the effect of
|
|
<SAMP>`-fwritable-strings'</SAMP>.)
|
|
<P>
|
|
|
|
<A NAME="IDX43"></A>
|
|
<LI>
|
|
All automatic variables not declared <CODE>register</CODE> are preserved by
|
|
<CODE>longjmp</CODE>. Ordinarily, GNU C follows ANSI C: automatic variables
|
|
not declared <CODE>volatile</CODE> may be clobbered.
|
|
<P>
|
|
|
|
<LI>
|
|
<A NAME="IDX44"></A>
|
|
<A NAME="IDX45"></A>
|
|
<A NAME="IDX46"></A>
|
|
The character escape sequences <SAMP>`\x'</SAMP> and <SAMP>`\a'</SAMP> evaluate as the
|
|
literal characters <SAMP>`x'</SAMP> and <SAMP>`a'</SAMP> respectively. Without
|
|
<SAMP>`-traditional'</SAMP>, <SAMP>`\x'</SAMP> is a prefix for the hexadecimal
|
|
representation of a character, and <SAMP>`\a'</SAMP> produces a bell.
|
|
</UL>
|
|
<P>
|
|
|
|
You may wish to use <SAMP>`-fno-builtin'</SAMP> as well as <SAMP>`-traditional'</SAMP>
|
|
if your program uses names that are normally GNU C builtin functions for
|
|
other purposes of its own.
|
|
</P><P>
|
|
|
|
You cannot use <SAMP>`-traditional'</SAMP> if you include any header files that
|
|
rely on ANSI C features. Some vendors are starting to ship systems with
|
|
ANSI C header files and you cannot use <SAMP>`-traditional'</SAMP> on such
|
|
systems to compile files that include any system headers.
|
|
</P><P>
|
|
|
|
The <SAMP>`-traditional'</SAMP> option also enables <SAMP>`-traditional-cpp'</SAMP>,
|
|
which is described next.
|
|
</P><P>
|
|
|
|
<DT><CODE>-traditional-cpp</CODE>
|
|
<DD>Attempt to support some aspects of traditional C preprocessors.
|
|
Specifically:
|
|
<P>
|
|
|
|
<UL>
|
|
<LI>
|
|
Comments convert to nothing at all, rather than to a space. This allows
|
|
traditional token concatenation.
|
|
<P>
|
|
|
|
<LI>
|
|
In a preprocessing directive, the <SAMP>`#'</SAMP> symbol must appear as the first
|
|
character of a line.
|
|
<P>
|
|
|
|
<LI>
|
|
Macro arguments are recognized within string constants in a macro
|
|
definition (and their values are stringified, though without additional
|
|
quote marks, when they appear in such a context). The preprocessor
|
|
always considers a string constant to end at a newline.
|
|
<P>
|
|
|
|
<LI>
|
|
<A NAME="IDX47"></A>
|
|
The predefined macro <CODE>__STDC__</CODE> is not defined when you use
|
|
<SAMP>`-traditional'</SAMP>, but <CODE>__GNUC__</CODE> is (since the GNU extensions
|
|
which <CODE>__GNUC__</CODE> indicates are not affected by
|
|
<SAMP>`-traditional'</SAMP>). If you need to write header files that work
|
|
differently depending on whether <SAMP>`-traditional'</SAMP> is in use, by
|
|
testing both of these predefined macros you can distinguish four
|
|
situations: GNU C, traditional GNU C, other ANSI C compilers, and other
|
|
old C compilers. The predefined macro <CODE>__STDC_VERSION__</CODE> is also
|
|
not defined when you use <SAMP>`-traditional'</SAMP>. See section `Standard Predefined Macros' in <CITE>The C Preprocessor</CITE>,
|
|
for more discussion of these and other predefined macros.
|
|
<P>
|
|
|
|
<LI>
|
|
<A NAME="IDX48"></A>
|
|
<A NAME="IDX49"></A>
|
|
The preprocessor considers a string constant to end at a newline (unless
|
|
the newline is escaped with <SAMP>`\'</SAMP>). (Without <SAMP>`-traditional'</SAMP>,
|
|
string constants can contain the newline character as typed.)
|
|
</UL>
|
|
<P>
|
|
|
|
<DT><CODE>-fcond-mismatch</CODE>
|
|
<DD>Allow conditional expressions with mismatched types in the second and
|
|
third arguments. The value of such an expression is void.
|
|
<P>
|
|
|
|
<DT><CODE>-funsigned-char</CODE>
|
|
<DD>Let the type <CODE>char</CODE> be unsigned, like <CODE>unsigned char</CODE>.
|
|
<P>
|
|
|
|
Each kind of machine has a default for what <CODE>char</CODE> should
|
|
be. It is either like <CODE>unsigned char</CODE> by default or like
|
|
<CODE>signed char</CODE> by default.
|
|
</P><P>
|
|
|
|
Ideally, a portable program should always use <CODE>signed char</CODE> or
|
|
<CODE>unsigned char</CODE> when it depends on the signedness of an object.
|
|
But many programs have been written to use plain <CODE>char</CODE> and
|
|
expect it to be signed, or expect it to be unsigned, depending on the
|
|
machines they were written for. This option, and its inverse, let you
|
|
make such a program work with the opposite default.
|
|
</P><P>
|
|
|
|
The type <CODE>char</CODE> is always a distinct type from each of
|
|
<CODE>signed char</CODE> or <CODE>unsigned char</CODE>, even though its behavior
|
|
is always just like one of those two.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fsigned-char</CODE>
|
|
<DD>Let the type <CODE>char</CODE> be signed, like <CODE>signed char</CODE>.
|
|
<P>
|
|
|
|
Note that this is equivalent to <SAMP>`-fno-unsigned-char'</SAMP>, which is
|
|
the negative form of <SAMP>`-funsigned-char'</SAMP>. Likewise, the option
|
|
<SAMP>`-fno-signed-char'</SAMP> is equivalent to <SAMP>`-funsigned-char'</SAMP>.
|
|
</P><P>
|
|
|
|
You may wish to use <SAMP>`-fno-builtin'</SAMP> as well as <SAMP>`-traditional'</SAMP>
|
|
if your program uses names that are normally GNU C builtin functions for
|
|
other purposes of its own.
|
|
</P><P>
|
|
|
|
You cannot use <SAMP>`-traditional'</SAMP> if you include any header files that
|
|
rely on ANSI C features. Some vendors are starting to ship systems with
|
|
ANSI C header files and you cannot use <SAMP>`-traditional'</SAMP> on such
|
|
systems to compile files that include any system headers.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fsigned-bitfields</CODE>
|
|
<DD><DT><CODE>-funsigned-bitfields</CODE>
|
|
<DD><DT><CODE>-fno-signed-bitfields</CODE>
|
|
<DD><DT><CODE>-fno-unsigned-bitfields</CODE>
|
|
<DD>These options control whether a bitfield is signed or unsigned, when the
|
|
declaration does not use either <CODE>signed</CODE> or <CODE>unsigned</CODE>. By
|
|
default, such a bitfield is signed, because this is consistent: the
|
|
basic integer types such as <CODE>int</CODE> are signed types.
|
|
<P>
|
|
|
|
However, when <SAMP>`-traditional'</SAMP> is used, bitfields are all unsigned
|
|
no matter what.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fwritable-strings</CODE>
|
|
<DD>Store string constants in the writable data segment and don't uniquize
|
|
them. This is for compatibility with old programs which assume they can
|
|
write into string constants. The option <SAMP>`-traditional'</SAMP> also has
|
|
this effect.
|
|
<P>
|
|
|
|
Writing into string constants is a very bad idea; "constants" should
|
|
be constant.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fallow-single-precision</CODE>
|
|
<DD>Do not promote single precision math operations to double precision,
|
|
even when compiling with <SAMP>`-traditional'</SAMP>.
|
|
<P>
|
|
|
|
Traditional K&R C promotes all floating point operations to double
|
|
precision, regardless of the sizes of the operands. On the
|
|
architecture for which you are compiling, single precision may be faster
|
|
than double precision. If you must use <SAMP>`-traditional'</SAMP>, but want
|
|
to use single precision operations when the operands are single
|
|
precision, use this option. This option has no effect when compiling
|
|
with ANSI or GNU C conventions (the default).
|
|
</P><P>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="C++ Dialect Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC7"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC6" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC6"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC8" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC8"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC8" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC8"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 2.5 Options Controlling C++ Dialect </H2>
|
|
<!--docid::SEC7::-->
|
|
<P>
|
|
|
|
<A NAME="IDX50"></A>
|
|
<A NAME="IDX51"></A>
|
|
<A NAME="IDX52"></A>
|
|
This section describes the command-line options that are only meaningful
|
|
for C++ programs; but you can also use most of the GNU compiler options
|
|
regardless of what language your program is in. For example, you
|
|
might compile a file <CODE>firstClass.C</CODE> like this:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=example><pre>g++ -g -frepo -O -c firstClass.C
|
|
</pre></td></tr></table></P><P>
|
|
|
|
In this example, only <SAMP>`-frepo'</SAMP> is an option meant
|
|
only for C++ programs; you can use the other options with any
|
|
language supported by GCC.
|
|
</P><P>
|
|
|
|
Here is a list of options that are <EM>only</EM> for compiling C++ programs:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-fno-access-control</CODE>
|
|
<DD>Turn off all access checking. This switch is mainly useful for working
|
|
around bugs in the access control code.
|
|
<P>
|
|
|
|
<DT><CODE>-fcheck-new</CODE>
|
|
<DD>Check that the pointer returned by <CODE>operator new</CODE> is non-null
|
|
before attempting to modify the storage allocated. The current Working
|
|
Paper requires that <CODE>operator new</CODE> never return a null pointer, so
|
|
this check is normally unnecessary.
|
|
<P>
|
|
|
|
An alternative to using this option is to specify that your
|
|
<CODE>operator new</CODE> does not throw any exceptions; if you declare it
|
|
<SAMP>`throw()'</SAMP>, g++ will check the return value. See also <SAMP>`new
|
|
(nothrow)'</SAMP>.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fconserve-space</CODE>
|
|
<DD>Put uninitialized or runtime-initialized global variables into the
|
|
common segment, as C does. This saves space in the executable at the
|
|
cost of not diagnosing duplicate definitions. If you compile with this
|
|
flag and your program mysteriously crashes after <CODE>main()</CODE> has
|
|
completed, you may have an object that is being destroyed twice because
|
|
two definitions were merged.
|
|
<P>
|
|
|
|
This option is no longer useful on most targets, now that support has
|
|
been added for putting variables into BSS without making them common.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fdollars-in-identifiers</CODE>
|
|
<DD>Accept <SAMP>`$'</SAMP> in identifiers. You can also explicitly prohibit use of
|
|
<SAMP>`$'</SAMP> with the option <SAMP>`-fno-dollars-in-identifiers'</SAMP>. (GNU C allows
|
|
<SAMP>`$'</SAMP> by default on most target systems, but there are a few exceptions.)
|
|
Traditional C allowed the character <SAMP>`$'</SAMP> to form part of
|
|
identifiers. However, ANSI C and C++ forbid <SAMP>`$'</SAMP> in identifiers.
|
|
<P>
|
|
|
|
<DT><CODE>-fno-elide-constructors</CODE>
|
|
<DD>The C++ standard allows an implementation to omit creating a temporary
|
|
which is only used to initialize another object of the same type.
|
|
Specifying this option disables that optimization, and forces g++ to
|
|
call the copy constructor in all cases.
|
|
<P>
|
|
|
|
<DT><CODE>-fexternal-templates</CODE>
|
|
<DD>Cause template instantiations to obey <SAMP>`#pragma interface'</SAMP> and
|
|
<SAMP>`implementation'</SAMP>; template instances are emitted or not according
|
|
to the location of the template definition. See section <A HREF="gcc_5.html#SEC110" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_5.html#SEC110">5.5 Where's the Template?</A>, for more information.
|
|
<P>
|
|
|
|
This option is deprecated.
|
|
</P><P>
|
|
|
|
<DT><CODE>-falt-external-templates</CODE>
|
|
<DD>Similar to -fexternal-templates, but template instances are emitted or
|
|
not according to the place where they are first instantiated.
|
|
See section <A HREF="gcc_5.html#SEC110" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_5.html#SEC110">5.5 Where's the Template?</A>, for more information.
|
|
<P>
|
|
|
|
This option is deprecated.
|
|
</P><P>
|
|
|
|
<DT><CODE>-ffor-scope</CODE>
|
|
<DD><DT><CODE>-fno-for-scope</CODE>
|
|
<DD>If -ffor-scope is specified, the scope of variables declared in
|
|
a <I>for-init-statement</I> is limited to the <SAMP>`for'</SAMP> loop itself,
|
|
as specified by the draft C++ standard.
|
|
If -fno-for-scope is specified, the scope of variables declared in
|
|
a <I>for-init-statement</I> extends to the end of the enclosing scope,
|
|
as was the case in old versions of gcc, and other (traditional)
|
|
implementations of C++.
|
|
<P>
|
|
|
|
The default if neither flag is given to follow the standard,
|
|
but to allow and give a warning for old-style code that would
|
|
otherwise be invalid, or have different behavior.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fno-gnu-keywords</CODE>
|
|
<DD>Do not recognize <CODE>classof</CODE>, <CODE>headof</CODE>, <CODE>signature</CODE>,
|
|
<CODE>sigof</CODE> or <CODE>typeof</CODE> as a keyword, so that code can use these
|
|
words as identifiers. You can use the keywords <CODE>__classof__</CODE>,
|
|
<CODE>__headof__</CODE>, <CODE>__signature__</CODE>, <CODE>__sigof__</CODE>, and
|
|
<CODE>__typeof__</CODE> instead. <SAMP>`-ansi'</SAMP> implies
|
|
<SAMP>`-fno-gnu-keywords'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-fguiding-decls</CODE>
|
|
<DD>Treat a function declaration with the same type as a potential function
|
|
template instantiation as though it declares that instantiation, not a
|
|
normal function. If a definition is given for the function later in the
|
|
translation unit (or another translation unit if the target supports
|
|
weak symbols), that definition will be used; otherwise the template will
|
|
be instantiated. This behavior reflects the C++ language prior to
|
|
September 1996, when guiding declarations were removed.
|
|
<P>
|
|
|
|
This option implies <SAMP>`-fname-mangling-version-0'</SAMP>, and will not work
|
|
with other name mangling versions. Like all options that change the
|
|
ABI, all C++ code, <EM>including libgcc.a</EM> must be built with the same
|
|
setting of this option.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fhandle-signatures</CODE>
|
|
<DD>Recognize the <CODE>signature</CODE> and <CODE>sigof</CODE> keywords for specifying
|
|
abstract types. The default (<SAMP>`-fno-handle-signatures'</SAMP>) is not to
|
|
recognize them. See section <A HREF="gcc_5.html#SEC112" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_5.html#SEC112">Type Abstraction using Signatures</A>.
|
|
<P>
|
|
|
|
<DT><CODE>-fhonor-std</CODE>
|
|
<DD>Treat the <CODE>namespace std</CODE> as a namespace, instead of ignoring
|
|
it. For compatibility with earlier versions of g++, the compiler will,
|
|
by default, ignore <CODE>namespace-declarations</CODE>,
|
|
<CODE>using-declarations</CODE>, <CODE>using-directives</CODE>, and
|
|
<CODE>namespace-names</CODE>, if they involve <CODE>std</CODE>.
|
|
<P>
|
|
|
|
<DT><CODE>-fhuge-objects</CODE>
|
|
<DD>Support virtual function calls for objects that exceed the size
|
|
representable by a <SAMP>`short int'</SAMP>. Users should not use this flag by
|
|
default; if you need to use it, the compiler will tell you so.
|
|
<P>
|
|
|
|
This flag is not useful when compiling with -fvtable-thunks.
|
|
</P><P>
|
|
|
|
Like all options that change the ABI, all C++ code, <EM>including
|
|
libgcc</EM> must be built with the same setting of this option.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fno-implicit-templates</CODE>
|
|
<DD>Never emit code for non-inline templates which are instantiated
|
|
implicitly (i.e. by use); only emit code for explicit instantiations.
|
|
See section <A HREF="gcc_5.html#SEC110" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_5.html#SEC110">5.5 Where's the Template?</A>, for more information.
|
|
<P>
|
|
|
|
<DT><CODE>-fno-implicit-inline-templates</CODE>
|
|
<DD>Don't emit code for implicit instantiations of inline templates, either.
|
|
The default is to handle inlines differently so that compiles with and
|
|
without optimization will need the same set of explicit instantiations.
|
|
<P>
|
|
|
|
<DT><CODE>-finit-priority</CODE>
|
|
<DD>Support <SAMP>`__attribute__ ((init_priority (n)))'</SAMP> for controlling the
|
|
order of initialization of file-scope objects. On ELF targets, this
|
|
requires GNU ld 2.10 or later.
|
|
<P>
|
|
|
|
<DT><CODE>-fno-implement-inlines</CODE>
|
|
<DD>To save space, do not emit out-of-line copies of inline functions
|
|
controlled by <SAMP>`#pragma implementation'</SAMP>. This will cause linker
|
|
errors if these functions are not inlined everywhere they are called.
|
|
<P>
|
|
|
|
<DT><CODE>-fname-mangling-version-<VAR>n</VAR></CODE>
|
|
<DD>Control the way in which names are mangled. Version 0 is compatible
|
|
with versions of g++ before 2.8. Version 1 is the default. Version 1
|
|
will allow correct mangling of function templates. For example,
|
|
version 0 mangling does not mangle foo<int, double> and foo<int, char>
|
|
given this declaration:
|
|
<P>
|
|
|
|
<TABLE><tr><td> </td><td class=example><pre>template <class T, class U> void foo(T t);
|
|
</pre></td></tr></table></P><P>
|
|
|
|
Like all options that change the ABI, all C++ code, <EM>including
|
|
libgcc</EM> must be built with the same setting of this option.
|
|
</P><P>
|
|
|
|
<DT><CODE>-foperator-names</CODE>
|
|
<DD>Recognize the operator name keywords <CODE>and</CODE>, <CODE>bitand</CODE>,
|
|
<CODE>bitor</CODE>, <CODE>compl</CODE>, <CODE>not</CODE>, <CODE>or</CODE> and <CODE>xor</CODE> as
|
|
synonyms for the symbols they refer to. <SAMP>`-ansi'</SAMP> implies
|
|
<SAMP>`-foperator-names'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-fno-optional-diags</CODE>
|
|
<DD>Disable diagnostics that the standard says a compiler does not need to
|
|
issue. Currently, the only such diagnostic issued by g++ is the one for
|
|
a name having multiple meanings within a class.
|
|
<P>
|
|
|
|
<DT><CODE>-fpermissive</CODE>
|
|
<DD>Downgrade messages about nonconformant code from errors to warnings. By
|
|
default, g++ effectively sets <SAMP>`-pedantic-errors'</SAMP> without
|
|
<SAMP>`-pedantic'</SAMP>; this option reverses that. This behavior and this
|
|
option are superceded by <SAMP>`-pedantic'</SAMP>, which works as it does for GNU C.
|
|
<P>
|
|
|
|
<DT><CODE>-frepo</CODE>
|
|
<DD>Enable automatic template instantiation. This option also implies
|
|
<SAMP>`-fno-implicit-templates'</SAMP>. See section <A HREF="gcc_5.html#SEC110" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_5.html#SEC110">5.5 Where's the Template?</A>, for more
|
|
information.
|
|
<P>
|
|
|
|
<DT><CODE>-fno-rtti</CODE>
|
|
<DD>Disable generation of the information used by C++ runtime type
|
|
identification features (<SAMP>`dynamic_cast'</SAMP> and <SAMP>`typeid'</SAMP>). If you
|
|
don't use those parts of the language (or exception handling, which uses
|
|
<SAMP>`dynamic_cast'</SAMP> internally), you can save some space by using this
|
|
flag.
|
|
<P>
|
|
|
|
<DT><CODE>-fstrict-prototype</CODE>
|
|
<DD>Within an <SAMP>`extern "C"'</SAMP> linkage specification, treat a function
|
|
declaration with no arguments, such as <SAMP>`int foo ();'</SAMP>, as declaring
|
|
the function to take no arguments. Normally, such a declaration means
|
|
that the function <CODE>foo</CODE> can take any combination of arguments, as
|
|
in C. <SAMP>`-pedantic'</SAMP> implies <SAMP>`-fstrict-prototype'</SAMP> unless
|
|
overridden with <SAMP>`-fno-strict-prototype'</SAMP>.
|
|
<P>
|
|
|
|
Specifying this option will also suppress implicit declarations of
|
|
functions.
|
|
</P><P>
|
|
|
|
This flag no longer affects declarations with C++ linkage.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fsquangle</CODE>
|
|
<DD><DT><CODE>-fno-squangle</CODE>
|
|
<DD><SAMP>`-fsquangle'</SAMP> will enable a compressed form of name mangling for
|
|
identifiers. In particular, it helps to shorten very long names by recognizing
|
|
types and class names which occur more than once, replacing them with special
|
|
short ID codes. This option also requires any C++ libraries being used to
|
|
be compiled with this option as well. The compiler has this disabled (the
|
|
equivalent of <SAMP>`-fno-squangle'</SAMP>) by default.
|
|
<P>
|
|
|
|
Like all options that change the ABI, all C++ code, <EM>including
|
|
libgcc.a</EM> must be built with the same setting of this option.
|
|
</P><P>
|
|
|
|
<DT><CODE>-ftemplate-depth-<VAR>n</VAR></CODE>
|
|
<DD>Set the maximum instantiation depth for template classes to <VAR>n</VAR>.
|
|
A limit on the template instantiation depth is needed to detect
|
|
endless recursions during template class instantiation. ANSI/ISO C++
|
|
conforming programs must not rely on a maximum depth greater than 17.
|
|
<P>
|
|
|
|
<DT><CODE>-fthis-is-variable</CODE>
|
|
<DD>Permit assignment to <CODE>this</CODE>. The incorporation of user-defined
|
|
free store management into C++ has made assignment to <SAMP>`this'</SAMP> an
|
|
anachronism. Therefore, by default it is invalid to assign to
|
|
<CODE>this</CODE> within a class member function; that is, GNU C++ treats
|
|
<SAMP>`this'</SAMP> in a member function of class <CODE>X</CODE> as a non-lvalue of
|
|
type <SAMP>`X *'</SAMP>. However, for backwards compatibility, you can make it
|
|
valid with <SAMP>`-fthis-is-variable'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-fvtable-thunks=<VAR>thunks-version</VAR></CODE>
|
|
<DD>Use <SAMP>`thunks'</SAMP> to implement the virtual function dispatch table
|
|
(<SAMP>`vtable'</SAMP>). The traditional (cfront-style) approach to
|
|
implementing vtables was to store a pointer to the function and two
|
|
offsets for adjusting the <SAMP>`this'</SAMP> pointer at the call site. Newer
|
|
implementations store a single pointer to a <SAMP>`thunk'</SAMP> function which
|
|
does any necessary adjustment and then calls the target function.
|
|
<P>
|
|
|
|
The original implementation of thunks (version 1) had a bug regarding
|
|
virtual base classes; this bug is fixed with version 2 of the thunks
|
|
implementation. With setting the version to 2, compatibility to the
|
|
version 1 thunks is provided, at the cost of extra machine code. Version
|
|
3 does not include this compatibility.
|
|
</P><P>
|
|
|
|
This option also enables a heuristic for controlling emission of
|
|
vtables; if a class has any non-inline virtual functions, the vtable
|
|
will be emitted in the translation unit containing the first one of
|
|
those.
|
|
</P><P>
|
|
|
|
Like all options that change the ABI, all C++ code, <EM>including
|
|
libgcc.a</EM> must be built with the same setting of this option. Since
|
|
version 1 and version 2 are also incompatible (for classes with virtual
|
|
bases defining virtual functions), all code must also be compiled with
|
|
the same version.
|
|
</P><P>
|
|
|
|
In this version of gcc, there are no targets for which version 2 thunks
|
|
are the default. On all targets, not giving the option will use the
|
|
traditional implementation, and -fvtable-thunks will produce version 2
|
|
thunks.
|
|
</P><P>
|
|
|
|
<DT><CODE>-nostdinc++</CODE>
|
|
<DD>Do not search for header files in the standard directories specific to
|
|
C++, but do still search the other standard directories. (This option
|
|
is used when building the C++ library.)
|
|
</DL>
|
|
<P>
|
|
|
|
In addition, these optimization, warning, and code generation options
|
|
have meanings only for C++ programs:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-fno-default-inline</CODE>
|
|
<DD>Do not assume <SAMP>`inline'</SAMP> for functions defined inside a class scope.
|
|
See section <A HREF="gcc_2.html#SEC10" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC10">Options That Control Optimization</A>. Note that these
|
|
functions will have linkage like inline functions; they just won't be
|
|
inlined by default.
|
|
<P>
|
|
|
|
<DT><CODE>-Wctor-dtor-privacy (C++ only)</CODE>
|
|
<DD>Warn when a class seems unusable, because all the constructors or
|
|
destructors in a class are private and the class has no friends or
|
|
public static member functions.
|
|
<P>
|
|
|
|
<DT><CODE>-Wnon-virtual-dtor (C++ only)</CODE>
|
|
<DD>Warn when a class declares a non-virtual destructor that should probably
|
|
be virtual, because it looks like the class will be used polymorphically.
|
|
<P>
|
|
|
|
<DT><CODE>-Wreorder (C++ only)</CODE>
|
|
<DD><A NAME="IDX53"></A>
|
|
<A NAME="IDX54"></A>
|
|
Warn when the order of member initializers given in the code does not
|
|
match the order in which they must be executed. For instance:
|
|
<P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>struct A {
|
|
int i;
|
|
int j;
|
|
A(): j (0), i (1) { }
|
|
};
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
Here the compiler will warn that the member initializers for <SAMP>`i'</SAMP>
|
|
and <SAMP>`j'</SAMP> will be rearranged to match the declaration order of the
|
|
members.
|
|
</DL>
|
|
<P>
|
|
|
|
The following <SAMP>`-W<small>...</small>'</SAMP> options are not affected by <SAMP>`-Wall'</SAMP>.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-Weffc++ (C++ only)</CODE>
|
|
<DD>Warn about violations of various style guidelines from Scott Meyers'
|
|
<CITE>Effective C++</CITE> books. If you use this option, you should be aware
|
|
that the standard library headers do not obey all of these guidelines;
|
|
you can use <SAMP>`grep -v'</SAMP> to filter out those warnings.
|
|
<P>
|
|
|
|
<DT><CODE>-Wno-deprecated (C++ only)</CODE>
|
|
<DD>Do not warn about usage of deprecated features. See section <A HREF="gcc_4.html#SEC104" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_4.html#SEC104">4.40 Deprecated Features</A>.
|
|
<P>
|
|
|
|
<DT><CODE>-Wno-non-template-friend (C++ only)</CODE>
|
|
<DD>Disable warnings when non-templatized friend functions are declared
|
|
within a template. With the advent of explicit template specification
|
|
support in g++, if the name of the friend is an unqualified-id (ie,
|
|
<SAMP>`friend foo(int)'</SAMP>), the C++ language specification demands that the
|
|
friend declare or define an ordinary, nontemplate function. (Section
|
|
14.5.3). Before g++ implemented explicit specification, unqualified-ids
|
|
could be interpreted as a particular specialization of a templatized
|
|
function. Because this non-conforming behavior is no longer the default
|
|
behavior for g++, <SAMP>`-Wnon-template-friend'</SAMP> allows the compiler to
|
|
check existing code for potential trouble spots, and is on by default.
|
|
This new compiler behavior can also be turned off with the flag
|
|
<SAMP>`-fguiding-decls'</SAMP>, which activates the older, non-specification
|
|
compiler code, or with <SAMP>`-Wno-non-template-friend'</SAMP> which keeps the
|
|
conformant compiler code but disables the helpful warning.
|
|
<P>
|
|
|
|
<DT><CODE>-Wold-style-cast (C++ only)</CODE>
|
|
<DD>Warn if an old-style (C-style) cast is used within a C++ program. The
|
|
new-style casts (<SAMP>`static_cast'</SAMP>, <SAMP>`reinterpret_cast'</SAMP>, and
|
|
<SAMP>`const_cast'</SAMP>) are less vulnerable to unintended effects.
|
|
<P>
|
|
|
|
<DT><CODE>-Woverloaded-virtual (C++ only)</CODE>
|
|
<DD><A NAME="IDX55"></A>
|
|
<A NAME="IDX56"></A>
|
|
Warn when a derived class function declaration may be an error in
|
|
defining a virtual function. In a derived class, the
|
|
definitions of virtual functions must match the type signature of a
|
|
virtual function declared in the base class. With this option, the
|
|
compiler warns when you define a function with the same name as a
|
|
virtual function, but with a type signature that does not match any
|
|
declarations from the base class.
|
|
<P>
|
|
|
|
<DT><CODE>-Wno-pmf-conversions (C++ only)</CODE>
|
|
<DD>Disable the diagnostic for converting a bound pointer to member function
|
|
to a plain pointer.
|
|
<P>
|
|
|
|
<DT><CODE>-Wsign-promo (C++ only)</CODE>
|
|
<DD>Warn when overload resolution chooses a promotion from unsigned or
|
|
enumeral type to a signed type over a conversion to an unsigned type of
|
|
the same size. Previous versions of g++ would try to preserve
|
|
unsignedness, but the standard mandates the current behavior.
|
|
<P>
|
|
|
|
<DT><CODE>-Wsynth (C++ only)</CODE>
|
|
<DD><A NAME="IDX57"></A>
|
|
<A NAME="IDX58"></A>
|
|
Warn when g++'s synthesis behavior does not match that of cfront. For
|
|
instance:
|
|
<P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>struct A {
|
|
operator int ();
|
|
A& operator = (int);
|
|
};
|
|
|
|
main ()
|
|
{
|
|
A a,b;
|
|
a = b;
|
|
}
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
In this example, g++ will synthesize a default <SAMP>`A& operator =
|
|
(const A&);'</SAMP>, while cfront will use the user-defined <SAMP>`operator ='</SAMP>.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Warning Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC8"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC7" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC7"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC9" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC9"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC9" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC9"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 2.6 Options to Request or Suppress Warnings </H2>
|
|
<!--docid::SEC8::-->
|
|
<P>
|
|
|
|
Warnings are diagnostic messages that report constructions which
|
|
are not inherently erroneous but which are risky or suggest there
|
|
may have been an error.
|
|
</P><P>
|
|
|
|
You can request many specific warnings with options beginning <SAMP>`-W'</SAMP>,
|
|
for example <SAMP>`-Wimplicit'</SAMP> to request warnings on implicit
|
|
declarations. Each of these specific warning options also has a
|
|
negative form beginning <SAMP>`-Wno-'</SAMP> to turn off warnings;
|
|
for example, <SAMP>`-Wno-implicit'</SAMP>. This manual lists only one of the
|
|
two forms, whichever is not the default.
|
|
</P><P>
|
|
|
|
These options control the amount and kinds of warnings produced by GCC:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<A NAME="IDX59"></A>
|
|
<DT><CODE>-fsyntax-only</CODE>
|
|
<DD>Check the code for syntax errors, but don't do anything beyond that.
|
|
<P>
|
|
|
|
<DT><CODE>-pedantic</CODE>
|
|
<DD>Issue all the warnings demanded by strict ANSI C and ISO C++;
|
|
reject all programs that use forbidden extensions.
|
|
<P>
|
|
|
|
Valid ANSI C and ISO C++ programs should compile properly with or without
|
|
this option (though a rare few will require <SAMP>`-ansi'</SAMP>). However,
|
|
without this option, certain GNU extensions and traditional C and C++
|
|
features are supported as well. With this option, they are rejected.
|
|
</P><P>
|
|
|
|
<SAMP>`-pedantic'</SAMP> does not cause warning messages for use of the
|
|
alternate keywords whose names begin and end with <SAMP>`__'</SAMP>. Pedantic
|
|
warnings are also disabled in the expression that follows
|
|
<CODE>__extension__</CODE>. However, only system header files should use
|
|
these escape routes; application programs should avoid them.
|
|
See section <A HREF="gcc_4.html#SEC99" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_4.html#SEC99">4.35 Alternate Keywords</A>.
|
|
</P><P>
|
|
|
|
This option is not intended to be <I>useful</I>; it exists only to satisfy
|
|
pedants who would otherwise claim that GCC fails to support the ANSI
|
|
standard.
|
|
</P><P>
|
|
|
|
Some users try to use <SAMP>`-pedantic'</SAMP> to check programs for strict ANSI
|
|
C conformance. They soon find that it does not do quite what they want:
|
|
it finds some non-ANSI practices, but not all--only those for which
|
|
ANSI C <EM>requires</EM> a diagnostic.
|
|
</P><P>
|
|
|
|
A feature to report any failure to conform to ANSI C might be useful in
|
|
some instances, but would require considerable additional work and would
|
|
be quite different from <SAMP>`-pedantic'</SAMP>. We don't have plans to
|
|
support such a feature in the near future.
|
|
</P><P>
|
|
|
|
<DT><CODE>-pedantic-errors</CODE>
|
|
<DD>Like <SAMP>`-pedantic'</SAMP>, except that errors are produced rather than
|
|
warnings.
|
|
<P>
|
|
|
|
<DT><CODE>-w</CODE>
|
|
<DD>Inhibit all warning messages.
|
|
<P>
|
|
|
|
<DT><CODE>-Wno-import</CODE>
|
|
<DD>Inhibit warning messages about the use of <SAMP>`#import'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-Wchar-subscripts</CODE>
|
|
<DD>Warn if an array subscript has type <CODE>char</CODE>. This is a common cause
|
|
of error, as programmers often forget that this type is signed on some
|
|
machines.
|
|
<P>
|
|
|
|
<DT><CODE>-Wcomment</CODE>
|
|
<DD>Warn whenever a comment-start sequence <SAMP>`/*'</SAMP> appears in a <SAMP>`/*'</SAMP>
|
|
comment, or whenever a Backslash-Newline appears in a <SAMP>`//'</SAMP> comment.
|
|
<P>
|
|
|
|
<DT><CODE>-Wformat</CODE>
|
|
<DD>Check calls to <CODE>printf</CODE> and <CODE>scanf</CODE>, etc., to make sure that
|
|
the arguments supplied have types appropriate to the format string
|
|
specified.
|
|
<P>
|
|
|
|
<DT><CODE>-Wimplicit-int</CODE>
|
|
<DD>Warn when a declaration does not specify a type.
|
|
<P>
|
|
|
|
<DT><CODE>-Wimplicit-function-declaration</CODE>
|
|
<DD><DT><CODE>-Werror-implicit-function-declaration</CODE>
|
|
<DD>Give a warning (or error) whenever a function is used before being
|
|
declared.
|
|
<P>
|
|
|
|
<DT><CODE>-Wimplicit</CODE>
|
|
<DD>Same as <SAMP>`-Wimplicit-int'</SAMP> and <SAMP>`-Wimplicit-function-'</SAMP><BR>
|
|
<SAMP>`declaration'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-Wmain</CODE>
|
|
<DD>Warn if the type of <SAMP>`main'</SAMP> is suspicious. <SAMP>`main'</SAMP> should be a
|
|
function with external linkage, returning int, taking either zero
|
|
arguments, two, or three arguments of appropriate types.
|
|
<P>
|
|
|
|
<DT><CODE>-Wmultichar</CODE>
|
|
<DD>Warn if a multicharacter constant (<SAMP>`'FOOF''</SAMP>) is used. Usually they
|
|
indicate a typo in the user's code, as they have implementation-defined
|
|
values, and should not be used in portable code.
|
|
|
|
<DT><CODE>-Wparentheses</CODE>
|
|
<DD>Warn if parentheses are omitted in certain contexts, such
|
|
as when there is an assignment in a context where a truth value
|
|
is expected, or when operators are nested whose precedence people
|
|
often get confused about.
|
|
<P>
|
|
|
|
Also warn about constructions where there may be confusion to which
|
|
<CODE>if</CODE> statement an <CODE>else</CODE> branch belongs. Here is an example of
|
|
such a case:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>{
|
|
if (a)
|
|
if (b)
|
|
foo ();
|
|
else
|
|
bar ();
|
|
}
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
In C, every <CODE>else</CODE> branch belongs to the innermost possible <CODE>if</CODE>
|
|
statement, which in this example is <CODE>if (b)</CODE>. This is often not
|
|
what the programmer expected, as illustrated in the above example by
|
|
indentation the programmer chose. When there is the potential for this
|
|
confusion, GNU C will issue a warning when this flag is specified.
|
|
To eliminate the warning, add explicit braces around the innermost
|
|
<CODE>if</CODE> statement so there is no way the <CODE>else</CODE> could belong to
|
|
the enclosing <CODE>if</CODE>. The resulting code would look like this:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>{
|
|
if (a)
|
|
{
|
|
if (b)
|
|
foo ();
|
|
else
|
|
bar ();
|
|
}
|
|
}
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
<DT><CODE>-Wreturn-type</CODE>
|
|
<DD>Warn whenever a function is defined with a return-type that defaults
|
|
to <CODE>int</CODE>. Also warn about any <CODE>return</CODE> statement with no
|
|
return-value in a function whose return-type is not <CODE>void</CODE>.
|
|
<P>
|
|
|
|
<DT><CODE>-Wswitch</CODE>
|
|
<DD>Warn whenever a <CODE>switch</CODE> statement has an index of enumeral type
|
|
and lacks a <CODE>case</CODE> for one or more of the named codes of that
|
|
enumeration. (The presence of a <CODE>default</CODE> label prevents this
|
|
warning.) <CODE>case</CODE> labels outside the enumeration range also
|
|
provoke warnings when this option is used.
|
|
<P>
|
|
|
|
<DT><CODE>-Wtrigraphs</CODE>
|
|
<DD>Warn if any trigraphs are encountered (assuming they are enabled).
|
|
<P>
|
|
|
|
<DT><CODE>-Wunused</CODE>
|
|
<DD>Warn whenever a variable is unused aside from its declaration,
|
|
whenever a function is declared static but never defined, whenever a
|
|
label is declared but not used, and whenever a statement computes a
|
|
result that is explicitly not used.
|
|
<P>
|
|
|
|
In order to get a warning about an unused function parameter, you must
|
|
specify both <SAMP>`-W'</SAMP> and <SAMP>`-Wunused'</SAMP>.
|
|
</P><P>
|
|
|
|
To suppress this warning for an expression, simply cast it to void. For
|
|
unused variables, parameters and labels, use the <SAMP>`unused'</SAMP> attribute
|
|
(see section <A HREF="gcc_4.html#SEC90" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_4.html#SEC90">4.29 Specifying Attributes of Variables</A>).
|
|
</P><P>
|
|
|
|
<DT><CODE>-Wuninitialized</CODE>
|
|
<DD>An automatic variable is used without first being initialized.
|
|
<P>
|
|
|
|
These warnings are possible only in optimizing compilation,
|
|
because they require data flow information that is computed only
|
|
when optimizing. If you don't specify <SAMP>`-O'</SAMP>, you simply won't
|
|
get these warnings.
|
|
</P><P>
|
|
|
|
These warnings occur only for variables that are candidates for
|
|
register allocation. Therefore, they do not occur for a variable that
|
|
is declared <CODE>volatile</CODE>, or whose address is taken, or whose size
|
|
is other than 1, 2, 4 or 8 bytes. Also, they do not occur for
|
|
structures, unions or arrays, even when they are in registers.
|
|
</P><P>
|
|
|
|
Note that there may be no warning about a variable that is used only
|
|
to compute a value that itself is never used, because such
|
|
computations may be deleted by data flow analysis before the warnings
|
|
are printed.
|
|
</P><P>
|
|
|
|
These warnings are made optional because GCC is not smart
|
|
enough to see all the reasons why the code might be correct
|
|
despite appearing to have an error. Here is one example of how
|
|
this can happen:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>{
|
|
int x;
|
|
switch (y)
|
|
{
|
|
case 1: x = 1;
|
|
break;
|
|
case 2: x = 4;
|
|
break;
|
|
case 3: x = 5;
|
|
}
|
|
foo (x);
|
|
}
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
If the value of <CODE>y</CODE> is always 1, 2 or 3, then <CODE>x</CODE> is
|
|
always initialized, but GCC doesn't know this. Here is
|
|
another common case:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>{
|
|
int save_y;
|
|
if (change_y) save_y = y, y = new_y;
|
|
<small>...</small>
|
|
if (change_y) y = save_y;
|
|
}
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
This has no bug because <CODE>save_y</CODE> is used only if it is set.
|
|
</P><P>
|
|
|
|
Some spurious warnings can be avoided if you declare all the functions
|
|
you use that never return as <CODE>noreturn</CODE>. See section <A HREF="gcc_4.html#SEC84" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_4.html#SEC84">4.23 Declaring Attributes of Functions</A>.
|
|
</P><P>
|
|
|
|
<DT><CODE>-Wunknown-pragmas</CODE>
|
|
<DD><A NAME="IDX60"></A>
|
|
<A NAME="IDX61"></A>
|
|
<A NAME="IDX62"></A>
|
|
Warn when a #pragma directive is encountered which is not understood by
|
|
GCC. If this command line option is used, warnings will even be issued
|
|
for unknown pragmas in system header files. This is not the case if
|
|
the warnings were only enabled by the <SAMP>`-Wall'</SAMP> command line option.
|
|
<P>
|
|
|
|
<DT><CODE>-Wall</CODE>
|
|
<DD>All of the above <SAMP>`-W'</SAMP> options combined. This enables all the
|
|
warnings about constructions that some users consider questionable, and
|
|
that are easy to avoid (or modify to prevent the warning), even in
|
|
conjunction with macros.
|
|
</DL>
|
|
<P>
|
|
|
|
The following <SAMP>`-W<small>...</small>'</SAMP> options are not implied by <SAMP>`-Wall'</SAMP>.
|
|
Some of them warn about constructions that users generally do not
|
|
consider questionable, but which occasionally you might wish to check
|
|
for; others warn about constructions that are necessary or hard to avoid
|
|
in some cases, and there is no simple way to modify the code to suppress
|
|
the warning.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-W</CODE>
|
|
<DD>Print extra warning messages for these events:
|
|
<P>
|
|
|
|
<UL>
|
|
<A NAME="IDX63"></A>
|
|
<LI>
|
|
A nonvolatile automatic variable might be changed by a call to
|
|
<CODE>longjmp</CODE>. These warnings as well are possible only in
|
|
optimizing compilation.
|
|
<P>
|
|
|
|
The compiler sees only the calls to <CODE>setjmp</CODE>. It cannot know
|
|
where <CODE>longjmp</CODE> will be called; in fact, a signal handler could
|
|
call it at any point in the code. As a result, you may get a warning
|
|
even when there is in fact no problem because <CODE>longjmp</CODE> cannot
|
|
in fact be called at the place which would cause a problem.
|
|
</P><P>
|
|
|
|
<LI>
|
|
A function can return either with or without a value. (Falling
|
|
off the end of the function body is considered returning without
|
|
a value.) For example, this function would evoke such a
|
|
warning:
|
|
<P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>foo (a)
|
|
{
|
|
if (a > 0)
|
|
return a;
|
|
}
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
<LI>
|
|
An expression-statement or the left-hand side of a comma expression
|
|
contains no side effects.
|
|
To suppress the warning, cast the unused expression to void.
|
|
For example, an expression such as <SAMP>`x[i,j]'</SAMP> will cause a warning,
|
|
but <SAMP>`x[(void)i,j]'</SAMP> will not.
|
|
<P>
|
|
|
|
<LI>
|
|
An unsigned value is compared against zero with <SAMP>`<'</SAMP> or <SAMP>`<='</SAMP>.
|
|
<P>
|
|
|
|
<LI>
|
|
A comparison like <SAMP>`x<=y<=z'</SAMP> appears; this is equivalent to
|
|
<SAMP>`(x<=y ? 1 : 0) <= z'</SAMP>, which is a different interpretation from
|
|
that of ordinary mathematical notation.
|
|
<P>
|
|
|
|
<LI>
|
|
Storage-class specifiers like <CODE>static</CODE> are not the first things in
|
|
a declaration. According to the C Standard, this usage is obsolescent.
|
|
<P>
|
|
|
|
<LI>
|
|
If <SAMP>`-Wall'</SAMP> or <SAMP>`-Wunused'</SAMP> is also specified, warn about unused
|
|
arguments.
|
|
<P>
|
|
|
|
<LI>
|
|
A comparison between signed and unsigned values could produce an
|
|
incorrect result when the signed value is converted to unsigned.
|
|
(But don't warn if <SAMP>`-Wno-sign-compare'</SAMP> is also specified.)
|
|
<P>
|
|
|
|
<LI>
|
|
An aggregate has a partly bracketed initializer.
|
|
For example, the following code would evoke such a warning,
|
|
because braces are missing around the initializer for <CODE>x.h</CODE>:
|
|
<P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>struct s { int f, g; };
|
|
struct t { struct s h; int i; };
|
|
struct t x = { 1, 2, 3 };
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
<LI>
|
|
An aggregate has an initializer which does not initialize all members.
|
|
For example, the following code would cause such a warning, because
|
|
<CODE>x.h</CODE> would be implicitly initialized to zero:
|
|
<P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>struct s { int f, g, h; };
|
|
struct s x = { 3, 4 };
|
|
</FONT></pre></td></tr></table></UL>
|
|
<P>
|
|
|
|
<DT><CODE>-Wtraditional</CODE>
|
|
<DD>Warn about certain constructs that behave differently in traditional and
|
|
ANSI C.
|
|
<P>
|
|
|
|
<UL>
|
|
<LI>
|
|
Macro arguments occurring within string constants in the macro body.
|
|
These would substitute the argument in traditional C, but are part of
|
|
the constant in ANSI C.
|
|
<P>
|
|
|
|
<LI>
|
|
A function declared external in one block and then used after the end of
|
|
the block.
|
|
<P>
|
|
|
|
<LI>
|
|
A <CODE>switch</CODE> statement has an operand of type <CODE>long</CODE>.
|
|
<P>
|
|
|
|
<LI>
|
|
A non-<CODE>static</CODE> function declaration follows a <CODE>static</CODE> one.
|
|
This construct is not accepted by some traditional C compilers.
|
|
</UL>
|
|
<P>
|
|
|
|
<DT><CODE>-Wundef</CODE>
|
|
<DD>Warn if an undefined identifier is evaluated in an <SAMP>`#if'</SAMP> directive.
|
|
<P>
|
|
|
|
<DT><CODE>-Wshadow</CODE>
|
|
<DD>Warn whenever a local variable shadows another local variable.
|
|
<P>
|
|
|
|
<DT><CODE>-Wid-clash-<VAR>len</VAR></CODE>
|
|
<DD>Warn whenever two distinct identifiers match in the first <VAR>len</VAR>
|
|
characters. This may help you prepare a program that will compile
|
|
with certain obsolete, brain-damaged compilers.
|
|
<P>
|
|
|
|
<DT><CODE>-Wlarger-than-<VAR>len</VAR></CODE>
|
|
<DD>Warn whenever an object of larger than <VAR>len</VAR> bytes is defined.
|
|
<P>
|
|
|
|
<DT><CODE>-Wpointer-arith</CODE>
|
|
<DD>Warn about anything that depends on the "size of" a function type or
|
|
of <CODE>void</CODE>. GNU C assigns these types a size of 1, for
|
|
convenience in calculations with <CODE>void *</CODE> pointers and pointers
|
|
to functions.
|
|
<P>
|
|
|
|
<DT><CODE>-Wbad-function-cast</CODE>
|
|
<DD>Warn whenever a function call is cast to a non-matching type.
|
|
For example, warn if <CODE>int malloc()</CODE> is cast to <CODE>anything *</CODE>.
|
|
<P>
|
|
|
|
<DT><CODE>-Wcast-qual</CODE>
|
|
<DD>Warn whenever a pointer is cast so as to remove a type qualifier from
|
|
the target type. For example, warn if a <CODE>const char *</CODE> is cast
|
|
to an ordinary <CODE>char *</CODE>.
|
|
<P>
|
|
|
|
<DT><CODE>-Wcast-align</CODE>
|
|
<DD>Warn whenever a pointer is cast such that the required alignment of the
|
|
target is increased. For example, warn if a <CODE>char *</CODE> is cast to
|
|
an <CODE>int *</CODE> on machines where integers can only be accessed at
|
|
two- or four-byte boundaries.
|
|
<P>
|
|
|
|
<DT><CODE>-Wwrite-strings</CODE>
|
|
<DD>Give string constants the type <CODE>const char[<VAR>length</VAR>]</CODE> so that
|
|
copying the address of one into a non-<CODE>const</CODE> <CODE>char *</CODE>
|
|
pointer will get a warning. These warnings will help you find at
|
|
compile time code that can try to write into a string constant, but
|
|
only if you have been very careful about using <CODE>const</CODE> in
|
|
declarations and prototypes. Otherwise, it will just be a nuisance;
|
|
this is why we did not make <SAMP>`-Wall'</SAMP> request these warnings.
|
|
<P>
|
|
|
|
<DT><CODE>-Wconversion</CODE>
|
|
<DD>Warn if a prototype causes a type conversion that is different from what
|
|
would happen to the same argument in the absence of a prototype. This
|
|
includes conversions of fixed point to floating and vice versa, and
|
|
conversions changing the width or signedness of a fixed point argument
|
|
except when the same as the default promotion.
|
|
<P>
|
|
|
|
Also, warn if a negative integer constant expression is implicitly
|
|
converted to an unsigned type. For example, warn about the assignment
|
|
<CODE>x = -1</CODE> if <CODE>x</CODE> is unsigned. But do not warn about explicit
|
|
casts like <CODE>(unsigned) -1</CODE>.
|
|
</P><P>
|
|
|
|
<DT><CODE>-Wsign-compare</CODE>
|
|
<DD><A NAME="IDX64"></A>
|
|
<A NAME="IDX65"></A>
|
|
<A NAME="IDX66"></A>
|
|
Warn when a comparison between signed and unsigned values could produce
|
|
an incorrect result when the signed value is converted to unsigned.
|
|
This warning is also enabled by <SAMP>`-W'</SAMP>; to get the other warnings
|
|
of <SAMP>`-W'</SAMP> without this warning, use <SAMP>`-W -Wno-sign-compare'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-Waggregate-return</CODE>
|
|
<DD>Warn if any functions that return structures or unions are defined or
|
|
called. (In languages where you can return an array, this also elicits
|
|
a warning.)
|
|
<P>
|
|
|
|
<DT><CODE>-Wstrict-prototypes</CODE>
|
|
<DD>Warn if a function is declared or defined without specifying the
|
|
argument types. (An old-style function definition is permitted without
|
|
a warning if preceded by a declaration which specifies the argument
|
|
types.)
|
|
<P>
|
|
|
|
<DT><CODE>-Wmissing-prototypes</CODE>
|
|
<DD>Warn if a global function is defined without a previous prototype
|
|
declaration. This warning is issued even if the definition itself
|
|
provides a prototype. The aim is to detect global functions that fail
|
|
to be declared in header files.
|
|
<P>
|
|
|
|
<DT><CODE>-Wmissing-declarations</CODE>
|
|
<DD>Warn if a global function is defined without a previous declaration.
|
|
Do so even if the definition itself provides a prototype.
|
|
Use this option to detect global functions that are not declared in
|
|
header files.
|
|
<P>
|
|
|
|
<DT><CODE>-Wmissing-noreturn</CODE>
|
|
<DD>Warn about functions which might be candidates for attribute <CODE>noreturn</CODE>.
|
|
Note these are only possible candidates, not absolute ones. Care should
|
|
be taken to manually verify functions actually do not ever return before
|
|
adding the <CODE>noreturn</CODE> attribute, otherwise subtle code generation
|
|
bugs could be introduced.
|
|
<P>
|
|
|
|
<DT><CODE>-Wredundant-decls</CODE>
|
|
<DD>Warn if anything is declared more than once in the same scope, even in
|
|
cases where multiple declaration is valid and changes nothing.
|
|
<P>
|
|
|
|
<DT><CODE>-Wnested-externs</CODE>
|
|
<DD>Warn if an <CODE>extern</CODE> declaration is encountered within an function.
|
|
<P>
|
|
|
|
<DT><CODE>-Winline</CODE>
|
|
<DD>Warn if a function can not be inlined, and either it was declared as inline,
|
|
or else the <SAMP>`-finline-functions'</SAMP> option was given.
|
|
<P>
|
|
|
|
<DT><CODE>-Wlong-long</CODE>
|
|
<DD>Warn if <SAMP>`long long'</SAMP> type is used. This is default. To inhibit
|
|
the warning messages, use <SAMP>`-Wno-long-long'</SAMP>. Flags
|
|
<SAMP>`-Wlong-long'</SAMP> and <SAMP>`-Wno-long-long'</SAMP> are taken into account
|
|
only when <SAMP>`-pedantic'</SAMP> flag is used.
|
|
<P>
|
|
|
|
<DT><CODE>-Werror</CODE>
|
|
<DD>Make all warnings into errors.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Debugging Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC9"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC8" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC8"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC10" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC10"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC10" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC10"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 2.7 Options for Debugging Your Program or GCC </H2>
|
|
<!--docid::SEC9::-->
|
|
<P>
|
|
|
|
GCC has various special options that are used for debugging
|
|
either your program or GCC:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-g</CODE>
|
|
<DD>Produce debugging information in the operating system's native format
|
|
(stabs, COFF, XCOFF, or DWARF). GDB can work with this debugging
|
|
information.
|
|
<P>
|
|
|
|
On most systems that use stabs format, <SAMP>`-g'</SAMP> enables use of extra
|
|
debugging information that only GDB can use; this extra information
|
|
makes debugging work better in GDB but will probably make other debuggers
|
|
crash or
|
|
refuse to read the program. If you want to control for certain whether
|
|
to generate the extra information, use <SAMP>`-gstabs+'</SAMP>, <SAMP>`-gstabs'</SAMP>,
|
|
<SAMP>`-gxcoff+'</SAMP>, <SAMP>`-gxcoff'</SAMP>, <SAMP>`-gdwarf-1+'</SAMP>, or <SAMP>`-gdwarf-1'</SAMP>
|
|
(see below).
|
|
</P><P>
|
|
|
|
Unlike most other C compilers, GCC allows you to use <SAMP>`-g'</SAMP> with
|
|
<SAMP>`-O'</SAMP>. The shortcuts taken by optimized code may occasionally
|
|
produce surprising results: some variables you declared may not exist
|
|
at all; flow of control may briefly move where you did not expect it;
|
|
some statements may not be executed because they compute constant
|
|
results or their values were already at hand; some statements may
|
|
execute in different places because they were moved out of loops.
|
|
</P><P>
|
|
|
|
Nevertheless it proves possible to debug optimized output. This makes
|
|
it reasonable to use the optimizer for programs that might have bugs.
|
|
</P><P>
|
|
|
|
The following options are useful when GCC is generated with the
|
|
capability for more than one debugging format.
|
|
</P><P>
|
|
|
|
<DT><CODE>-ggdb</CODE>
|
|
<DD>Produce debugging information for use by GDB. This means to use the
|
|
most expressive format available (DWARF 2, stabs, or the native format
|
|
if neither of those are supported), including GDB extensions if at all
|
|
possible.
|
|
<P>
|
|
|
|
<DT><CODE>-gstabs</CODE>
|
|
<DD>Produce debugging information in stabs format (if that is supported),
|
|
without GDB extensions. This is the format used by DBX on most BSD
|
|
systems. On MIPS, Alpha and System V Release 4 systems this option
|
|
produces stabs debugging output which is not understood by DBX or SDB.
|
|
On System V Release 4 systems this option requires the GNU assembler.
|
|
<P>
|
|
|
|
<DT><CODE>-gstabs+</CODE>
|
|
<DD>Produce debugging information in stabs format (if that is supported),
|
|
using GNU extensions understood only by the GNU debugger (GDB). The
|
|
use of these extensions is likely to make other debuggers crash or
|
|
refuse to read the program.
|
|
<P>
|
|
|
|
<DT><CODE>-gcoff</CODE>
|
|
<DD>Produce debugging information in COFF format (if that is supported).
|
|
This is the format used by SDB on most System V systems prior to
|
|
System V Release 4.
|
|
<P>
|
|
|
|
<DT><CODE>-gxcoff</CODE>
|
|
<DD>Produce debugging information in XCOFF format (if that is supported).
|
|
This is the format used by the DBX debugger on IBM RS/6000 systems.
|
|
<P>
|
|
|
|
<DT><CODE>-gxcoff+</CODE>
|
|
<DD>Produce debugging information in XCOFF format (if that is supported),
|
|
using GNU extensions understood only by the GNU debugger (GDB). The
|
|
use of these extensions is likely to make other debuggers crash or
|
|
refuse to read the program, and may cause assemblers other than the GNU
|
|
assembler (GAS) to fail with an error.
|
|
<P>
|
|
|
|
<DT><CODE>-gdwarf</CODE>
|
|
<DD>Produce debugging information in DWARF version 1 format (if that is
|
|
supported). This is the format used by SDB on most System V Release 4
|
|
systems.
|
|
<P>
|
|
|
|
<DT><CODE>-gdwarf+</CODE>
|
|
<DD>Produce debugging information in DWARF version 1 format (if that is
|
|
supported), using GNU extensions understood only by the GNU debugger
|
|
(GDB). The use of these extensions is likely to make other debuggers
|
|
crash or refuse to read the program.
|
|
<P>
|
|
|
|
<DT><CODE>-gdwarf-2</CODE>
|
|
<DD>Produce debugging information in DWARF version 2 format (if that is
|
|
supported). This is the format used by DBX on IRIX 6.
|
|
<P>
|
|
|
|
<DT><CODE>-g<VAR>level</VAR></CODE>
|
|
<DD><DT><CODE>-ggdb<VAR>level</VAR></CODE>
|
|
<DD><DT><CODE>-gstabs<VAR>level</VAR></CODE>
|
|
<DD><DT><CODE>-gcoff<VAR>level</VAR></CODE>
|
|
<DD><DT><CODE>-gxcoff<VAR>level</VAR></CODE>
|
|
<DD><DT><CODE>-gdwarf<VAR>level</VAR></CODE>
|
|
<DD><DT><CODE>-gdwarf-2<VAR>level</VAR></CODE>
|
|
<DD>Request debugging information and also use <VAR>level</VAR> to specify how
|
|
much information. The default level is 2.
|
|
<P>
|
|
|
|
Level 1 produces minimal information, enough for making backtraces in
|
|
parts of the program that you don't plan to debug. This includes
|
|
descriptions of functions and external variables, but no information
|
|
about local variables and no line numbers.
|
|
</P><P>
|
|
|
|
Level 3 includes extra information, such as all the macro definitions
|
|
present in the program. Some debuggers support macro expansion when
|
|
you use <SAMP>`-g3'</SAMP>.
|
|
</P><P>
|
|
|
|
<A NAME="IDX67"></A>
|
|
<DT><CODE>-p</CODE>
|
|
<DD>Generate extra code to write profile information suitable for the
|
|
analysis program <CODE>prof</CODE>. You must use this option when compiling
|
|
the source files you want data about, and you must also use it when
|
|
linking.
|
|
<P>
|
|
|
|
<A NAME="IDX68"></A>
|
|
<DT><CODE>-pg</CODE>
|
|
<DD>Generate extra code to write profile information suitable for the
|
|
analysis program <CODE>gprof</CODE>. You must use this option when compiling
|
|
the source files you want data about, and you must also use it when
|
|
linking.
|
|
<P>
|
|
|
|
<A NAME="IDX69"></A>
|
|
<DT><CODE>-a</CODE>
|
|
<DD>Generate extra code to write profile information for basic blocks, which will
|
|
record the number of times each basic block is executed, the basic block start
|
|
address, and the function name containing the basic block. If <SAMP>`-g'</SAMP> is
|
|
used, the line number and filename of the start of the basic block will also be
|
|
recorded. If not overridden by the machine description, the default action is
|
|
to append to the text file <TT>`bb.out'</TT>.
|
|
<P>
|
|
|
|
This data could be analyzed by a program like <CODE>tcov</CODE>. Note,
|
|
however, that the format of the data is not what <CODE>tcov</CODE> expects.
|
|
Eventually GNU <CODE>gprof</CODE> should be extended to process this data.
|
|
</P><P>
|
|
|
|
<DT><CODE>-Q</CODE>
|
|
<DD>Makes the compiler print out each function name as it is compiled, and
|
|
print some statistics about each pass when it finishes.
|
|
<P>
|
|
|
|
<DT><CODE>-ax</CODE>
|
|
<DD>Generate extra code to profile basic blocks. Your executable will
|
|
produce output that is a superset of that produced when <SAMP>`-a'</SAMP> is
|
|
used. Additional output is the source and target address of the basic
|
|
blocks where a jump takes place, the number of times a jump is executed,
|
|
and (optionally) the complete sequence of basic blocks being executed.
|
|
The output is appended to file <TT>`bb.out'</TT>.
|
|
<P>
|
|
|
|
You can examine different profiling aspects without recompilation. Your
|
|
executable will read a list of function names from file <TT>`bb.in'</TT>.
|
|
Profiling starts when a function on the list is entered and stops when
|
|
that invocation is exited. To exclude a function from profiling, prefix
|
|
its name with `-'. If a function name is not unique, you can
|
|
disambiguate it by writing it in the form
|
|
<SAMP>`/path/filename.d:functionname'</SAMP>. Your executable will write the
|
|
available paths and filenames in file <TT>`bb.out'</TT>.
|
|
</P><P>
|
|
|
|
Several function names have a special meaning:
|
|
<DL COMPACT>
|
|
<DT><CODE>__bb_jumps__</CODE>
|
|
<DD>Write source, target and frequency of jumps to file <TT>`bb.out'</TT>.
|
|
<DT><CODE>__bb_hidecall__</CODE>
|
|
<DD>Exclude function calls from frequency count.
|
|
<DT><CODE>__bb_showret__</CODE>
|
|
<DD>Include function returns in frequency count.
|
|
<DT><CODE>__bb_trace__</CODE>
|
|
<DD>Write the sequence of basic blocks executed to file <TT>`bbtrace.gz'</TT>.
|
|
The file will be compressed using the program <SAMP>`gzip'</SAMP>, which must
|
|
exist in your <CODE>PATH</CODE>. On systems without the <SAMP>`popen'</SAMP>
|
|
function, the file will be named <TT>`bbtrace'</TT> and will not be
|
|
compressed. <STRONG>Profiling for even a few seconds on these systems
|
|
will produce a very large file.</STRONG> Note: <CODE>__bb_hidecall__</CODE> and
|
|
<CODE>__bb_showret__</CODE> will not affect the sequence written to
|
|
<TT>`bbtrace.gz'</TT>.
|
|
</DL>
|
|
<P>
|
|
|
|
Here's a short example using different profiling parameters
|
|
in file <TT>`bb.in'</TT>. Assume function <CODE>foo</CODE> consists of basic blocks
|
|
1 and 2 and is called twice from block 3 of function <CODE>main</CODE>. After
|
|
the calls, block 3 transfers control to block 4 of <CODE>main</CODE>.
|
|
</P><P>
|
|
|
|
With <CODE>__bb_trace__</CODE> and <CODE>main</CODE> contained in file <TT>`bb.in'</TT>,
|
|
the following sequence of blocks is written to file <TT>`bbtrace.gz'</TT>:
|
|
0 3 1 2 1 2 4. The return from block 2 to block 3 is not shown, because
|
|
the return is to a point inside the block and not to the top. The
|
|
block address 0 always indicates, that control is transferred
|
|
to the trace from somewhere outside the observed functions. With
|
|
<SAMP>`-foo'</SAMP> added to <TT>`bb.in'</TT>, the blocks of function
|
|
<CODE>foo</CODE> are removed from the trace, so only 0 3 4 remains.
|
|
</P><P>
|
|
|
|
With <CODE>__bb_jumps__</CODE> and <CODE>main</CODE> contained in file <TT>`bb.in'</TT>,
|
|
jump frequencies will be written to file <TT>`bb.out'</TT>. The
|
|
frequencies are obtained by constructing a trace of blocks
|
|
and incrementing a counter for every neighbouring pair of blocks
|
|
in the trace. The trace 0 3 1 2 1 2 4 displays the following
|
|
frequencies:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=example><pre>Jump from block 0x0 to block 0x3 executed 1 time(s)
|
|
Jump from block 0x3 to block 0x1 executed 1 time(s)
|
|
Jump from block 0x1 to block 0x2 executed 2 time(s)
|
|
Jump from block 0x2 to block 0x1 executed 1 time(s)
|
|
Jump from block 0x2 to block 0x4 executed 1 time(s)
|
|
</pre></td></tr></table></P><P>
|
|
|
|
With <CODE>__bb_hidecall__</CODE>, control transfer due to call instructions
|
|
is removed from the trace, that is the trace is cut into three parts: 0
|
|
3 4, 0 1 2 and 0 1 2. With <CODE>__bb_showret__</CODE>, control transfer due
|
|
to return instructions is added to the trace. The trace becomes: 0 3 1
|
|
2 3 1 2 3 4. Note, that this trace is not the same, as the sequence
|
|
written to <TT>`bbtrace.gz'</TT>. It is solely used for counting jump
|
|
frequencies.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fprofile-arcs</CODE>
|
|
<DD>Instrument <EM>arcs</EM> during compilation. For each function of your
|
|
program, GCC creates a program flow graph, then finds a spanning tree
|
|
for the graph. Only arcs that are not on the spanning tree have to be
|
|
instrumented: the compiler adds code to count the number of times that these
|
|
arcs are executed. When an arc is the only exit or only entrance to a
|
|
block, the instrumentation code can be added to the block; otherwise, a
|
|
new basic block must be created to hold the instrumentation code.
|
|
<P>
|
|
|
|
Since not every arc in the program must be instrumented, programs
|
|
compiled with this option run faster than programs compiled with
|
|
<SAMP>`-a'</SAMP>, which adds instrumentation code to every basic block in the
|
|
program. The tradeoff: since <CODE>gcov</CODE> does not have
|
|
execution counts for all branches, it must start with the execution
|
|
counts for the instrumented branches, and then iterate over the program
|
|
flow graph until the entire graph has been solved. Hence, <CODE>gcov</CODE>
|
|
runs a little more slowly than a program which uses information from
|
|
<SAMP>`-a'</SAMP>.
|
|
</P><P>
|
|
|
|
<SAMP>`-fprofile-arcs'</SAMP> also makes it possible to estimate branch
|
|
probabilities, and to calculate basic block execution counts. In
|
|
general, basic block execution counts do not give enough information to
|
|
estimate all branch probabilities. When the compiled program exits, it
|
|
saves the arc execution counts to a file called
|
|
<TT>`<VAR>sourcename</VAR>.da'</TT>. Use the compiler option
|
|
<SAMP>`-fbranch-probabilities'</SAMP> (see section <A HREF="gcc_2.html#SEC10" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC10">Options that Control Optimization</A>) when recompiling, to optimize using estimated
|
|
branch probabilities.
|
|
</P><P>
|
|
|
|
<DT><CODE>-ftest-coverage</CODE>
|
|
<DD>Create data files for the <CODE>gcov</CODE> code-coverage utility
|
|
(see section <A HREF="gcc_6.html#SEC113" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_6.html#SEC113"><CODE>gcov</CODE>: a GCC Test Coverage Program</A>).
|
|
The data file names begin with the name of your source file:
|
|
<P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE><VAR>sourcename</VAR>.bb</CODE>
|
|
<DD>A mapping from basic blocks to line numbers, which <CODE>gcov</CODE> uses to
|
|
associate basic block execution counts with line numbers.
|
|
<P>
|
|
|
|
<DT><CODE><VAR>sourcename</VAR>.bbg</CODE>
|
|
<DD>A list of all arcs in the program flow graph. This allows <CODE>gcov</CODE>
|
|
to reconstruct the program flow graph, so that it can compute all basic
|
|
block and arc execution counts from the information in the
|
|
<CODE><VAR>sourcename</VAR>.da</CODE> file (this last file is the output from
|
|
<SAMP>`-fprofile-arcs'</SAMP>).
|
|
</DL>
|
|
<P>
|
|
|
|
<DT><CODE>-Q</CODE>
|
|
<DD>Makes the compiler print out each function name as it is compiled, and
|
|
print some statistics about each pass when it finishes.
|
|
<P>
|
|
|
|
<DT><CODE>-d<VAR>letters</VAR></CODE>
|
|
<DD>Says to make debugging dumps during compilation at times specified by
|
|
<VAR>letters</VAR>. This is used for debugging the compiler. The file names
|
|
for most of the dumps are made by appending a word to the source file
|
|
name (e.g. <TT>`foo.c.rtl'</TT> or <TT>`foo.c.jump'</TT>). Here are the
|
|
possible letters for use in <VAR>letters</VAR>, and their meanings:
|
|
<P>
|
|
|
|
<DL COMPACT>
|
|
<DT><SAMP>`b'</SAMP>
|
|
<DD>Dump after computing branch probabilities, to <TT>`<VAR>file</VAR>.bp'</TT>.
|
|
<DT><SAMP>`c'</SAMP>
|
|
<DD>Dump after instruction combination, to the file <TT>`<VAR>file</VAR>.combine'</TT>.
|
|
<DT><SAMP>`d'</SAMP>
|
|
<DD>Dump after delayed branch scheduling, to <TT>`<VAR>file</VAR>.dbr'</TT>.
|
|
<DT><SAMP>`D'</SAMP>
|
|
<DD>Dump all macro definitions, at the end of preprocessing, in addition to
|
|
normal output.
|
|
<DT><SAMP>`r'</SAMP>
|
|
<DD>Dump after RTL generation, to <TT>`<VAR>file</VAR>.rtl'</TT>.
|
|
<DT><SAMP>`j'</SAMP>
|
|
<DD>Dump after first jump optimization, to <TT>`<VAR>file</VAR>.jump'</TT>.
|
|
<DT><SAMP>`F'</SAMP>
|
|
<DD>Dump after purging ADDRESSOF, to <TT>`<VAR>file</VAR>.addressof'</TT>.
|
|
<DT><SAMP>`f'</SAMP>
|
|
<DD>Dump after flow analysis, to <TT>`<VAR>file</VAR>.flow'</TT>.
|
|
<DT><SAMP>`g'</SAMP>
|
|
<DD>Dump after global register allocation, to <TT>`<VAR>file</VAR>.greg'</TT>.
|
|
<DT><SAMP>`G'</SAMP>
|
|
<DD>Dump after GCSE, to <TT>`<VAR>file</VAR>.gcse'</TT>.
|
|
<DT><SAMP>`j'</SAMP>
|
|
<DD>Dump after first jump optimization, to <TT>`<VAR>file</VAR>.jump'</TT>.
|
|
<DT><SAMP>`J'</SAMP>
|
|
<DD>Dump after last jump optimization, to <TT>`<VAR>file</VAR>.jump2'</TT>.
|
|
<DT><SAMP>`k'</SAMP>
|
|
<DD>Dump after conversion from registers to stack, to <TT>`<VAR>file</VAR>.stack'</TT>.
|
|
<DT><SAMP>`l'</SAMP>
|
|
<DD>Dump after local register allocation, to <TT>`<VAR>file</VAR>.lreg'</TT>.
|
|
<DT><SAMP>`L'</SAMP>
|
|
<DD>Dump after loop optimization, to <TT>`<VAR>file</VAR>.loop'</TT>.
|
|
<DT><SAMP>`M'</SAMP>
|
|
<DD>Dump after performing the machine dependent reorganisation pass, to
|
|
<TT>`<VAR>file</VAR>.mach'</TT>.
|
|
<DT><SAMP>`N'</SAMP>
|
|
<DD>Dump after the register move pass, to <TT>`<VAR>file</VAR>.regmove'</TT>.
|
|
<DT><SAMP>`r'</SAMP>
|
|
<DD>Dump after RTL generation, to <TT>`<VAR>file</VAR>.rtl'</TT>.
|
|
<DT><SAMP>`R'</SAMP>
|
|
<DD>Dump after the second instruction scheduling pass, to <TT>`<VAR>file</VAR>.sched2'</TT>.
|
|
<DT><SAMP>`s'</SAMP>
|
|
<DD>Dump after CSE (including the jump optimization that sometimes follows
|
|
CSE), to <TT>`<VAR>file</VAR>.cse'</TT>.
|
|
<DT><SAMP>`S'</SAMP>
|
|
<DD>Dump after the first instruction scheduling pass, to <TT>`<VAR>file</VAR>.sched'</TT>.
|
|
<DT><SAMP>`t'</SAMP>
|
|
<DD>Dump after the second CSE pass (including the jump optimization that
|
|
sometimes follows CSE), to <TT>`<VAR>file</VAR>.cse2'</TT>.
|
|
<DT><SAMP>`a'</SAMP>
|
|
<DD>Produce all the dumps listed above.
|
|
<DT><SAMP>`m'</SAMP>
|
|
<DD>Print statistics on memory usage, at the end of the run, to
|
|
standard error.
|
|
<DT><SAMP>`p'</SAMP>
|
|
<DD>Annotate the assembler output with a comment indicating which
|
|
pattern and alternative was used. The length of each instruction is
|
|
also printed.
|
|
<DT><SAMP>`x'</SAMP>
|
|
<DD>Just generate RTL for a function instead of compiling it. Usually used
|
|
with <SAMP>`r'</SAMP>.
|
|
<DT><SAMP>`y'</SAMP>
|
|
<DD>Dump debugging information during parsing, to standard error.
|
|
<DT><SAMP>`A'</SAMP>
|
|
<DD>Annotate the assembler output with miscellaneous debugging information.
|
|
</DL>
|
|
<P>
|
|
|
|
<DT><CODE>-fdump-unnumbered</CODE>
|
|
<DD>When doing debugging dumps (see -d option above), suppress instruction
|
|
numbers and line number note output. This makes it more feasible to
|
|
use diff on debugging dumps for compiler invokations with different
|
|
options, in particular with and without -g.
|
|
<P>
|
|
|
|
<DT><CODE>-fpretend-float</CODE>
|
|
<DD>When running a cross-compiler, pretend that the target machine uses the
|
|
same floating point format as the host machine. This causes incorrect
|
|
output of the actual floating constants, but the actual instruction
|
|
sequence will probably be the same as GCC would make when running on
|
|
the target machine.
|
|
<P>
|
|
|
|
<DT><CODE>-save-temps</CODE>
|
|
<DD>Store the usual "temporary" intermediate files permanently; place them
|
|
in the current directory and name them based on the source file. Thus,
|
|
compiling <TT>`foo.c'</TT> with <SAMP>`-c -save-temps'</SAMP> would produce files
|
|
<TT>`foo.i'</TT> and <TT>`foo.s'</TT>, as well as <TT>`foo.o'</TT>.
|
|
<P>
|
|
|
|
<DT><CODE>-print-file-name=<VAR>library</VAR></CODE>
|
|
<DD>Print the full absolute name of the library file <VAR>library</VAR> that
|
|
would be used when linking--and don't do anything else. With this
|
|
option, GCC does not compile or link anything; it just prints the
|
|
file name.
|
|
<P>
|
|
|
|
<DT><CODE>-print-prog-name=<VAR>program</VAR></CODE>
|
|
<DD>Like <SAMP>`-print-file-name'</SAMP>, but searches for a program such as <SAMP>`cpp'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-print-libgcc-file-name</CODE>
|
|
<DD>Same as <SAMP>`-print-file-name=libgcc.a'</SAMP>.
|
|
<P>
|
|
|
|
This is useful when you use <SAMP>`-nostdlib'</SAMP> or <SAMP>`-nodefaultlibs'</SAMP>
|
|
but you do want to link with <TT>`libgcc.a'</TT>. You can do
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=example><pre>gcc -nostdlib <VAR>files</VAR><small>...</small> `gcc -print-libgcc-file-name`
|
|
</pre></td></tr></table></P><P>
|
|
|
|
<DT><CODE>-print-search-dirs</CODE>
|
|
<DD>Print the name of the configured installation directory and a list of
|
|
program and library directories gcc will search--and don't do anything else.
|
|
<P>
|
|
|
|
This is useful when gcc prints the error message
|
|
<SAMP>`installation problem, cannot exec cpp: No such file or directory'</SAMP>.
|
|
To resolve this you either need to put <TT>`cpp'</TT> and the other compiler
|
|
components where gcc expects to find them, or you can set the environment
|
|
variable <CODE>GCC_EXEC_PREFIX</CODE> to the directory where you installed them.
|
|
Don't forget the trailing '/'.
|
|
See section <A HREF="gcc_2.html#SEC44" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC44">2.16 Environment Variables Affecting GCC</A>.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Optimize Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC10"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC9" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC9"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC11" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC11"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC11" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC11"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 2.8 Options That Control Optimization </H2>
|
|
<!--docid::SEC10::-->
|
|
<P>
|
|
|
|
These options control various sorts of optimizations:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-O</CODE>
|
|
<DD><DT><CODE>-O1</CODE>
|
|
<DD>Optimize. Optimizing compilation takes somewhat more time, and a lot
|
|
more memory for a large function.
|
|
<P>
|
|
|
|
Without <SAMP>`-O'</SAMP>, the compiler's goal is to reduce the cost of
|
|
compilation and to make debugging produce the expected results.
|
|
Statements are independent: if you stop the program with a breakpoint
|
|
between statements, you can then assign a new value to any variable or
|
|
change the program counter to any other statement in the function and
|
|
get exactly the results you would expect from the source code.
|
|
</P><P>
|
|
|
|
Without <SAMP>`-O'</SAMP>, the compiler only allocates variables declared
|
|
<CODE>register</CODE> in registers. The resulting compiled code is a little
|
|
worse than produced by PCC without <SAMP>`-O'</SAMP>.
|
|
</P><P>
|
|
|
|
With <SAMP>`-O'</SAMP>, the compiler tries to reduce code size and execution
|
|
time.
|
|
</P><P>
|
|
|
|
When you specify <SAMP>`-O'</SAMP>, the compiler turns on <SAMP>`-fthread-jumps'</SAMP>
|
|
and <SAMP>`-fdefer-pop'</SAMP> on all machines. The compiler turns on
|
|
<SAMP>`-fdelayed-branch'</SAMP> on machines that have delay slots, and
|
|
<SAMP>`-fomit-frame-pointer'</SAMP> on machines that can support debugging even
|
|
without a frame pointer. On some machines the compiler also turns
|
|
on other flags.</P><P>
|
|
|
|
<DT><CODE>-O2</CODE>
|
|
<DD>Optimize even more. GCC performs nearly all supported optimizations
|
|
that do not involve a space-speed tradeoff. The compiler does not
|
|
perform loop unrolling or function inlining when you specify <SAMP>`-O2'</SAMP>.
|
|
As compared to <SAMP>`-O'</SAMP>, this option increases both compilation time
|
|
and the performance of the generated code.
|
|
<P>
|
|
|
|
<SAMP>`-O2'</SAMP> turns on all optional optimizations except for loop unrolling,
|
|
function inlining, and strict aliasing optimizations. It also turns on the
|
|
<SAMP>`-fforce-mem'</SAMP> option on all machines and frame pointer elimination on
|
|
machines where doing so does not interfere with debugging.
|
|
</P><P>
|
|
|
|
<DT><CODE>-O3</CODE>
|
|
<DD>Optimize yet more. <SAMP>`-O3'</SAMP> turns on all optimizations specified by
|
|
<SAMP>`-O2'</SAMP> and also turns on the <SAMP>`inline-functions'</SAMP> option.
|
|
<P>
|
|
|
|
<DT><CODE>-O0</CODE>
|
|
<DD>Do not optimize.
|
|
<P>
|
|
|
|
<DT><CODE>-Os</CODE>
|
|
<DD>Optimize for size. <SAMP>`-Os'</SAMP> enables all <SAMP>`-O2'</SAMP> optimizations that
|
|
do not typically increase code size. It also performs further
|
|
optimizations designed to reduce code size.
|
|
<P>
|
|
|
|
If you use multiple <SAMP>`-O'</SAMP> options, with or without level numbers,
|
|
the last such option is the one that is effective.
|
|
</DL>
|
|
<P>
|
|
|
|
Options of the form <SAMP>`-f<VAR>flag</VAR>'</SAMP> specify machine-independent
|
|
flags. Most flags have both positive and negative forms; the negative
|
|
form of <SAMP>`-ffoo'</SAMP> would be <SAMP>`-fno-foo'</SAMP>. In the table below,
|
|
only one of the forms is listed--the one which is not the default.
|
|
You can figure out the other form by either removing <SAMP>`no-'</SAMP> or
|
|
adding it.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-ffloat-store</CODE>
|
|
<DD>Do not store floating point variables in registers, and inhibit other
|
|
options that might change whether a floating point value is taken from a
|
|
register or memory.
|
|
<P>
|
|
|
|
<A NAME="IDX70"></A>
|
|
This option prevents undesirable excess precision on machines such as
|
|
the 68000 where the floating registers (of the 68881) keep more
|
|
precision than a <CODE>double</CODE> is supposed to have. Similarly for the
|
|
x86 architecture. For most programs, the excess precision does only
|
|
good, but a few programs rely on the precise definition of IEEE floating
|
|
point. Use <SAMP>`-ffloat-store'</SAMP> for such programs, after modifying
|
|
them to store all pertinent intermediate computations into variables.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fno-default-inline</CODE>
|
|
<DD>Do not make member functions inline by default merely because they are
|
|
defined inside the class scope (C++ only). Otherwise, when you specify
|
|
<SAMP>`-O'</SAMP>, member functions defined inside class scope are compiled
|
|
inline by default; i.e., you don't need to add <SAMP>`inline'</SAMP> in front of
|
|
the member function name.
|
|
<P>
|
|
|
|
<DT><CODE>-fno-defer-pop</CODE>
|
|
<DD>Always pop the arguments to each function call as soon as that function
|
|
returns. For machines which must pop arguments after a function call,
|
|
the compiler normally lets arguments accumulate on the stack for several
|
|
function calls and pops them all at once.
|
|
<P>
|
|
|
|
<DT><CODE>-fforce-mem</CODE>
|
|
<DD>Force memory operands to be copied into registers before doing
|
|
arithmetic on them. This produces better code by making all memory
|
|
references potential common subexpressions. When they are not common
|
|
subexpressions, instruction combination should eliminate the separate
|
|
register-load. The <SAMP>`-O2'</SAMP> option turns on this option.
|
|
<P>
|
|
|
|
<DT><CODE>-fforce-addr</CODE>
|
|
<DD>Force memory address constants to be copied into registers before
|
|
doing arithmetic on them. This may produce better code just as
|
|
<SAMP>`-fforce-mem'</SAMP> may.
|
|
<P>
|
|
|
|
<DT><CODE>-fomit-frame-pointer</CODE>
|
|
<DD>Don't keep the frame pointer in a register for functions that
|
|
don't need one. This avoids the instructions to save, set up and
|
|
restore frame pointers; it also makes an extra register available
|
|
in many functions. <STRONG>It also makes debugging impossible on
|
|
some machines.</STRONG>
|
|
<P>
|
|
|
|
On some machines, such as the Vax, this flag has no effect, because
|
|
the standard calling sequence automatically handles the frame pointer
|
|
and nothing is saved by pretending it doesn't exist. The
|
|
machine-description macro <CODE>FRAME_POINTER_REQUIRED</CODE> controls
|
|
whether a target machine supports this flag. See section <A HREF="gcc_17.html#SEC204" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_17.html#SEC204">17.5 Register Usage</A>.</P><P>
|
|
|
|
<DT><CODE>-fno-inline</CODE>
|
|
<DD>Don't pay attention to the <CODE>inline</CODE> keyword. Normally this option
|
|
is used to keep the compiler from expanding any functions inline.
|
|
Note that if you are not optimizing, no functions can be expanded inline.
|
|
<P>
|
|
|
|
<DT><CODE>-finline-functions</CODE>
|
|
<DD>Integrate all simple functions into their callers. The compiler
|
|
heuristically decides which functions are simple enough to be worth
|
|
integrating in this way.
|
|
<P>
|
|
|
|
If all calls to a given function are integrated, and the function is
|
|
declared <CODE>static</CODE>, then the function is normally not output as
|
|
assembler code in its own right.
|
|
</P><P>
|
|
|
|
<DT><CODE>-finline-limit-<VAR>n</VAR></CODE>
|
|
<DD>By default, gcc limits the size of functions that can be inlined. This flag
|
|
allows the control of this limit for functions that are explicitly marked as
|
|
inline (ie marked with the inline keyword or defined within the class
|
|
definition in c++). <VAR>n</VAR> is the size of functions that can be inlined in
|
|
number of pseudo instructions (not counting parameter handling). The default
|
|
value of n is 10000. Increasing this value can result in more inlined code at
|
|
the cost of compilation time and memory consumption. Decreasing usually makes
|
|
the compilation faster and less code will be inlined (which presumably
|
|
means slower programs). This option is particularly useful for programs that
|
|
use inlining heavily such as those based on recursive templates with c++.
|
|
<P>
|
|
|
|
<EM>Note:</EM> pseudo instruction represents, in this particular context, an
|
|
abstract measurement of function's size. In no way, it represents a count
|
|
of assembly instructions and as such its exact meaning might change from one
|
|
release to an another.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fkeep-inline-functions</CODE>
|
|
<DD>Even if all calls to a given function are integrated, and the function
|
|
is declared <CODE>static</CODE>, nevertheless output a separate run-time
|
|
callable version of the function. This switch does not affect
|
|
<CODE>extern inline</CODE> functions.
|
|
<P>
|
|
|
|
<DT><CODE>-fkeep-static-consts</CODE>
|
|
<DD>Emit variables declared <CODE>static const</CODE> when optimization isn't turned
|
|
on, even if the variables aren't referenced.
|
|
<P>
|
|
|
|
GCC enables this option by default. If you want to force the compiler to
|
|
check if the variable was referenced, regardless of whether or not
|
|
optimization is turned on, use the <SAMP>`-fno-keep-static-consts'</SAMP> option.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fno-function-cse</CODE>
|
|
<DD>Do not put function addresses in registers; make each instruction that
|
|
calls a constant function contain the function's address explicitly.
|
|
<P>
|
|
|
|
This option results in less efficient code, but some strange hacks
|
|
that alter the assembler output may be confused by the optimizations
|
|
performed when this option is not used.
|
|
</P><P>
|
|
|
|
<DT><CODE>-ffast-math</CODE>
|
|
<DD>This option allows GCC to violate some ANSI or IEEE rules and/or
|
|
specifications in the interest of optimizing code for speed. For
|
|
example, it allows the compiler to assume arguments to the <CODE>sqrt</CODE>
|
|
function are non-negative numbers and that no floating-point values
|
|
are NaNs.
|
|
<P>
|
|
|
|
This option should never be turned on by any <SAMP>`-O'</SAMP> option since
|
|
it can result in incorrect output for programs which depend on
|
|
an exact implementation of IEEE or ANSI rules/specifications for
|
|
math functions.
|
|
</DL>
|
|
<P>
|
|
|
|
The following options control specific optimizations. The <SAMP>`-O2'</SAMP>
|
|
option turns on all of these optimizations except <SAMP>`-funroll-loops'</SAMP>
|
|
<SAMP>`-funroll-all-loops'</SAMP>, and <SAMP>`-fstrict-aliasing'</SAMP>. On most machines, the
|
|
<SAMP>`-O'</SAMP> option turns on the <SAMP>`-fthread-jumps'</SAMP> and <SAMP>`-fdelayed-branch'</SAMP>
|
|
options, but specific machines may handle it differently.
|
|
</P><P>
|
|
|
|
You can use the following flags in the rare cases when "fine-tuning"
|
|
of optimizations to be performed is desired.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-fstrength-reduce</CODE>
|
|
<DD>Perform the optimizations of loop strength reduction and
|
|
elimination of iteration variables.
|
|
<P>
|
|
|
|
<DT><CODE>-fthread-jumps</CODE>
|
|
<DD>Perform optimizations where we check to see if a jump branches to a
|
|
location where another comparison subsumed by the first is found. If
|
|
so, the first branch is redirected to either the destination of the
|
|
second branch or a point immediately following it, depending on whether
|
|
the condition is known to be true or false.
|
|
<P>
|
|
|
|
<DT><CODE>-fcse-follow-jumps</CODE>
|
|
<DD>In common subexpression elimination, scan through jump instructions
|
|
when the target of the jump is not reached by any other path. For
|
|
example, when CSE encounters an <CODE>if</CODE> statement with an
|
|
<CODE>else</CODE> clause, CSE will follow the jump when the condition
|
|
tested is false.
|
|
<P>
|
|
|
|
<DT><CODE>-fcse-skip-blocks</CODE>
|
|
<DD>This is similar to <SAMP>`-fcse-follow-jumps'</SAMP>, but causes CSE to
|
|
follow jumps which conditionally skip over blocks. When CSE
|
|
encounters a simple <CODE>if</CODE> statement with no else clause,
|
|
<SAMP>`-fcse-skip-blocks'</SAMP> causes CSE to follow the jump around the
|
|
body of the <CODE>if</CODE>.
|
|
<P>
|
|
|
|
<DT><CODE>-frerun-cse-after-loop</CODE>
|
|
<DD>Re-run common subexpression elimination after loop optimizations has been
|
|
performed.
|
|
<P>
|
|
|
|
<DT><CODE>-frerun-loop-opt</CODE>
|
|
<DD>Run the loop optimizer twice.
|
|
<P>
|
|
|
|
<DT><CODE>-fgcse</CODE>
|
|
<DD>Perform a global common subexpression elimination pass.
|
|
This pass also performs global constant and copy propagation.
|
|
<P>
|
|
|
|
<DT><CODE>-fexpensive-optimizations</CODE>
|
|
<DD>Perform a number of minor optimizations that are relatively expensive.
|
|
<P>
|
|
|
|
<DT><CODE>-foptimize-register-moves</CODE>
|
|
<DD><DT><CODE>-fregmove</CODE>
|
|
<DD>Attempt to reassign register numbers in move instructions and as
|
|
operands of other simple instructions in order to maximize the amount of
|
|
register tying. This is especially helpful on machines with two-operand
|
|
instructions. GCC enables this optimization by default with <SAMP>`-O2'</SAMP>
|
|
or higher.
|
|
<P>
|
|
|
|
Note <CODE>-fregmove</CODE> and <CODE>-foptimize-register-moves</CODE> are the same
|
|
optimization.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fdelayed-branch</CODE>
|
|
<DD>If supported for the target machine, attempt to reorder instructions
|
|
to exploit instruction slots available after delayed branch
|
|
instructions.
|
|
<P>
|
|
|
|
<DT><CODE>-fschedule-insns</CODE>
|
|
<DD>If supported for the target machine, attempt to reorder instructions to
|
|
eliminate execution stalls due to required data being unavailable. This
|
|
helps machines that have slow floating point or memory load instructions
|
|
by allowing other instructions to be issued until the result of the load
|
|
or floating point instruction is required.
|
|
<P>
|
|
|
|
<DT><CODE>-fschedule-insns2</CODE>
|
|
<DD>Similar to <SAMP>`-fschedule-insns'</SAMP>, but requests an additional pass of
|
|
instruction scheduling after register allocation has been done. This is
|
|
especially useful on machines with a relatively small number of
|
|
registers and where memory load instructions take more than one cycle.
|
|
<P>
|
|
|
|
<DT><CODE>-ffunction-sections</CODE>
|
|
<DD><DT><CODE>-fdata-sections</CODE>
|
|
<DD>Place each function or data item into its own section in the output
|
|
file if the target supports arbitrary sections. The name of the
|
|
function or the name of the data item determines the section's name
|
|
in the output file.
|
|
<P>
|
|
|
|
Use these options on systems where the linker can perform optimizations
|
|
to improve locality of reference in the instruction space. HPPA
|
|
processors running HP-UX and Sparc processors running Solaris 2 have
|
|
linkers with such optimizations. Other systems using the ELF object format
|
|
as well as AIX may have these optimizations in the future.
|
|
</P><P>
|
|
|
|
Only use these options when there are significant benefits from doing
|
|
so. When you specify these options, the assembler and linker will
|
|
create larger object and executable files and will also be slower.
|
|
You will not be able to use <CODE>gprof</CODE> on all systems if you
|
|
specify this option and you may have problems with debugging if
|
|
you specify both this option and <SAMP>`-g'</SAMP>.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fcaller-saves</CODE>
|
|
<DD>Enable values to be allocated in registers that will be clobbered by
|
|
function calls, by emitting extra instructions to save and restore the
|
|
registers around such calls. Such allocation is done only when it
|
|
seems to result in better code than would otherwise be produced.
|
|
<P>
|
|
|
|
This option is always enabled by default on certain machines, usually
|
|
those which have no call-preserved registers to use instead.
|
|
</P><P>
|
|
|
|
For all machines, optimization level 2 and higher enables this flag by
|
|
default.
|
|
</P><P>
|
|
|
|
<DT><CODE>-funroll-loops</CODE>
|
|
<DD>Perform the optimization of loop unrolling. This is only done for loops
|
|
whose number of iterations can be determined at compile time or run time.
|
|
<SAMP>`-funroll-loops'</SAMP> implies both <SAMP>`-fstrength-reduce'</SAMP> and
|
|
<SAMP>`-frerun-cse-after-loop'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-funroll-all-loops</CODE>
|
|
<DD>Perform the optimization of loop unrolling. This is done for all loops
|
|
and usually makes programs run more slowly. <SAMP>`-funroll-all-loops'</SAMP>
|
|
implies <SAMP>`-fstrength-reduce'</SAMP> as well as <SAMP>`-frerun-cse-after-loop'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-fmove-all-movables</CODE>
|
|
<DD>Forces all invariant computations in loops to be moved
|
|
outside the loop.
|
|
<P>
|
|
|
|
<DT><CODE>-freduce-all-givs</CODE>
|
|
<DD>Forces all general-induction variables in loops to be
|
|
strength-reduced.
|
|
<P>
|
|
|
|
<EM>Note:</EM> When compiling programs written in Fortran,
|
|
<SAMP>`-fmove-all-movables'</SAMP> and <SAMP>`-freduce-all-givs'</SAMP> are enabled
|
|
by default when you use the optimizer.
|
|
</P><P>
|
|
|
|
These options may generate better or worse code; results are highly
|
|
dependent on the structure of loops within the source code.
|
|
</P><P>
|
|
|
|
These two options are intended to be removed someday, once
|
|
they have helped determine the efficacy of various
|
|
approaches to improving loop optimizations.
|
|
</P><P>
|
|
|
|
Please let us (<CODE>gcc@gcc.gnu.org</CODE> and <CODE>fortran@gnu.org</CODE>)
|
|
know how use of these options affects
|
|
the performance of your production code.
|
|
We're very interested in code that runs <EM>slower</EM>
|
|
when these options are <EM>enabled</EM>.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fno-peephole</CODE>
|
|
<DD>Disable any machine-specific peephole optimizations.
|
|
<P>
|
|
|
|
<DT><CODE>-fbranch-probabilities</CODE>
|
|
<DD>After running a program compiled with <SAMP>`-fprofile-arcs'</SAMP>
|
|
(see section <A HREF="gcc_2.html#SEC9" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC9">Options for Debugging Your Program or <CODE>gcc</CODE></A>), you can compile it a second time using
|
|
<SAMP>`-fbranch-probabilities'</SAMP>, to improve optimizations based on
|
|
guessing the path a branch might take.
|
|
<P>
|
|
|
|
With <SAMP>`-fbranch-probabilities'</SAMP>, GCC puts a <SAMP>`REG_EXEC_COUNT'</SAMP>
|
|
note on the first instruction of each basic block, and a
|
|
<SAMP>`REG_BR_PROB'</SAMP> note on each <SAMP>`JUMP_INSN'</SAMP> and <SAMP>`CALL_INSN'</SAMP>.
|
|
These can be used to improve optimization. Currently, they are only
|
|
used in one place: in <TT>`reorg.c'</TT>, instead of guessing which path a
|
|
branch is mostly to take, the <SAMP>`REG_BR_PROB'</SAMP> values are used to
|
|
exactly determine which path is taken more often.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fstrict-aliasing</CODE>
|
|
<DD>Allows the compiler to assume the strictest aliasing rules applicable to
|
|
the language being compiled. For C (and C++), this activates
|
|
optimizations based on the type of expressions. In particular, an
|
|
object of one type is assumed never to reside at the same address as an
|
|
object of a different type, unless the types are almost the same. For
|
|
example, an <CODE>unsigned int</CODE> can alias an <CODE>int</CODE>, but not a
|
|
<CODE>void*</CODE> or a <CODE>double</CODE>. A character type may alias any other
|
|
type.
|
|
<P>
|
|
|
|
Pay special attention to code like this:
|
|
<TABLE><tr><td> </td><td class=example><pre>union a_union {
|
|
int i;
|
|
double d;
|
|
};
|
|
|
|
int f() {
|
|
a_union t;
|
|
t.d = 3.0;
|
|
return t.i;
|
|
}
|
|
</pre></td></tr></table>The practice of reading from a different union member than the one most
|
|
recently written to (called "type-punning") is common. Even with
|
|
<SAMP>`-fstrict-aliasing'</SAMP>, type-punning is allowed, provided the memory
|
|
is accessed through the union type. So, the code above will work as
|
|
expected. However, this code might not:
|
|
<TABLE><tr><td> </td><td class=example><pre>int f() {
|
|
a_union t;
|
|
int* ip;
|
|
t.d = 3.0;
|
|
ip = &t.i;
|
|
return *ip;
|
|
}
|
|
</pre></td></tr></table></P><P>
|
|
|
|
Every language that wishes to perform language-specific alias analysis
|
|
should define a function that computes, given an <CODE>tree</CODE>
|
|
node, an alias set for the node. Nodes in different alias sets are not
|
|
allowed to alias. For an example, see the C front-end function
|
|
<CODE>c_get_alias_set</CODE>.
|
|
</P><P>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Preprocessor Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC11"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC10" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC10"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC12" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC12"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 2.9 Options Controlling the Preprocessor </H2>
|
|
<!--docid::SEC11::-->
|
|
<P>
|
|
|
|
These options control the C preprocessor, which is run on each C source
|
|
file before actual compilation.
|
|
</P><P>
|
|
|
|
If you use the <SAMP>`-E'</SAMP> option, nothing is done except preprocessing.
|
|
Some of these options make sense only together with <SAMP>`-E'</SAMP> because
|
|
they cause the preprocessor output to be unsuitable for actual
|
|
compilation.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-include <VAR>file</VAR></CODE>
|
|
<DD>Process <VAR>file</VAR> as input before processing the regular input file.
|
|
In effect, the contents of <VAR>file</VAR> are compiled first. Any <SAMP>`-D'</SAMP>
|
|
and <SAMP>`-U'</SAMP> options on the command line are always processed before
|
|
<SAMP>`-include <VAR>file</VAR>'</SAMP>, regardless of the order in which they are
|
|
written. All the <SAMP>`-include'</SAMP> and <SAMP>`-imacros'</SAMP> options are
|
|
processed in the order in which they are written.
|
|
<P>
|
|
|
|
<DT><CODE>-imacros <VAR>file</VAR></CODE>
|
|
<DD>Process <VAR>file</VAR> as input, discarding the resulting output, before
|
|
processing the regular input file. Because the output generated from
|
|
<VAR>file</VAR> is discarded, the only effect of <SAMP>`-imacros <VAR>file</VAR>'</SAMP>
|
|
is to make the macros defined in <VAR>file</VAR> available for use in the
|
|
main input.
|
|
<P>
|
|
|
|
Any <SAMP>`-D'</SAMP> and <SAMP>`-U'</SAMP> options on the command line are always
|
|
processed before <SAMP>`-imacros <VAR>file</VAR>'</SAMP>, regardless of the order in
|
|
which they are written. All the <SAMP>`-include'</SAMP> and <SAMP>`-imacros'</SAMP>
|
|
options are processed in the order in which they are written.
|
|
</P><P>
|
|
|
|
<DT><CODE>-idirafter <VAR>dir</VAR></CODE>
|
|
<DD><A NAME="IDX71"></A>
|
|
Add the directory <VAR>dir</VAR> to the second include path. The directories
|
|
on the second include path are searched when a header file is not found
|
|
in any of the directories in the main include path (the one that
|
|
<SAMP>`-I'</SAMP> adds to).
|
|
<P>
|
|
|
|
<DT><CODE>-iprefix <VAR>prefix</VAR></CODE>
|
|
<DD>Specify <VAR>prefix</VAR> as the prefix for subsequent <SAMP>`-iwithprefix'</SAMP>
|
|
options.
|
|
<P>
|
|
|
|
<DT><CODE>-iwithprefix <VAR>dir</VAR></CODE>
|
|
<DD>Add a directory to the second include path. The directory's name is
|
|
made by concatenating <VAR>prefix</VAR> and <VAR>dir</VAR>, where <VAR>prefix</VAR> was
|
|
specified previously with <SAMP>`-iprefix'</SAMP>. If you have not specified a
|
|
prefix yet, the directory containing the installed passes of the
|
|
compiler is used as the default.
|
|
<P>
|
|
|
|
<DT><CODE>-iwithprefixbefore <VAR>dir</VAR></CODE>
|
|
<DD>Add a directory to the main include path. The directory's name is made
|
|
by concatenating <VAR>prefix</VAR> and <VAR>dir</VAR>, as in the case of
|
|
<SAMP>`-iwithprefix'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-isystem <VAR>dir</VAR></CODE>
|
|
<DD>Add a directory to the beginning of the second include path, marking it
|
|
as a system directory, so that it gets the same special treatment as
|
|
is applied to the standard system directories.
|
|
<P>
|
|
|
|
<DT><CODE>-nostdinc</CODE>
|
|
<DD>Do not search the standard system directories for header files. Only
|
|
the directories you have specified with <SAMP>`-I'</SAMP> options (and the
|
|
current directory, if appropriate) are searched. See section <A HREF="gcc_2.html#SEC14" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC14">2.12 Options for Directory Search</A>, for information on <SAMP>`-I'</SAMP>.
|
|
<P>
|
|
|
|
By using both <SAMP>`-nostdinc'</SAMP> and <SAMP>`-I-'</SAMP>, you can limit the include-file
|
|
search path to only those directories you specify explicitly.
|
|
</P><P>
|
|
|
|
<DT><CODE>-undef</CODE>
|
|
<DD>Do not predefine any nonstandard macros. (Including architecture flags).
|
|
<P>
|
|
|
|
<DT><CODE>-E</CODE>
|
|
<DD>Run only the C preprocessor. Preprocess all the C source files
|
|
specified and output the results to standard output or to the
|
|
specified output file.
|
|
<P>
|
|
|
|
<DT><CODE>-C</CODE>
|
|
<DD>Tell the preprocessor not to discard comments. Used with the
|
|
<SAMP>`-E'</SAMP> option.
|
|
<P>
|
|
|
|
<DT><CODE>-P</CODE>
|
|
<DD>Tell the preprocessor not to generate <SAMP>`#line'</SAMP> directives.
|
|
Used with the <SAMP>`-E'</SAMP> option.
|
|
<P>
|
|
|
|
<A NAME="IDX72"></A>
|
|
<A NAME="IDX73"></A>
|
|
<DT><CODE>-M</CODE>
|
|
<DD>Tell the preprocessor to output a rule suitable for <CODE>make</CODE>
|
|
describing the dependencies of each object file. For each source file,
|
|
the preprocessor outputs one <CODE>make</CODE>-rule whose target is the object
|
|
file name for that source file and whose dependencies are all the
|
|
<CODE>#include</CODE> header files it uses. This rule may be a single line or
|
|
may be continued with <SAMP>`\'</SAMP>-newline if it is long. The list of rules
|
|
is printed on standard output instead of the preprocessed C program.
|
|
<P>
|
|
|
|
<SAMP>`-M'</SAMP> implies <SAMP>`-E'</SAMP>.
|
|
</P><P>
|
|
|
|
Another way to specify output of a <CODE>make</CODE> rule is by setting
|
|
the environment variable <CODE>DEPENDENCIES_OUTPUT</CODE> (see section <A HREF="gcc_2.html#SEC44" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC44">2.16 Environment Variables Affecting GCC</A>).
|
|
</P><P>
|
|
|
|
<DT><CODE>-MM</CODE>
|
|
<DD>Like <SAMP>`-M'</SAMP> but the output mentions only the user header files
|
|
included with <SAMP>`#include "<VAR>file</VAR>"'</SAMP>. System header files
|
|
included with <SAMP>`#include <<VAR>file</VAR>>'</SAMP> are omitted.
|
|
<P>
|
|
|
|
<DT><CODE>-MD</CODE>
|
|
<DD>Like <SAMP>`-M'</SAMP> but the dependency information is written to a file made by
|
|
replacing ".c" with ".d" at the end of the input file names.
|
|
This is in addition to compiling the file as specified---<SAMP>`-MD'</SAMP> does
|
|
not inhibit ordinary compilation the way <SAMP>`-M'</SAMP> does.
|
|
<P>
|
|
|
|
In Mach, you can use the utility <CODE>md</CODE> to merge multiple dependency
|
|
files into a single dependency file suitable for using with the <SAMP>`make'</SAMP>
|
|
command.
|
|
</P><P>
|
|
|
|
<DT><CODE>-MMD</CODE>
|
|
<DD>Like <SAMP>`-MD'</SAMP> except mention only user header files, not system
|
|
header files.
|
|
<P>
|
|
|
|
<DT><CODE>-MG</CODE>
|
|
<DD>Treat missing header files as generated files and assume they live in the
|
|
same directory as the source file. If you specify <SAMP>`-MG'</SAMP>, you
|
|
must also specify either <SAMP>`-M'</SAMP> or <SAMP>`-MM'</SAMP>. <SAMP>`-MG'</SAMP> is not
|
|
supported with <SAMP>`-MD'</SAMP> or <SAMP>`-MMD'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-H</CODE>
|
|
<DD>Print the name of each header file used, in addition to other normal
|
|
activities.
|
|
<P>
|
|
|
|
<DT><CODE>-A<VAR>question</VAR>(<VAR>answer</VAR>)</CODE>
|
|
<DD>Assert the answer <VAR>answer</VAR> for <VAR>question</VAR>, in case it is tested
|
|
with a preprocessing conditional such as <SAMP>`#if
|
|
#<VAR>question</VAR>(<VAR>answer</VAR>)'</SAMP>. <SAMP>`-A-'</SAMP> disables the standard
|
|
assertions that normally describe the target machine.
|
|
<P>
|
|
|
|
<DT><CODE>-D<VAR>macro</VAR></CODE>
|
|
<DD>Define macro <VAR>macro</VAR> with the string <SAMP>`1'</SAMP> as its definition.
|
|
<P>
|
|
|
|
<DT><CODE>-D<VAR>macro</VAR>=<VAR>defn</VAR></CODE>
|
|
<DD>Define macro <VAR>macro</VAR> as <VAR>defn</VAR>. All instances of <SAMP>`-D'</SAMP> on
|
|
the command line are processed before any <SAMP>`-U'</SAMP> options.
|
|
<P>
|
|
|
|
<DT><CODE>-U<VAR>macro</VAR></CODE>
|
|
<DD>Undefine macro <VAR>macro</VAR>. <SAMP>`-U'</SAMP> options are evaluated after all
|
|
<SAMP>`-D'</SAMP> options, but before any <SAMP>`-include'</SAMP> and <SAMP>`-imacros'</SAMP>
|
|
options.
|
|
<P>
|
|
|
|
<DT><CODE>-dM</CODE>
|
|
<DD>Tell the preprocessor to output only a list of the macro definitions
|
|
that are in effect at the end of preprocessing. Used with the <SAMP>`-E'</SAMP>
|
|
option.
|
|
<P>
|
|
|
|
<DT><CODE>-dD</CODE>
|
|
<DD>Tell the preprocessing to pass all macro definitions into the output, in
|
|
their proper sequence in the rest of the output.
|
|
<P>
|
|
|
|
<DT><CODE>-dN</CODE>
|
|
<DD>Like <SAMP>`-dD'</SAMP> except that the macro arguments and contents are omitted.
|
|
Only <SAMP>`#define <VAR>name</VAR>'</SAMP> is included in the output.
|
|
<P>
|
|
|
|
<DT><CODE>-trigraphs</CODE>
|
|
<DD>Support ANSI C trigraphs. The <SAMP>`-ansi'</SAMP> option also has this effect.
|
|
<P>
|
|
|
|
<DT><CODE>-Wp,<VAR>option</VAR></CODE>
|
|
<DD>Pass <VAR>option</VAR> as an option to the preprocessor. If <VAR>option</VAR>
|
|
contains commas, it is split into multiple options at the commas.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Assembler Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC12"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC11" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC11"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC13" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC13"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC4" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC4"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 2.10 Passing Options to the Assembler </H2>
|
|
<!--docid::SEC12::-->
|
|
<P>
|
|
|
|
You can pass options to the assembler.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-Wa,<VAR>option</VAR></CODE>
|
|
<DD>Pass <VAR>option</VAR> as an option to the assembler. If <VAR>option</VAR>
|
|
contains commas, it is split into multiple options at the commas.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Link Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC13"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC12" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC12"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC14" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC14"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC4" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC4"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 2.11 Options for Linking </H2>
|
|
<!--docid::SEC13::-->
|
|
<P>
|
|
|
|
These options come into play when the compiler links object files into
|
|
an executable output file. They are meaningless if the compiler is
|
|
not doing a link step.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<A NAME="IDX74"></A>
|
|
<DT><CODE><VAR>object-file-name</VAR></CODE>
|
|
<DD>A file name that does not end in a special recognized suffix is
|
|
considered to name an object file or library. (Object files are
|
|
distinguished from libraries by the linker according to the file
|
|
contents.) If linking is done, these object files are used as input
|
|
to the linker.
|
|
<P>
|
|
|
|
<DT><CODE>-c</CODE>
|
|
<DD><DT><CODE>-S</CODE>
|
|
<DD><DT><CODE>-E</CODE>
|
|
<DD>If any of these options is used, then the linker is not run, and
|
|
object file names should not be used as arguments. See section <A HREF="gcc_2.html#SEC4" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC4">2.2 Options Controlling the Kind of Output</A>.
|
|
<P>
|
|
|
|
<A NAME="IDX75"></A>
|
|
<DT><CODE>-l<VAR>library</VAR></CODE>
|
|
<DD>Search the library named <VAR>library</VAR> when linking.
|
|
<P>
|
|
|
|
It makes a difference where in the command you write this option; the
|
|
linker searches processes libraries and object files in the order they
|
|
are specified. Thus, <SAMP>`foo.o -lz bar.o'</SAMP> searches library <SAMP>`z'</SAMP>
|
|
after file <TT>`foo.o'</TT> but before <TT>`bar.o'</TT>. If <TT>`bar.o'</TT> refers
|
|
to functions in <SAMP>`z'</SAMP>, those functions may not be loaded.
|
|
</P><P>
|
|
|
|
The linker searches a standard list of directories for the library,
|
|
which is actually a file named <TT>`lib<VAR>library</VAR>.a'</TT>. The linker
|
|
then uses this file as if it had been specified precisely by name.
|
|
</P><P>
|
|
|
|
The directories searched include several standard system directories
|
|
plus any that you specify with <SAMP>`-L'</SAMP>.
|
|
</P><P>
|
|
|
|
Normally the files found this way are library files--archive files
|
|
whose members are object files. The linker handles an archive file by
|
|
scanning through it for members which define symbols that have so far
|
|
been referenced but not defined. But if the file that is found is an
|
|
ordinary object file, it is linked in the usual fashion. The only
|
|
difference between using an <SAMP>`-l'</SAMP> option and specifying a file name
|
|
is that <SAMP>`-l'</SAMP> surrounds <VAR>library</VAR> with <SAMP>`lib'</SAMP> and <SAMP>`.a'</SAMP>
|
|
and searches several directories.
|
|
</P><P>
|
|
|
|
<DT><CODE>-lobjc</CODE>
|
|
<DD>You need this special case of the <SAMP>`-l'</SAMP> option in order to
|
|
link an Objective C program.
|
|
<P>
|
|
|
|
<DT><CODE>-nostartfiles</CODE>
|
|
<DD>Do not use the standard system startup files when linking.
|
|
The standard system libraries are used normally, unless <CODE>-nostdlib</CODE>
|
|
or <CODE>-nodefaultlibs</CODE> is used.
|
|
<P>
|
|
|
|
<DT><CODE>-nodefaultlibs</CODE>
|
|
<DD>Do not use the standard system libraries when linking.
|
|
Only the libraries you specify will be passed to the linker.
|
|
The standard startup files are used normally, unless <CODE>-nostartfiles</CODE>
|
|
is used. The compiler may generate calls to memcmp, memset, and memcpy
|
|
for System V (and ANSI C) environments or to bcopy and bzero for
|
|
BSD environments. These entries are usually resolved by entries in
|
|
libc. These entry points should be supplied through some other
|
|
mechanism when this option is specified.
|
|
<P>
|
|
|
|
<DT><CODE>-nostdlib</CODE>
|
|
<DD>Do not use the standard system startup files or libraries when linking.
|
|
No startup files and only the libraries you specify will be passed to
|
|
the linker. The compiler may generate calls to memcmp, memset, and memcpy
|
|
for System V (and ANSI C) environments or to bcopy and bzero for
|
|
BSD environments. These entries are usually resolved by entries in
|
|
libc. These entry points should be supplied through some other
|
|
mechanism when this option is specified.
|
|
<P>
|
|
|
|
<A NAME="IDX76"></A>
|
|
<A NAME="IDX77"></A>
|
|
<A NAME="IDX78"></A>
|
|
<A NAME="IDX79"></A>
|
|
<A NAME="IDX80"></A>
|
|
<A NAME="IDX81"></A>
|
|
One of the standard libraries bypassed by <SAMP>`-nostdlib'</SAMP> and
|
|
<SAMP>`-nodefaultlibs'</SAMP> is <TT>`libgcc.a'</TT>, a library of internal subroutines
|
|
that GCC uses to overcome shortcomings of particular machines, or special
|
|
needs for some languages.
|
|
(See section <A HREF="gcc_13.html#SEC147" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_13.html#SEC147">Interfacing to GCC Output</A>, for more discussion of
|
|
<TT>`libgcc.a'</TT>.)
|
|
In most cases, you need <TT>`libgcc.a'</TT> even when you want to avoid
|
|
other standard libraries. In other words, when you specify <SAMP>`-nostdlib'</SAMP>
|
|
or <SAMP>`-nodefaultlibs'</SAMP> you should usually specify <SAMP>`-lgcc'</SAMP> as well.
|
|
This ensures that you have no unresolved references to internal GCC
|
|
library subroutines. (For example, <SAMP>`__main'</SAMP>, used to ensure C++
|
|
constructors will be called; see section <A HREF="gcc_3.html#SEC59" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC59"><CODE>collect2</CODE></A>.)
|
|
</P><P>
|
|
|
|
<DT><CODE>-s</CODE>
|
|
<DD>Remove all symbol table and relocation information from the executable.
|
|
<P>
|
|
|
|
<DT><CODE>-static</CODE>
|
|
<DD>On systems that support dynamic linking, this prevents linking with the shared
|
|
libraries. On other systems, this option has no effect.
|
|
<P>
|
|
|
|
<DT><CODE>-shared</CODE>
|
|
<DD>Produce a shared object which can then be linked with other objects to
|
|
form an executable. Not all systems support this option. You must
|
|
also specify <SAMP>`-fpic'</SAMP> or <SAMP>`-fPIC'</SAMP> on some systems when
|
|
you specify this option.
|
|
<P>
|
|
|
|
<DT><CODE>-symbolic</CODE>
|
|
<DD>Bind references to global symbols when building a shared object. Warn
|
|
about any unresolved references (unless overridden by the link editor
|
|
option <SAMP>`-Xlinker -z -Xlinker defs'</SAMP>). Only a few systems support
|
|
this option.
|
|
<P>
|
|
|
|
<DT><CODE>-Xlinker <VAR>option</VAR></CODE>
|
|
<DD>Pass <VAR>option</VAR> as an option to the linker. You can use this to
|
|
supply system-specific linker options which GCC does not know how to
|
|
recognize.
|
|
<P>
|
|
|
|
If you want to pass an option that takes an argument, you must use
|
|
<SAMP>`-Xlinker'</SAMP> twice, once for the option and once for the argument.
|
|
For example, to pass <SAMP>`-assert definitions'</SAMP>, you must write
|
|
<SAMP>`-Xlinker -assert -Xlinker definitions'</SAMP>. It does not work to write
|
|
<SAMP>`-Xlinker "-assert definitions"'</SAMP>, because this passes the entire
|
|
string as a single argument, which is not what the linker expects.
|
|
</P><P>
|
|
|
|
<DT><CODE>-Wl,<VAR>option</VAR></CODE>
|
|
<DD>Pass <VAR>option</VAR> as an option to the linker. If <VAR>option</VAR> contains
|
|
commas, it is split into multiple options at the commas.
|
|
<P>
|
|
|
|
<DT><CODE>-u <VAR>symbol</VAR></CODE>
|
|
<DD>Pretend the symbol <VAR>symbol</VAR> is undefined, to force linking of
|
|
library modules to define it. You can use <SAMP>`-u'</SAMP> multiple times with
|
|
different symbols to force loading of additional library modules.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Directory Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC14"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC13" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC13"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC15" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC15"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC4" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC4"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 2.12 Options for Directory Search </H2>
|
|
<!--docid::SEC14::-->
|
|
<P>
|
|
|
|
These options specify directories to search for header files, for
|
|
libraries and for parts of the compiler:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-I<VAR>dir</VAR></CODE>
|
|
<DD>Add the directory <VAR>dir</VAR> to the head of the list of directories to be
|
|
searched for header files. This can be used to override a system header
|
|
file, substituting your own version, since these directories are
|
|
searched before the system header file directories. If you use more
|
|
than one <SAMP>`-I'</SAMP> option, the directories are scanned in left-to-right
|
|
order; the standard system directories come after.
|
|
<P>
|
|
|
|
<DT><CODE>-I-</CODE>
|
|
<DD>Any directories you specify with <SAMP>`-I'</SAMP> options before the <SAMP>`-I-'</SAMP>
|
|
option are searched only for the case of <SAMP>`#include "<VAR>file</VAR>"'</SAMP>;
|
|
they are not searched for <SAMP>`#include <<VAR>file</VAR>>'</SAMP>.
|
|
<P>
|
|
|
|
If additional directories are specified with <SAMP>`-I'</SAMP> options after
|
|
the <SAMP>`-I-'</SAMP>, these directories are searched for all <SAMP>`#include'</SAMP>
|
|
directives. (Ordinarily <EM>all</EM> <SAMP>`-I'</SAMP> directories are used
|
|
this way.)
|
|
</P><P>
|
|
|
|
In addition, the <SAMP>`-I-'</SAMP> option inhibits the use of the current
|
|
directory (where the current input file came from) as the first search
|
|
directory for <SAMP>`#include "<VAR>file</VAR>"'</SAMP>. There is no way to
|
|
override this effect of <SAMP>`-I-'</SAMP>. With <SAMP>`-I.'</SAMP> you can specify
|
|
searching the directory which was current when the compiler was
|
|
invoked. That is not exactly the same as what the preprocessor does
|
|
by default, but it is often satisfactory.
|
|
</P><P>
|
|
|
|
<SAMP>`-I-'</SAMP> does not inhibit the use of the standard system directories
|
|
for header files. Thus, <SAMP>`-I-'</SAMP> and <SAMP>`-nostdinc'</SAMP> are
|
|
independent.
|
|
</P><P>
|
|
|
|
<DT><CODE>-L<VAR>dir</VAR></CODE>
|
|
<DD>Add directory <VAR>dir</VAR> to the list of directories to be searched
|
|
for <SAMP>`-l'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-B<VAR>prefix</VAR></CODE>
|
|
<DD>This option specifies where to find the executables, libraries,
|
|
include files, and data files of the compiler itself.
|
|
<P>
|
|
|
|
The compiler driver program runs one or more of the subprograms
|
|
<TT>`cpp'</TT>, <TT>`cc1'</TT>, <TT>`as'</TT> and <TT>`ld'</TT>. It tries
|
|
<VAR>prefix</VAR> as a prefix for each program it tries to run, both with and
|
|
without <SAMP>`<VAR>machine</VAR>/<VAR>version</VAR>/'</SAMP> (see section <A HREF="gcc_2.html#SEC15" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC15">2.13 Specifying Target Machine and Compiler Version</A>).
|
|
</P><P>
|
|
|
|
For each subprogram to be run, the compiler driver first tries the
|
|
<SAMP>`-B'</SAMP> prefix, if any. If that name is not found, or if <SAMP>`-B'</SAMP>
|
|
was not specified, the driver tries two standard prefixes, which are
|
|
<TT>`/usr/lib/gcc/'</TT> and <TT>`/usr/local/lib/gcc-lib/'</TT>. If neither of
|
|
those results in a file name that is found, the unmodified program
|
|
name is searched for using the directories specified in your
|
|
<SAMP>`PATH'</SAMP> environment variable.
|
|
</P><P>
|
|
|
|
<SAMP>`-B'</SAMP> prefixes that effectively specify directory names also apply
|
|
to libraries in the linker, because the compiler translates these
|
|
options into <SAMP>`-L'</SAMP> options for the linker. They also apply to
|
|
includes files in the preprocessor, because the compiler translates these
|
|
options into <SAMP>`-isystem'</SAMP> options for the preprocessor. In this case,
|
|
the compiler appends <SAMP>`include'</SAMP> to the prefix.
|
|
</P><P>
|
|
|
|
The run-time support file <TT>`libgcc.a'</TT> can also be searched for using
|
|
the <SAMP>`-B'</SAMP> prefix, if needed. If it is not found there, the two
|
|
standard prefixes above are tried, and that is all. The file is left
|
|
out of the link if it is not found by those means.
|
|
</P><P>
|
|
|
|
Another way to specify a prefix much like the <SAMP>`-B'</SAMP> prefix is to use
|
|
the environment variable <CODE>GCC_EXEC_PREFIX</CODE>. See section <A HREF="gcc_2.html#SEC44" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC44">2.16 Environment Variables Affecting GCC</A>.
|
|
</P><P>
|
|
|
|
<DT><CODE>-specs=<VAR>file</VAR></CODE>
|
|
<DD>Process <VAR>file</VAR> after the compiler reads in the standard <TT>`specs'</TT>
|
|
file, in order to override the defaults that the <TT>`gcc'</TT> driver
|
|
program uses when determining what switches to pass to <TT>`cc1'</TT>,
|
|
<TT>`cc1plus'</TT>, <TT>`as'</TT>, <TT>`ld'</TT>, etc. More than one
|
|
<SAMP>`-specs='</SAMP><VAR>file</VAR> can be specified on the command line, and they
|
|
are processed in order, from left to right.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Target Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC15"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC14" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC14"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC4" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC4"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 2.13 Specifying Target Machine and Compiler Version </H2>
|
|
<!--docid::SEC15::-->
|
|
<P>
|
|
|
|
By default, GCC compiles code for the same type of machine that you
|
|
are using. However, it can also be installed as a cross-compiler, to
|
|
compile for some other type of machine. In fact, several different
|
|
configurations of GCC, for different target machines, can be
|
|
installed side by side. Then you specify which one to use with the
|
|
<SAMP>`-b'</SAMP> option.
|
|
</P><P>
|
|
|
|
In addition, older and newer versions of GCC can be installed side
|
|
by side. One of them (probably the newest) will be the default, but
|
|
you may sometimes wish to use another.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-b <VAR>machine</VAR></CODE>
|
|
<DD>The argument <VAR>machine</VAR> specifies the target machine for compilation.
|
|
This is useful when you have installed GCC as a cross-compiler.
|
|
<P>
|
|
|
|
The value to use for <VAR>machine</VAR> is the same as was specified as the
|
|
machine type when configuring GCC as a cross-compiler. For
|
|
example, if a cross-compiler was configured with <SAMP>`configure
|
|
i386v'</SAMP>, meaning to compile for an 80386 running System V, then you
|
|
would specify <SAMP>`-b i386v'</SAMP> to run that cross compiler.
|
|
</P><P>
|
|
|
|
When you do not specify <SAMP>`-b'</SAMP>, it normally means to compile for
|
|
the same type of machine that you are using.
|
|
</P><P>
|
|
|
|
<DT><CODE>-V <VAR>version</VAR></CODE>
|
|
<DD>The argument <VAR>version</VAR> specifies which version of GCC to run.
|
|
This is useful when multiple versions are installed. For example,
|
|
<VAR>version</VAR> might be <SAMP>`2.0'</SAMP>, meaning to run GCC version 2.0.
|
|
<P>
|
|
|
|
The default version, when you do not specify <SAMP>`-V'</SAMP>, is the last
|
|
version of GCC that you installed.
|
|
</DL>
|
|
<P>
|
|
|
|
The <SAMP>`-b'</SAMP> and <SAMP>`-V'</SAMP> options actually work by controlling part of
|
|
the file name used for the executable files and libraries used for
|
|
compilation. A given version of GCC, for a given target machine, is
|
|
normally kept in the directory <TT>`/usr/local/lib/gcc-lib/<VAR>machine</VAR>/<VAR>version</VAR>'</TT>.</P><P>
|
|
|
|
Thus, sites can customize the effect of <SAMP>`-b'</SAMP> or <SAMP>`-V'</SAMP> either by
|
|
changing the names of these directories or adding alternate names (or
|
|
symbolic links). If in directory <TT>`/usr/local/lib/gcc-lib/'</TT> the
|
|
file <TT>`80386'</TT> is a link to the file <TT>`i386v'</TT>, then <SAMP>`-b
|
|
80386'</SAMP> becomes an alias for <SAMP>`-b i386v'</SAMP>.
|
|
</P><P>
|
|
|
|
In one respect, the <SAMP>`-b'</SAMP> or <SAMP>`-V'</SAMP> do not completely change
|
|
to a different compiler: the top-level driver program <CODE>gcc</CODE>
|
|
that you originally invoked continues to run and invoke the other
|
|
executables (preprocessor, compiler per se, assembler and linker)
|
|
that do the real work. However, since no real work is done in the
|
|
driver program, it usually does not matter that the driver program
|
|
in use is not the one for the specified target and version.
|
|
</P><P>
|
|
|
|
The only way that the driver program depends on the target machine is
|
|
in the parsing and handling of special machine-specific options.
|
|
However, this is controlled by a file which is found, along with the
|
|
other executables, in the directory for the specified version and
|
|
target machine. As a result, a single installed driver program adapts
|
|
to any specified target machine and compiler version.
|
|
</P><P>
|
|
|
|
The driver program executable does control one significant thing,
|
|
however: the default version and target machine. Therefore, you can
|
|
install different instances of the driver program, compiled for
|
|
different targets or versions, under different names.
|
|
</P><P>
|
|
|
|
For example, if the driver for version 2.0 is installed as <CODE>ogcc</CODE>
|
|
and that for version 2.1 is installed as <CODE>gcc</CODE>, then the command
|
|
<CODE>gcc</CODE> will use version 2.1 by default, while <CODE>ogcc</CODE> will use
|
|
2.0 by default. However, you can choose either version with either
|
|
command with the <SAMP>`-V'</SAMP> option.
|
|
</P><P>
|
|
|
|
<A NAME="Submodel Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC16"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC15" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC15"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC17" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC17"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC4" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC4"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 2.14 Hardware Models and Configurations </H2>
|
|
<!--docid::SEC16::-->
|
|
<P>
|
|
|
|
Earlier we discussed the standard option <SAMP>`-b'</SAMP> which chooses among
|
|
different installed compilers for completely different target
|
|
machines, such as Vax vs. 68000 vs. 80386.
|
|
</P><P>
|
|
|
|
In addition, each of these target machine types can have its own
|
|
special options, starting with <SAMP>`-m'</SAMP>, to choose among various
|
|
hardware models or configurations--for example, 68010 vs 68020,
|
|
floating coprocessor or none. A single installed version of the
|
|
compiler can compile for any model or configuration, according to the
|
|
options specified.
|
|
</P><P>
|
|
|
|
Some configurations of the compiler also support additional special
|
|
options, usually for compatibility with other compilers on the same
|
|
platform.
|
|
</P><P>
|
|
|
|
These options are defined by the macro <CODE>TARGET_SWITCHES</CODE> in the
|
|
machine description. The default for the options is also defined by
|
|
that macro, which enables you to change the defaults.
|
|
</P><P>
|
|
|
|
<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC17" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC17">2.14.1 M680x0 Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC18" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC18">2.14.2 VAX Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC19" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC19">2.14.3 SPARC Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC20" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC20">2.14.4 Convex Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC21" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC21">2.14.5 AMD29K Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC22" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC22">2.14.6 ARM Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC23" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC23">2.14.7 Thumb Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC24" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC24">2.14.8 MN10200 Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC25" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC25">2.14.9 MN10300 Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC26" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC26">2.14.10 M32R/D Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC27" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC27">2.14.11 M88K Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC28" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC28">2.14.12 IBM RS/6000 and PowerPC Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC29" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC29">2.14.13 IBM RT Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC30" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC30">2.14.14 MIPS Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC31" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC31">2.14.15 Intel 386 Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC32" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC32">2.14.16 HPPA Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC33" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC33">2.14.17 Intel 960 Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC34" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC34">2.14.18 DEC Alpha Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC35" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC35">2.14.19 Clipper Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC36" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC36">2.14.20 H8/300 Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC37" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC37">2.14.21 SH Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC38" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC38">2.14.22 Options for System V</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC39" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC39">2.14.23 TMS320C3x/C4x Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC40" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC40">2.14.24 V850 Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC41" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC41">2.14.25 ARC Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gcc_2.html#SEC42" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC42">2.14.26 NS32K Options</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
|
|
</TABLE></BLOCKQUOTE>
|
|
<P>
|
|
|
|
<A NAME="M680x0 Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC17"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC18" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC18"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC4" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC4"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.1 M680x0 Options </H3>
|
|
<!--docid::SEC17::-->
|
|
<P>
|
|
|
|
These are the <SAMP>`-m'</SAMP> options defined for the 68000 series. The default
|
|
values for these options depends on which style of 68000 was selected when
|
|
the compiler was configured; the defaults for the most common choices are
|
|
given below.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-m68000</CODE>
|
|
<DD><DT><CODE>-mc68000</CODE>
|
|
<DD>Generate output for a 68000. This is the default
|
|
when the compiler is configured for 68000-based systems.
|
|
<P>
|
|
|
|
Use this option for microcontrollers with a 68000 or EC000 core,
|
|
including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
|
|
</P><P>
|
|
|
|
<DT><CODE>-m68020</CODE>
|
|
<DD><DT><CODE>-mc68020</CODE>
|
|
<DD>Generate output for a 68020. This is the default
|
|
when the compiler is configured for 68020-based systems.
|
|
<P>
|
|
|
|
<DT><CODE>-m68881</CODE>
|
|
<DD>Generate output containing 68881 instructions for floating point.
|
|
This is the default for most 68020 systems unless <SAMP>`-nfp'</SAMP> was
|
|
specified when the compiler was configured.
|
|
<P>
|
|
|
|
<DT><CODE>-m68030</CODE>
|
|
<DD>Generate output for a 68030. This is the default when the compiler is
|
|
configured for 68030-based systems.
|
|
<P>
|
|
|
|
<DT><CODE>-m68040</CODE>
|
|
<DD>Generate output for a 68040. This is the default when the compiler is
|
|
configured for 68040-based systems.
|
|
<P>
|
|
|
|
This option inhibits the use of 68881/68882 instructions that have to be
|
|
emulated by software on the 68040. Use this option if your 68040 does not
|
|
have code to emulate those instructions.
|
|
</P><P>
|
|
|
|
<DT><CODE>-m68060</CODE>
|
|
<DD>Generate output for a 68060. This is the default when the compiler is
|
|
configured for 68060-based systems.
|
|
<P>
|
|
|
|
This option inhibits the use of 68020 and 68881/68882 instructions that
|
|
have to be emulated by software on the 68060. Use this option if your 68060
|
|
does not have code to emulate those instructions.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mcpu32</CODE>
|
|
<DD>Generate output for a CPU32. This is the default
|
|
when the compiler is configured for CPU32-based systems.
|
|
<P>
|
|
|
|
Use this option for microcontrollers with a
|
|
CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
|
|
68336, 68340, 68341, 68349 and 68360.
|
|
</P><P>
|
|
|
|
<DT><CODE>-m5200</CODE>
|
|
<DD>Generate output for a 520X "coldfire" family cpu. This is the default
|
|
when the compiler is configured for 520X-based systems.
|
|
<P>
|
|
|
|
Use this option for microcontroller with a 5200 core, including
|
|
the MCF5202, MCF5203, MCF5204 and MCF5202.
|
|
</P><P>
|
|
|
|
<DT><CODE>-m68020-40</CODE>
|
|
<DD>Generate output for a 68040, without using any of the new instructions.
|
|
This results in code which can run relatively efficiently on either a
|
|
68020/68881 or a 68030 or a 68040. The generated code does use the
|
|
68881 instructions that are emulated on the 68040.
|
|
<P>
|
|
|
|
<DT><CODE>-m68020-60</CODE>
|
|
<DD>Generate output for a 68060, without using any of the new instructions.
|
|
This results in code which can run relatively efficiently on either a
|
|
68020/68881 or a 68030 or a 68040. The generated code does use the
|
|
68881 instructions that are emulated on the 68060.
|
|
<P>
|
|
|
|
<DT><CODE>-mfpa</CODE>
|
|
<DD>Generate output containing Sun FPA instructions for floating point.
|
|
<P>
|
|
|
|
<DT><CODE>-msoft-float</CODE>
|
|
<DD>Generate output containing library calls for floating point.
|
|
<STRONG>Warning:</STRONG> the requisite libraries are not available for all m68k
|
|
targets. Normally the facilities of the machine's usual C compiler are
|
|
used, but this can't be done directly in cross-compilation. You must
|
|
make your own arrangements to provide suitable library functions for
|
|
cross-compilation. The embedded targets <SAMP>`m68k-*-aout'</SAMP> and
|
|
<SAMP>`m68k-*-coff'</SAMP> do provide software floating point support.
|
|
<P>
|
|
|
|
<DT><CODE>-mshort</CODE>
|
|
<DD>Consider type <CODE>int</CODE> to be 16 bits wide, like <CODE>short int</CODE>.
|
|
<P>
|
|
|
|
<DT><CODE>-mnobitfield</CODE>
|
|
<DD>Do not use the bit-field instructions. The <SAMP>`-m68000'</SAMP>, <SAMP>`-mcpu32'</SAMP>
|
|
and <SAMP>`-m5200'</SAMP> options imply <SAMP>`-mnobitfield'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mbitfield</CODE>
|
|
<DD>Do use the bit-field instructions. The <SAMP>`-m68020'</SAMP> option implies
|
|
<SAMP>`-mbitfield'</SAMP>. This is the default if you use a configuration
|
|
designed for a 68020.
|
|
<P>
|
|
|
|
<DT><CODE>-mrtd</CODE>
|
|
<DD>Use a different function-calling convention, in which functions
|
|
that take a fixed number of arguments return with the <CODE>rtd</CODE>
|
|
instruction, which pops their arguments while returning. This
|
|
saves one instruction in the caller since there is no need to pop
|
|
the arguments there.
|
|
<P>
|
|
|
|
This calling convention is incompatible with the one normally
|
|
used on Unix, so you cannot use it if you need to call libraries
|
|
compiled with the Unix compiler.
|
|
</P><P>
|
|
|
|
Also, you must provide function prototypes for all functions that
|
|
take variable numbers of arguments (including <CODE>printf</CODE>);
|
|
otherwise incorrect code will be generated for calls to those
|
|
functions.
|
|
</P><P>
|
|
|
|
In addition, seriously incorrect code will result if you call a
|
|
function with too many arguments. (Normally, extra arguments are
|
|
harmlessly ignored.)
|
|
</P><P>
|
|
|
|
The <CODE>rtd</CODE> instruction is supported by the 68010, 68020, 68030,
|
|
68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
|
|
</P><P>
|
|
|
|
<DT><CODE>-malign-int</CODE>
|
|
<DD><DT><CODE>-mno-align-int</CODE>
|
|
<DD>Control whether GCC aligns <CODE>int</CODE>, <CODE>long</CODE>, <CODE>long long</CODE>,
|
|
<CODE>float</CODE>, <CODE>double</CODE>, and <CODE>long double</CODE> variables on a 32-bit
|
|
boundary (<SAMP>`-malign-int'</SAMP>) or a 16-bit boundary (<SAMP>`-mno-align-int'</SAMP>).
|
|
Aligning variables on 32-bit boundaries produces code that runs somewhat
|
|
faster on processors with 32-bit busses at the expense of more memory.
|
|
<P>
|
|
|
|
<STRONG>Warning:</STRONG> if you use the <SAMP>`-malign-int'</SAMP> switch, GCC will
|
|
align structures containing the above types differently than
|
|
most published application binary interface specifications for the m68k.
|
|
</P><P>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="VAX Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC18"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC17" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC17"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC19" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC19"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC19" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC19"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.2 VAX Options </H3>
|
|
<!--docid::SEC18::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for the Vax:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-munix</CODE>
|
|
<DD>Do not output certain jump instructions (<CODE>aobleq</CODE> and so on)
|
|
that the Unix assembler for the Vax cannot handle across long
|
|
ranges.
|
|
<P>
|
|
|
|
<DT><CODE>-mgnu</CODE>
|
|
<DD>Do output those jump instructions, on the assumption that you
|
|
will assemble with the GNU assembler.
|
|
<P>
|
|
|
|
<DT><CODE>-mg</CODE>
|
|
<DD>Output code for g-format floating point numbers instead of d-format.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="SPARC Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC19"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC18" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC18"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC20" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC20"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC20" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC20"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.3 SPARC Options </H3>
|
|
<!--docid::SEC19::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> switches are supported on the SPARC:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-mno-app-regs</CODE>
|
|
<DD><DT><CODE>-mapp-regs</CODE>
|
|
<DD>Specify <SAMP>`-mapp-regs'</SAMP> to generate output using the global registers
|
|
2 through 4, which the SPARC SVR4 ABI reserves for applications. This
|
|
is the default.
|
|
<P>
|
|
|
|
To be fully SVR4 ABI compliant at the cost of some performance loss,
|
|
specify <SAMP>`-mno-app-regs'</SAMP>. You should compile libraries and system
|
|
software with this option.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mfpu</CODE>
|
|
<DD><DT><CODE>-mhard-float</CODE>
|
|
<DD>Generate output containing floating point instructions. This is the
|
|
default.
|
|
<P>
|
|
|
|
<DT><CODE>-mno-fpu</CODE>
|
|
<DD><DT><CODE>-msoft-float</CODE>
|
|
<DD>Generate output containing library calls for floating point.
|
|
<STRONG>Warning:</STRONG> the requisite libraries are not available for all SPARC
|
|
targets. Normally the facilities of the machine's usual C compiler are
|
|
used, but this cannot be done directly in cross-compilation. You must make
|
|
your own arrangements to provide suitable library functions for
|
|
cross-compilation. The embedded targets <SAMP>`sparc-*-aout'</SAMP> and
|
|
<SAMP>`sparclite-*-*'</SAMP> do provide software floating point support.
|
|
<P>
|
|
|
|
<SAMP>`-msoft-float'</SAMP> changes the calling convention in the output file;
|
|
therefore, it is only useful if you compile <EM>all</EM> of a program with
|
|
this option. In particular, you need to compile <TT>`libgcc.a'</TT>, the
|
|
library that comes with GCC, with <SAMP>`-msoft-float'</SAMP> in order for
|
|
this to work.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mhard-quad-float</CODE>
|
|
<DD>Generate output containing quad-word (long double) floating point
|
|
instructions.
|
|
<P>
|
|
|
|
<DT><CODE>-msoft-quad-float</CODE>
|
|
<DD>Generate output containing library calls for quad-word (long double)
|
|
floating point instructions. The functions called are those specified
|
|
in the SPARC ABI. This is the default.
|
|
<P>
|
|
|
|
As of this writing, there are no sparc implementations that have hardware
|
|
support for the quad-word floating point instructions. They all invoke
|
|
a trap handler for one of these instructions, and then the trap handler
|
|
emulates the effect of the instruction. Because of the trap handler overhead,
|
|
this is much slower than calling the ABI library routines. Thus the
|
|
<SAMP>`-msoft-quad-float'</SAMP> option is the default.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mno-epilogue</CODE>
|
|
<DD><DT><CODE>-mepilogue</CODE>
|
|
<DD>With <SAMP>`-mepilogue'</SAMP> (the default), the compiler always emits code for
|
|
function exit at the end of each function. Any function exit in
|
|
the middle of the function (such as a return statement in C) will
|
|
generate a jump to the exit code at the end of the function.
|
|
<P>
|
|
|
|
With <SAMP>`-mno-epilogue'</SAMP>, the compiler tries to emit exit code inline
|
|
at every function exit.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mno-flat</CODE>
|
|
<DD><DT><CODE>-mflat</CODE>
|
|
<DD>With <SAMP>`-mflat'</SAMP>, the compiler does not generate save/restore instructions
|
|
and will use a "flat" or single register window calling convention.
|
|
This model uses %i7 as the frame pointer and is compatible with the normal
|
|
register window model. Code from either may be intermixed.
|
|
The local registers and the input registers (0-5) are still treated as
|
|
"call saved" registers and will be saved on the stack as necessary.
|
|
<P>
|
|
|
|
With <SAMP>`-mno-flat'</SAMP> (the default), the compiler emits save/restore
|
|
instructions (except for leaf functions) and is the normal mode of operation.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mno-unaligned-doubles</CODE>
|
|
<DD><DT><CODE>-munaligned-doubles</CODE>
|
|
<DD>Assume that doubles have 8 byte alignment. This is the default.
|
|
<P>
|
|
|
|
With <SAMP>`-munaligned-doubles'</SAMP>, GCC assumes that doubles have 8 byte
|
|
alignment only if they are contained in another type, or if they have an
|
|
absolute address. Otherwise, it assumes they have 4 byte alignment.
|
|
Specifying this option avoids some rare compatibility problems with code
|
|
generated by other compilers. It is not the default because it results
|
|
in a performance loss, especially for floating point code.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mv8</CODE>
|
|
<DD><DT><CODE>-msparclite</CODE>
|
|
<DD>These two options select variations on the SPARC architecture.
|
|
<P>
|
|
|
|
By default (unless specifically configured for the Fujitsu SPARClite),
|
|
GCC generates code for the v7 variant of the SPARC architecture.
|
|
</P><P>
|
|
|
|
<SAMP>`-mv8'</SAMP> will give you SPARC v8 code. The only difference from v7
|
|
code is that the compiler emits the integer multiply and integer
|
|
divide instructions which exist in SPARC v8 but not in SPARC v7.
|
|
</P><P>
|
|
|
|
<SAMP>`-msparclite'</SAMP> will give you SPARClite code. This adds the integer
|
|
multiply, integer divide step and scan (<CODE>ffs</CODE>) instructions which
|
|
exist in SPARClite but not in SPARC v7.
|
|
</P><P>
|
|
|
|
These options are deprecated and will be deleted in a future GCC release.
|
|
They have been replaced with <SAMP>`-mcpu=xxx'</SAMP>.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mcypress</CODE>
|
|
<DD><DT><CODE>-msupersparc</CODE>
|
|
<DD>These two options select the processor for which the code is optimised.
|
|
<P>
|
|
|
|
With <SAMP>`-mcypress'</SAMP> (the default), the compiler optimizes code for the
|
|
Cypress CY7C602 chip, as used in the SparcStation/SparcServer 3xx series.
|
|
This is also appropriate for the older SparcStation 1, 2, IPX etc.
|
|
</P><P>
|
|
|
|
With <SAMP>`-msupersparc'</SAMP> the compiler optimizes code for the SuperSparc cpu, as
|
|
used in the SparcStation 10, 1000 and 2000 series. This flag also enables use
|
|
of the full SPARC v8 instruction set.
|
|
</P><P>
|
|
|
|
These options are deprecated and will be deleted in a future GCC release.
|
|
They have been replaced with <SAMP>`-mcpu=xxx'</SAMP>.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mcpu=<VAR>cpu_type</VAR></CODE>
|
|
<DD>Set the instruction set, register set, and instruction scheduling parameters
|
|
for machine type <VAR>cpu_type</VAR>. Supported values for <VAR>cpu_type</VAR> are
|
|
<SAMP>`v7'</SAMP>, <SAMP>`cypress'</SAMP>, <SAMP>`v8'</SAMP>, <SAMP>`supersparc'</SAMP>, <SAMP>`sparclite'</SAMP>,
|
|
<SAMP>`hypersparc'</SAMP>, <SAMP>`sparclite86x'</SAMP>, <SAMP>`f930'</SAMP>, <SAMP>`f934'</SAMP>,
|
|
<SAMP>`sparclet'</SAMP>, <SAMP>`tsc701'</SAMP>, <SAMP>`v9'</SAMP>, and <SAMP>`ultrasparc'</SAMP>.
|
|
<P>
|
|
|
|
Default instruction scheduling parameters are used for values that select
|
|
an architecture and not an implementation. These are <SAMP>`v7'</SAMP>, <SAMP>`v8'</SAMP>,
|
|
<SAMP>`sparclite'</SAMP>, <SAMP>`sparclet'</SAMP>, <SAMP>`v9'</SAMP>.
|
|
</P><P>
|
|
|
|
Here is a list of each supported architecture and their supported
|
|
implementations.
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre> v7: cypress
|
|
v8: supersparc, hypersparc
|
|
sparclite: f930, f934, sparclite86x
|
|
sparclet: tsc701
|
|
v9: ultrasparc
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
<DT><CODE>-mtune=<VAR>cpu_type</VAR></CODE>
|
|
<DD>Set the instruction scheduling parameters for machine type
|
|
<VAR>cpu_type</VAR>, but do not set the instruction set or register set that the
|
|
option <SAMP>`-mcpu='</SAMP><VAR>cpu_type</VAR> would.
|
|
<P>
|
|
|
|
The same values for <SAMP>`-mcpu='</SAMP><VAR>cpu_type</VAR> are used for
|
|
<SAMP>`-mtune='</SAMP><BR><VAR>cpu_type</VAR>, though the only useful values are those that
|
|
select a particular cpu implementation: <SAMP>`cypress'</SAMP>, <SAMP>`supersparc'</SAMP>,
|
|
<SAMP>`hypersparc'</SAMP>, <SAMP>`f930'</SAMP>, <SAMP>`f934'</SAMP>, <SAMP>`sparclite86x'</SAMP>,
|
|
<SAMP>`tsc701'</SAMP>, <SAMP>`ultrasparc'</SAMP>.
|
|
</P><P>
|
|
|
|
<DT><CODE>-malign-loops=<VAR>num</VAR></CODE>
|
|
<DD>Align loops to a 2 raised to a <VAR>num</VAR> byte boundary. If
|
|
<SAMP>`-malign-loops'</SAMP> is not specified, the default is 2.
|
|
<P>
|
|
|
|
<DT><CODE>-malign-jumps=<VAR>num</VAR></CODE>
|
|
<DD>Align instructions that are only jumped to to a 2 raised to a <VAR>num</VAR>
|
|
byte boundary. If <SAMP>`-malign-jumps'</SAMP> is not specified, the default is 2.
|
|
<P>
|
|
|
|
<DT><CODE>-malign-functions=<VAR>num</VAR></CODE>
|
|
<DD>Align the start of functions to a 2 raised to <VAR>num</VAR> byte boundary.
|
|
If <SAMP>`-malign-functions'</SAMP> is not specified, the default is 2 if compiling
|
|
for 32 bit sparc, and 5 if compiling for 64 bit sparc.
|
|
<P>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> switches are supported in addition to the above
|
|
on the SPARCLET processor.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-mlittle-endian</CODE>
|
|
<DD>Generate code for a processor running in little-endian mode.
|
|
<P>
|
|
|
|
<DT><CODE>-mlive-g0</CODE>
|
|
<DD>Treat register <CODE>%g0</CODE> as a normal register.
|
|
GCC will continue to clobber it as necessary but will not assume
|
|
it always reads as 0.
|
|
<P>
|
|
|
|
<DT><CODE>-mbroken-saverestore</CODE>
|
|
<DD>Generate code that does not use non-trivial forms of the <CODE>save</CODE> and
|
|
<CODE>restore</CODE> instructions. Early versions of the SPARCLET processor do
|
|
not correctly handle <CODE>save</CODE> and <CODE>restore</CODE> instructions used with
|
|
arguments. They correctly handle them used without arguments. A <CODE>save</CODE>
|
|
instruction used without arguments increments the current window pointer
|
|
but does not allocate a new stack frame. It is assumed that the window
|
|
overflow trap handler will properly handle this case as will interrupt
|
|
handlers.
|
|
</DL>
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> switches are supported in addition to the above
|
|
on SPARC V9 processors in 64 bit environments.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-mlittle-endian</CODE>
|
|
<DD>Generate code for a processor running in little-endian mode.
|
|
<P>
|
|
|
|
<DT><CODE>-m32</CODE>
|
|
<DD><DT><CODE>-m64</CODE>
|
|
<DD>Generate code for a 32 bit or 64 bit environment.
|
|
The 32 bit environment sets int, long and pointer to 32 bits.
|
|
The 64 bit environment sets int to 32 bits and long and pointer
|
|
to 64 bits.
|
|
<P>
|
|
|
|
<DT><CODE>-mcmodel=medlow</CODE>
|
|
<DD>Generate code for the Medium/Low code model: the program must be linked
|
|
in the low 32 bits of the address space. Pointers are 64 bits.
|
|
Programs can be statically or dynamically linked.
|
|
<P>
|
|
|
|
<DT><CODE>-mcmodel=medmid</CODE>
|
|
<DD>Generate code for the Medium/Middle code model: the program must be linked
|
|
in the low 44 bits of the address space, the text segment must be less than
|
|
2G bytes, and data segment must be within 2G of the text segment.
|
|
Pointers are 64 bits.
|
|
<P>
|
|
|
|
<DT><CODE>-mcmodel=medany</CODE>
|
|
<DD>Generate code for the Medium/Anywhere code model: the program may be linked
|
|
anywhere in the address space, the text segment must be less than
|
|
2G bytes, and data segment must be within 2G of the text segment.
|
|
Pointers are 64 bits.
|
|
<P>
|
|
|
|
<DT><CODE>-mcmodel=embmedany</CODE>
|
|
<DD>Generate code for the Medium/Anywhere code model for embedded systems:
|
|
assume a 32 bit text and a 32 bit data segment, both starting anywhere
|
|
(determined at link time). Register %g4 points to the base of the
|
|
data segment. Pointers still 64 bits.
|
|
Programs are statically linked, PIC is not supported.
|
|
<P>
|
|
|
|
<DT><CODE>-mstack-bias</CODE>
|
|
<DD><DT><CODE>-mno-stack-bias</CODE>
|
|
<DD>With <SAMP>`-mstack-bias'</SAMP>, GCC assumes that the stack pointer, and
|
|
frame pointer if present, are offset by -2047 which must be added back
|
|
when making stack frame references.
|
|
Otherwise, assume no such offset is present.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Convex Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC20"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC19" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC19"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC21" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC21"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC21" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC21"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.4 Convex Options </H3>
|
|
<!--docid::SEC20::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for Convex:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-mc1</CODE>
|
|
<DD>Generate output for C1. The code will run on any Convex machine.
|
|
The preprocessor symbol <CODE>__convex__c1__</CODE> is defined.
|
|
<P>
|
|
|
|
<DT><CODE>-mc2</CODE>
|
|
<DD>Generate output for C2. Uses instructions not available on C1.
|
|
Scheduling and other optimizations are chosen for max performance on C2.
|
|
The preprocessor symbol <CODE>__convex_c2__</CODE> is defined.
|
|
<P>
|
|
|
|
<DT><CODE>-mc32</CODE>
|
|
<DD>Generate output for C32xx. Uses instructions not available on C1.
|
|
Scheduling and other optimizations are chosen for max performance on C32.
|
|
The preprocessor symbol <CODE>__convex_c32__</CODE> is defined.
|
|
<P>
|
|
|
|
<DT><CODE>-mc34</CODE>
|
|
<DD>Generate output for C34xx. Uses instructions not available on C1.
|
|
Scheduling and other optimizations are chosen for max performance on C34.
|
|
The preprocessor symbol <CODE>__convex_c34__</CODE> is defined.
|
|
<P>
|
|
|
|
<DT><CODE>-mc38</CODE>
|
|
<DD>Generate output for C38xx. Uses instructions not available on C1.
|
|
Scheduling and other optimizations are chosen for max performance on C38.
|
|
The preprocessor symbol <CODE>__convex_c38__</CODE> is defined.
|
|
<P>
|
|
|
|
<DT><CODE>-margcount</CODE>
|
|
<DD>Generate code which puts an argument count in the word preceding each
|
|
argument list. This is compatible with regular CC, and a few programs
|
|
may need the argument count word. GDB and other source-level debuggers
|
|
do not need it; this info is in the symbol table.
|
|
<P>
|
|
|
|
<DT><CODE>-mnoargcount</CODE>
|
|
<DD>Omit the argument count word. This is the default.
|
|
<P>
|
|
|
|
<DT><CODE>-mvolatile-cache</CODE>
|
|
<DD>Allow volatile references to be cached. This is the default.
|
|
<P>
|
|
|
|
<DT><CODE>-mvolatile-nocache</CODE>
|
|
<DD>Volatile references bypass the data cache, going all the way to memory.
|
|
This is only needed for multi-processor code that does not use standard
|
|
synchronization instructions. Making non-volatile references to volatile
|
|
locations will not necessarily work.
|
|
<P>
|
|
|
|
<DT><CODE>-mlong32</CODE>
|
|
<DD>Type long is 32 bits, the same as type int. This is the default.
|
|
<P>
|
|
|
|
<DT><CODE>-mlong64</CODE>
|
|
<DD>Type long is 64 bits, the same as type long long. This option is useless,
|
|
because no library support exists for it.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="AMD29K Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC21"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC20" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC20"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC22" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC22"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC22" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC22"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.5 AMD29K Options </H3>
|
|
<!--docid::SEC21::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for the AMD Am29000:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-mdw</CODE>
|
|
<DD><A NAME="IDX82"></A>
|
|
<A NAME="IDX83"></A>
|
|
Generate code that assumes the <CODE>DW</CODE> bit is set, i.e., that byte and
|
|
halfword operations are directly supported by the hardware. This is the
|
|
default.
|
|
<P>
|
|
|
|
<DT><CODE>-mndw</CODE>
|
|
<DD><A NAME="IDX84"></A>
|
|
Generate code that assumes the <CODE>DW</CODE> bit is not set.
|
|
<P>
|
|
|
|
<DT><CODE>-mbw</CODE>
|
|
<DD><A NAME="IDX85"></A>
|
|
<A NAME="IDX86"></A>
|
|
Generate code that assumes the system supports byte and halfword write
|
|
operations. This is the default.
|
|
<P>
|
|
|
|
<DT><CODE>-mnbw</CODE>
|
|
<DD><A NAME="IDX87"></A>
|
|
Generate code that assumes the systems does not support byte and
|
|
halfword write operations. <SAMP>`-mnbw'</SAMP> implies <SAMP>`-mndw'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-msmall</CODE>
|
|
<DD><A NAME="IDX88"></A>
|
|
<A NAME="IDX89"></A>
|
|
Use a small memory model that assumes that all function addresses are
|
|
either within a single 256 KB segment or at an absolute address of less
|
|
than 256k. This allows the <CODE>call</CODE> instruction to be used instead
|
|
of a <CODE>const</CODE>, <CODE>consth</CODE>, <CODE>calli</CODE> sequence.
|
|
<P>
|
|
|
|
<DT><CODE>-mnormal</CODE>
|
|
<DD><A NAME="IDX90"></A>
|
|
Use the normal memory model: Generate <CODE>call</CODE> instructions only when
|
|
calling functions in the same file and <CODE>calli</CODE> instructions
|
|
otherwise. This works if each file occupies less than 256 KB but allows
|
|
the entire executable to be larger than 256 KB. This is the default.
|
|
<P>
|
|
|
|
<DT><CODE>-mlarge</CODE>
|
|
<DD>Always use <CODE>calli</CODE> instructions. Specify this option if you expect
|
|
a single file to compile into more than 256 KB of code.
|
|
<P>
|
|
|
|
<DT><CODE>-m29050</CODE>
|
|
<DD><A NAME="IDX91"></A>
|
|
<A NAME="IDX92"></A>
|
|
Generate code for the Am29050.
|
|
<P>
|
|
|
|
<DT><CODE>-m29000</CODE>
|
|
<DD><A NAME="IDX93"></A>
|
|
Generate code for the Am29000. This is the default.
|
|
<P>
|
|
|
|
<DT><CODE>-mkernel-registers</CODE>
|
|
<DD><A NAME="IDX94"></A>
|
|
<A NAME="IDX95"></A>
|
|
Generate references to registers <CODE>gr64-gr95</CODE> instead of to
|
|
registers <CODE>gr96-gr127</CODE>. This option can be used when compiling
|
|
kernel code that wants a set of global registers disjoint from that used
|
|
by user-mode code.
|
|
<P>
|
|
|
|
Note that when this option is used, register names in <SAMP>`-f'</SAMP> flags
|
|
must use the normal, user-mode, names.
|
|
</P><P>
|
|
|
|
<DT><CODE>-muser-registers</CODE>
|
|
<DD><A NAME="IDX96"></A>
|
|
Use the normal set of global registers, <CODE>gr96-gr127</CODE>. This is the
|
|
default.
|
|
<P>
|
|
|
|
<DT><CODE>-mstack-check</CODE>
|
|
<DD><DT><CODE>-mno-stack-check</CODE>
|
|
<DD><A NAME="IDX97"></A>
|
|
<A NAME="IDX98"></A>
|
|
Insert (or do not insert) a call to <CODE>__msp_check</CODE> after each stack
|
|
adjustment. This is often used for kernel code.
|
|
<P>
|
|
|
|
<DT><CODE>-mstorem-bug</CODE>
|
|
<DD><DT><CODE>-mno-storem-bug</CODE>
|
|
<DD><A NAME="IDX99"></A>
|
|
<A NAME="IDX100"></A>
|
|
<SAMP>`-mstorem-bug'</SAMP> handles 29k processors which cannot handle the
|
|
separation of a mtsrim insn and a storem instruction (most 29000 chips
|
|
to date, but not the 29050).
|
|
<P>
|
|
|
|
<DT><CODE>-mno-reuse-arg-regs</CODE>
|
|
<DD><DT><CODE>-mreuse-arg-regs</CODE>
|
|
<DD><A NAME="IDX101"></A>
|
|
<SAMP>`-mno-reuse-arg-regs'</SAMP> tells the compiler to only use incoming argument
|
|
registers for copying out arguments. This helps detect calling a function
|
|
with fewer arguments than it was declared with.
|
|
<P>
|
|
|
|
<DT><CODE>-mno-impure-text</CODE>
|
|
<DD><DT><CODE>-mimpure-text</CODE>
|
|
<DD><A NAME="IDX102"></A>
|
|
<SAMP>`-mimpure-text'</SAMP>, used in addition to <SAMP>`-shared'</SAMP>, tells the compiler to
|
|
not pass <SAMP>`-assert pure-text'</SAMP> to the linker when linking a shared object.
|
|
<P>
|
|
|
|
<DT><CODE>-msoft-float</CODE>
|
|
<DD><A NAME="IDX103"></A>
|
|
Generate output containing library calls for floating point.
|
|
<STRONG>Warning:</STRONG> the requisite libraries are not part of GCC.
|
|
Normally the facilities of the machine's usual C compiler are used, but
|
|
this can't be done directly in cross-compilation. You must make your
|
|
own arrangements to provide suitable library functions for
|
|
cross-compilation.
|
|
<P>
|
|
|
|
<DT><CODE>-mno-multm</CODE>
|
|
<DD><A NAME="IDX104"></A>
|
|
Do not generate multm or multmu instructions. This is useful for some embedded
|
|
systems which do not have trap handlers for these instructions.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="ARM Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC22"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC21" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC21"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC23" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC23"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC23" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC23"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.6 ARM Options </H3>
|
|
<!--docid::SEC22::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for Advanced RISC Machines (ARM)
|
|
architectures:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-mapcs-frame</CODE>
|
|
<DD><A NAME="IDX105"></A>
|
|
Generate a stack frame that is compliant with the ARM Procedure Call
|
|
Standard for all functions, even if this is not strictly necessary for
|
|
correct execution of the code. Specifying <SAMP>`-fomit-frame-pointer'</SAMP>
|
|
with this option will cause the stack frames not to be generated for
|
|
leaf functions. The default is <SAMP>`-mno-apcs-frame'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mapcs</CODE>
|
|
<DD><A NAME="IDX106"></A>
|
|
This is a synonym for <SAMP>`-mapcs-frame'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mapcs-26</CODE>
|
|
<DD><A NAME="IDX107"></A>
|
|
Generate code for a processor running with a 26-bit program counter,
|
|
and conforming to the function calling standards for the APCS 26-bit
|
|
option. This option replaces the <SAMP>`-m2'</SAMP> and <SAMP>`-m3'</SAMP> options
|
|
of previous releases of the compiler.
|
|
<P>
|
|
|
|
<DT><CODE>-mapcs-32</CODE>
|
|
<DD><A NAME="IDX108"></A>
|
|
Generate code for a processor running with a 32-bit program counter,
|
|
and conforming to the function calling standards for the APCS 32-bit
|
|
option. This option replaces the <SAMP>`-m6'</SAMP> option of previous releases
|
|
of the compiler.
|
|
<P>
|
|
|
|
<DT><CODE>-mapcs-stack-check</CODE>
|
|
<DD><A NAME="IDX109"></A>
|
|
<A NAME="IDX110"></A>
|
|
Generate code to check the amount of stack space available upon entry to
|
|
every function (that actually uses some stack space). If there is
|
|
insufficient space available then either the function
|
|
<SAMP>`__rt_stkovf_split_small'</SAMP> or <SAMP>`__rt_stkovf_split_big'</SAMP> will be
|
|
called, depending upon the amount of stack space required. The run time
|
|
system is required to provide these functions. The default is
|
|
<SAMP>`-mno-apcs-stack-check'</SAMP>, since this produces smaller code.
|
|
<P>
|
|
|
|
<DT><CODE>-mapcs-float</CODE>
|
|
<DD><A NAME="IDX111"></A>
|
|
<A NAME="IDX112"></A>
|
|
Pass floating point arguments using the float point registers. This is
|
|
one of the variants of the APCS. This option is reccommended if the
|
|
target hardware has a floating point unit or if a lot of floating point
|
|
arithmetic is going to be performed by the code. The default is
|
|
<SAMP>`-mno-apcs-float'</SAMP>, since integer only code is slightly increased in
|
|
size if <SAMP>`-mapcs-float'</SAMP> is used.
|
|
<P>
|
|
|
|
<DT><CODE>-mapcs-reentrant</CODE>
|
|
<DD><A NAME="IDX113"></A>
|
|
<A NAME="IDX114"></A>
|
|
Generate reentrant, position independent code. This is the equivalent
|
|
to specifying the <SAMP>`-fpic'</SAMP> option. The default is
|
|
<SAMP>`-mno-apcs-reentrant'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mthumb-interwork</CODE>
|
|
<DD><A NAME="IDX115"></A>
|
|
<A NAME="IDX116"></A>
|
|
Generate code which supports calling between the ARM and THUMB
|
|
instruction sets. Without this option the two instruction sets cannot
|
|
be reliably used inside one program. The default is
|
|
<SAMP>`-mno-thumb-interwork'</SAMP>, since slightly larger code is generated
|
|
when <SAMP>`-mthumb-interwork'</SAMP> is specified.
|
|
<P>
|
|
|
|
<DT><CODE>-mno-sched-prolog</CODE>
|
|
<DD><A NAME="IDX117"></A>
|
|
<A NAME="IDX118"></A>
|
|
Prevent the reordering of instructions in the function prolog, or the
|
|
merging of those instruction with the instructions in the function's
|
|
body. This means that all functions will start with a recognisable set
|
|
of instructions (or in fact one of a chioce from a small set of
|
|
different function prologues), and this information can be used to
|
|
locate the start if functions inside an executable piece of code. The
|
|
default is <SAMP>`-msched-prolog'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mhard-float</CODE>
|
|
<DD>Generate output containing floating point instructions. This is the
|
|
default.
|
|
<P>
|
|
|
|
<DT><CODE>-msoft-float</CODE>
|
|
<DD>Generate output containing library calls for floating point.
|
|
<STRONG>Warning:</STRONG> the requisite libraries are not available for all ARM
|
|
targets. Normally the facilities of the machine's usual C compiler are
|
|
used, but this cannot be done directly in cross-compilation. You must make
|
|
your own arrangements to provide suitable library functions for
|
|
cross-compilation.
|
|
<P>
|
|
|
|
<SAMP>`-msoft-float'</SAMP> changes the calling convention in the output file;
|
|
therefore, it is only useful if you compile <EM>all</EM> of a program with
|
|
this option. In particular, you need to compile <TT>`libgcc.a'</TT>, the
|
|
library that comes with GCC, with <SAMP>`-msoft-float'</SAMP> in order for
|
|
this to work.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mlittle-endian</CODE>
|
|
<DD>Generate code for a processor running in little-endian mode. This is
|
|
the default for all standard configurations.
|
|
<P>
|
|
|
|
<DT><CODE>-mbig-endian</CODE>
|
|
<DD>Generate code for a processor running in big-endian mode; the default is
|
|
to compile code for a little-endian processor.
|
|
<P>
|
|
|
|
<DT><CODE>-mwords-little-endian</CODE>
|
|
<DD>This option only applies when generating code for big-endian processors.
|
|
Generate code for a little-endian word order but a big-endian byte
|
|
order. That is, a byte order of the form <SAMP>`32107654'</SAMP>. Note: this
|
|
option should only be used if you require compatibility with code for
|
|
big-endian ARM processors generated by versions of the compiler prior to
|
|
2.8.
|
|
<P>
|
|
|
|
<DT><CODE>-mshort-load-bytes</CODE>
|
|
<DD><A NAME="IDX119"></A>
|
|
Do not try to load half-words (eg <SAMP>`short'</SAMP>s) by loading a word from
|
|
an unaligned address. For some targets the MMU is configured to trap
|
|
unaligned loads; use this option to generate code that is safe in these
|
|
environments.
|
|
<P>
|
|
|
|
<DT><CODE>-mno-short-load-bytes</CODE>
|
|
<DD><A NAME="IDX120"></A>
|
|
Use unaligned word loads to load half-words (eg <SAMP>`short'</SAMP>s). This
|
|
option produces more efficient code, but the MMU is sometimes configured
|
|
to trap these instructions.
|
|
<P>
|
|
|
|
<DT><CODE>-mshort-load-words</CODE>
|
|
<DD><A NAME="IDX121"></A>
|
|
This is a synonym for the <SAMP>`-mno-short-load-bytes'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mno-short-load-words</CODE>
|
|
<DD><A NAME="IDX122"></A>
|
|
This is a synonym for the <SAMP>`-mshort-load-bytes'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mbsd</CODE>
|
|
<DD><A NAME="IDX123"></A>
|
|
This option only applies to RISC iX. Emulate the native BSD-mode
|
|
compiler. This is the default if <SAMP>`-ansi'</SAMP> is not specified.
|
|
<P>
|
|
|
|
<DT><CODE>-mxopen</CODE>
|
|
<DD><A NAME="IDX124"></A>
|
|
This option only applies to RISC iX. Emulate the native X/Open-mode
|
|
compiler.
|
|
<P>
|
|
|
|
<DT><CODE>-mno-symrename</CODE>
|
|
<DD><A NAME="IDX125"></A>
|
|
This option only applies to RISC iX. Do not run the assembler
|
|
post-processor, <SAMP>`symrename'</SAMP>, after code has been assembled.
|
|
Normally it is necessary to modify some of the standard symbols in
|
|
preparation for linking with the RISC iX C library; this option
|
|
suppresses this pass. The post-processor is never run when the
|
|
compiler is built for cross-compilation.
|
|
<P>
|
|
|
|
<DT><CODE>-mcpu=<name></CODE>
|
|
<DD><DT><CODE>-mtune=<name></CODE>
|
|
<DD><A NAME="IDX126"></A>
|
|
<A NAME="IDX127"></A>
|
|
This specifies the name of the target ARM processor. GCC uses this name
|
|
to determine what kind of instructions it can use when generating
|
|
assembly code. Permissable names are: arm2, arm250, arm3, arm6, arm60,
|
|
arm600, arm610, arm620, arm7, arm7m, arm7d, arm7dm, arm7di, arm7dmi,
|
|
arm70, arm700, arm700i, arm710, arm710c, arm7100, arm7500, arm7500fe,
|
|
arm7tdmi, arm8, strongarm, strongarm110, strongarm1100, arm8, arm810,
|
|
arm9, arm9tdmi. <SAMP>`-mtune='</SAMP> is a synonym for <SAMP>`-mcpue='</SAMP> to
|
|
support older versions of GCC.
|
|
<P>
|
|
|
|
<DT><CODE>-march=<name></CODE>
|
|
<DD><A NAME="IDX128"></A>
|
|
This specifies the name of the target ARM architecture. GCC uses this
|
|
name to determine what kind of instructions it can use when generating
|
|
assembly code. This option can be used in conjunction with or instead
|
|
of the <SAMP>`-mcpu='</SAMP> option. Permissable names are: armv2, armv2a,
|
|
armv3, armv3m, armv4, armv4t
|
|
<P>
|
|
|
|
<DT><CODE>-mfpe=<number></CODE>
|
|
<DD><DT><CODE>-mfp=<number></CODE>
|
|
<DD><A NAME="IDX129"></A>
|
|
<A NAME="IDX130"></A>
|
|
This specifes the version of the floating point emulation available on
|
|
the target. Permissable values are 2 and 3. <SAMP>`-mfp='</SAMP> is a synonym
|
|
for <SAMP>`-mfpe='</SAMP> to support older versions of GCC.
|
|
<P>
|
|
|
|
<DT><CODE>-mstructure-size-boundary=<n></CODE>
|
|
<DD><A NAME="IDX131"></A>
|
|
The size of all structures and unions will be rounded up to a multiple
|
|
of the number of bits set by this option. Permissable values are 8 and
|
|
32. The default value varies for different toolchains. For the COFF
|
|
targeted toolchain the default value is 8. Specifying the larger number
|
|
can produced faster, more efficient code, but can also increase the size
|
|
of the program. The two values are potentially incompatible. Code
|
|
compiled with one value cannot necessarily expect to work with code or
|
|
libraries compiled with the other value, if they exchange information
|
|
using structures or unions. Programmers are encouraged to use the 32
|
|
value as future versions of the toolchain may default to this value.
|
|
<P>
|
|
|
|
<DT><CODE>-mabort-on-noreturn</CODE>
|
|
<DD><A NAME="IDX132"></A>
|
|
<A NAME="IDX133"></A>
|
|
Generate a call to the function abort at the end of a noreturn function.
|
|
It will be executed if the function tries to return.
|
|
<P>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Thumb Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC23"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC22" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC22"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC24" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC24"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC24" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC24"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.7 Thumb Options </H3>
|
|
<!--docid::SEC23::-->
|
|
<P>
|
|
|
|
<DL COMPACT>
|
|
|
|
<DT><CODE>-mthumb-interwork</CODE>
|
|
<DD><A NAME="IDX134"></A>
|
|
<A NAME="IDX135"></A>
|
|
Generate code which supports calling between the THUMB and ARM
|
|
instruction sets. Without this option the two instruction sets cannot
|
|
be reliably used inside one program. The default is
|
|
<SAMP>`-mno-thumb-interwork'</SAMP>, since slightly smaller code is generated
|
|
with this option.
|
|
<P>
|
|
|
|
<DT><CODE>-mtpcs-frame</CODE>
|
|
<DD><A NAME="IDX136"></A>
|
|
<A NAME="IDX137"></A>
|
|
Generate a stack frame that is compliant with the Thumb Procedure Call
|
|
Standard for all non-leaf functions. (A leaf function is one that does
|
|
not call any other functions). The default is <SAMP>`-mno-apcs-frame'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mtpcs-leaf-frame</CODE>
|
|
<DD><A NAME="IDX138"></A>
|
|
<A NAME="IDX139"></A>
|
|
Generate a stack frame that is compliant with the Thumb Procedure Call
|
|
Standard for all leaf functions. (A leaf function is one that does
|
|
not call any other functions). The default is <SAMP>`-mno-apcs-leaf-frame'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mlittle-endian</CODE>
|
|
<DD><A NAME="IDX140"></A>
|
|
Generate code for a processor running in little-endian mode. This is
|
|
the default for all standard configurations.
|
|
<P>
|
|
|
|
<DT><CODE>-mbig-endian</CODE>
|
|
<DD><A NAME="IDX141"></A>
|
|
Generate code for a processor running in big-endian mode.
|
|
<P>
|
|
|
|
<DT><CODE>-mstructure-size-boundary=<n></CODE>
|
|
<DD><A NAME="IDX142"></A>
|
|
The size of all structures and unions will be rounded up to a multiple
|
|
of the number of bits set by this option. Permissable values are 8 and
|
|
32. The default value varies for different toolchains. For the COFF
|
|
targeted toolchain the default value is 8. Specifying the larger number
|
|
can produced faster, more efficient code, but can also increase the size
|
|
of the program. The two values are potentially incompatible. Code
|
|
compiled with one value cannot necessarily expect to work with code or
|
|
libraries compiled with the other value, if they exchange information
|
|
using structures or unions. Programmers are encouraged to use the 32
|
|
value as future versions of the toolchain may default to this value.
|
|
<P>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="MN10200 Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC24"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC23" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC23"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC25" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC25"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC25" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC25"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.8 MN10200 Options </H3>
|
|
<!--docid::SEC24::-->
|
|
These <SAMP>`-m'</SAMP> options are defined for Matsushita MN10200 architectures:
|
|
<DL COMPACT>
|
|
|
|
<DT><CODE>-mrelax</CODE>
|
|
<DD>Indicate to the linker that it should perform a relaxation optimization pass
|
|
to shorten branches, calls and absolute memory addresses. This option only
|
|
has an effect when used on the command line for the final link step.
|
|
<P>
|
|
|
|
This option makes symbolic debugging impossible.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="MN10300 Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC25"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC24" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC24"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC26" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC26"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC4" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC4"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.9 MN10300 Options </H3>
|
|
<!--docid::SEC25::-->
|
|
These <SAMP>`-m'</SAMP> options are defined for Matsushita MN10300 architectures:
|
|
<P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-mmult-bug</CODE>
|
|
<DD>Generate code to avoid bugs in the multiply instructions for the MN10300
|
|
processors. This is the default.
|
|
<P>
|
|
|
|
<DT><CODE>-mno-mult-bug</CODE>
|
|
<DD>Do not generate code to avoid bugs in the multiply instructions for the
|
|
MN10300 processors.
|
|
<P>
|
|
|
|
<DT><CODE>-mrelax</CODE>
|
|
<DD>Indicate to the linker that it should perform a relaxation optimization pass
|
|
to shorten branches, calls and absolute memory addresses. This option only
|
|
has an effect when used on the command line for the final link step.
|
|
<P>
|
|
|
|
This option makes symbolic debugging impossible.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="M32R/D Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC26"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC25" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC25"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC27" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC27"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC18" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC18"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.10 M32R/D Options </H3>
|
|
<!--docid::SEC26::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for Mitsubishi M32R/D architectures:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-mcode-model=small</CODE>
|
|
<DD>Assume all objects live in the lower 16MB of memory (so that their addresses
|
|
can be loaded with the <CODE>ld24</CODE> instruction), and assume all subroutines
|
|
are reachable with the <CODE>bl</CODE> instruction.
|
|
This is the default.
|
|
<P>
|
|
|
|
The addressability of a particular object can be set with the
|
|
<CODE>model</CODE> attribute.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mcode-model=medium</CODE>
|
|
<DD>Assume objects may be anywhere in the 32 bit address space (the compiler
|
|
will generate <CODE>seth/add3</CODE> instructions to load their addresses), and
|
|
assume all subroutines are reachable with the <CODE>bl</CODE> instruction.
|
|
<P>
|
|
|
|
<DT><CODE>-mcode-model=large</CODE>
|
|
<DD>Assume objects may be anywhere in the 32 bit address space (the compiler
|
|
will generate <CODE>seth/add3</CODE> instructions to load their addresses), and
|
|
assume subroutines may not be reachable with the <CODE>bl</CODE> instruction
|
|
(the compiler will generate the much slower <CODE>seth/add3/jl</CODE>
|
|
instruction sequence).
|
|
<P>
|
|
|
|
<DT><CODE>-msdata=none</CODE>
|
|
<DD>Disable use of the small data area. Variables will be put into
|
|
one of <SAMP>`.data'</SAMP>, <SAMP>`bss'</SAMP>, or <SAMP>`.rodata'</SAMP> (unless the
|
|
<CODE>section</CODE> attribute has been specified).
|
|
This is the default.
|
|
<P>
|
|
|
|
The small data area consists of sections <SAMP>`.sdata'</SAMP> and <SAMP>`.sbss'</SAMP>.
|
|
Objects may be explicitly put in the small data area with the
|
|
<CODE>section</CODE> attribute using one of these sections.
|
|
</P><P>
|
|
|
|
<DT><CODE>-msdata=sdata</CODE>
|
|
<DD>Put small global and static data in the small data area, but do not
|
|
generate special code to reference them.
|
|
<P>
|
|
|
|
<DT><CODE>-msdata=use</CODE>
|
|
<DD>Put small global and static data in the small data area, and generate
|
|
special instructions to reference them.
|
|
<P>
|
|
|
|
<DT><CODE>-G <VAR>num</VAR></CODE>
|
|
<DD><A NAME="IDX143"></A>
|
|
Put global and static objects less than or equal to <VAR>num</VAR> bytes
|
|
into the small data or bss sections instead of the normal data or bss
|
|
sections. The default value of <VAR>num</VAR> is 8.
|
|
The <SAMP>`-msdata'</SAMP> option must be set to one of <SAMP>`sdata'</SAMP> or <SAMP>`use'</SAMP>
|
|
for this option to have any effect.
|
|
<P>
|
|
|
|
All modules should be compiled with the same <SAMP>`-G <VAR>num</VAR>'</SAMP> value.
|
|
Compiling with different values of <VAR>num</VAR> may or may not work; if it
|
|
doesn't the linker will give an error message - incorrect code will not be
|
|
generated.
|
|
</P><P>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="M88K Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC27"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC26" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC26"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC28" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC28"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC18" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC18"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.11 M88K Options </H3>
|
|
<!--docid::SEC27::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for Motorola 88k architectures:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-m88000</CODE>
|
|
<DD><A NAME="IDX144"></A>
|
|
Generate code that works well on both the m88100 and the
|
|
m88110.
|
|
<P>
|
|
|
|
<DT><CODE>-m88100</CODE>
|
|
<DD><A NAME="IDX145"></A>
|
|
Generate code that works best for the m88100, but that also
|
|
runs on the m88110.
|
|
<P>
|
|
|
|
<DT><CODE>-m88110</CODE>
|
|
<DD><A NAME="IDX146"></A>
|
|
Generate code that works best for the m88110, and may not run
|
|
on the m88100.
|
|
<P>
|
|
|
|
<DT><CODE>-mbig-pic</CODE>
|
|
<DD><A NAME="IDX147"></A>
|
|
Obsolete option to be removed from the next revision.
|
|
Use <SAMP>`-fPIC'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-midentify-revision</CODE>
|
|
<DD><A NAME="IDX148"></A>
|
|
<A NAME="IDX149"></A>
|
|
<A NAME="IDX150"></A>
|
|
Include an <CODE>ident</CODE> directive in the assembler output recording the
|
|
source file name, compiler name and version, timestamp, and compilation
|
|
flags used.
|
|
<P>
|
|
|
|
<DT><CODE>-mno-underscores</CODE>
|
|
<DD><A NAME="IDX151"></A>
|
|
<A NAME="IDX152"></A>
|
|
In assembler output, emit symbol names without adding an underscore
|
|
character at the beginning of each name. The default is to use an
|
|
underscore as prefix on each name.
|
|
<P>
|
|
|
|
<DT><CODE>-mocs-debug-info</CODE>
|
|
<DD><DT><CODE>-mno-ocs-debug-info</CODE>
|
|
<DD><A NAME="IDX153"></A>
|
|
<A NAME="IDX154"></A>
|
|
<A NAME="IDX155"></A>
|
|
<A NAME="IDX156"></A>
|
|
Include (or omit) additional debugging information (about registers used
|
|
in each stack frame) as specified in the 88open Object Compatibility
|
|
Standard, "OCS". This extra information allows debugging of code that
|
|
has had the frame pointer eliminated. The default for DG/UX, SVr4, and
|
|
Delta 88 SVr3.2 is to include this information; other 88k configurations
|
|
omit this information by default.
|
|
<P>
|
|
|
|
<DT><CODE>-mocs-frame-position</CODE>
|
|
<DD><A NAME="IDX157"></A>
|
|
<A NAME="IDX158"></A>
|
|
When emitting COFF debugging information for automatic variables and
|
|
parameters stored on the stack, use the offset from the canonical frame
|
|
address, which is the stack pointer (register 31) on entry to the
|
|
function. The DG/UX, SVr4, Delta88 SVr3.2, and BCS configurations use
|
|
<SAMP>`-mocs-frame-position'</SAMP>; other 88k configurations have the default
|
|
<SAMP>`-mno-ocs-frame-position'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mno-ocs-frame-position</CODE>
|
|
<DD><A NAME="IDX159"></A>
|
|
<A NAME="IDX160"></A>
|
|
When emitting COFF debugging information for automatic variables and
|
|
parameters stored on the stack, use the offset from the frame pointer
|
|
register (register 30). When this option is in effect, the frame
|
|
pointer is not eliminated when debugging information is selected by the
|
|
-g switch.
|
|
<P>
|
|
|
|
<DT><CODE>-moptimize-arg-area</CODE>
|
|
<DD><DT><CODE>-mno-optimize-arg-area</CODE>
|
|
<DD><A NAME="IDX161"></A>
|
|
<A NAME="IDX162"></A>
|
|
<A NAME="IDX163"></A>
|
|
Control how function arguments are stored in stack frames.
|
|
<SAMP>`-moptimize-arg-area'</SAMP> saves space by optimizing them, but this
|
|
conflicts with the 88open specifications. The opposite alternative,
|
|
<SAMP>`-mno-optimize-arg-area'</SAMP>, agrees with 88open standards. By default
|
|
GCC does not optimize the argument area.
|
|
<P>
|
|
|
|
<DT><CODE>-mshort-data-<VAR>num</VAR></CODE>
|
|
<DD><A NAME="IDX164"></A>
|
|
<A NAME="IDX165"></A>
|
|
<A NAME="IDX166"></A>
|
|
Generate smaller data references by making them relative to <CODE>r0</CODE>,
|
|
which allows loading a value using a single instruction (rather than the
|
|
usual two). You control which data references are affected by
|
|
specifying <VAR>num</VAR> with this option. For example, if you specify
|
|
<SAMP>`-mshort-data-512'</SAMP>, then the data references affected are those
|
|
involving displacements of less than 512 bytes.
|
|
<SAMP>`-mshort-data-<VAR>num</VAR>'</SAMP> is not effective for <VAR>num</VAR> greater
|
|
than 64k.
|
|
<P>
|
|
|
|
<DT><CODE>-mserialize-volatile</CODE>
|
|
<DD><A NAME="IDX167"></A>
|
|
<DT><CODE>-mno-serialize-volatile</CODE>
|
|
<DD><A NAME="IDX168"></A>
|
|
<A NAME="IDX169"></A>
|
|
Do, or don't, generate code to guarantee sequential consistency
|
|
of volatile memory references. By default, consistency is
|
|
guaranteed.
|
|
<P>
|
|
|
|
The order of memory references made by the MC88110 processor does
|
|
not always match the order of the instructions requesting those
|
|
references. In particular, a load instruction may execute before
|
|
a preceding store instruction. Such reordering violates
|
|
sequential consistency of volatile memory references, when there
|
|
are multiple processors. When consistency must be guaranteed,
|
|
GNU C generates special instructions, as needed, to force
|
|
execution in the proper order.
|
|
</P><P>
|
|
|
|
The MC88100 processor does not reorder memory references and so
|
|
always provides sequential consistency. However, by default, GNU
|
|
C generates the special instructions to guarantee consistency
|
|
even when you use <SAMP>`-m88100'</SAMP>, so that the code may be run on an
|
|
MC88110 processor. If you intend to run your code only on the
|
|
MC88100 processor, you may use <SAMP>`-mno-serialize-volatile'</SAMP>.
|
|
</P><P>
|
|
|
|
The extra code generated to guarantee consistency may affect the
|
|
performance of your application. If you know that you can safely
|
|
forgo this guarantee, you may use <SAMP>`-mno-serialize-volatile'</SAMP>.
|
|
</P><P>
|
|
|
|
<DT><CODE>-msvr4</CODE>
|
|
<DD><DT><CODE>-msvr3</CODE>
|
|
<DD><A NAME="IDX170"></A>
|
|
<A NAME="IDX171"></A>
|
|
<A NAME="IDX172"></A>
|
|
<A NAME="IDX173"></A>
|
|
Turn on (<SAMP>`-msvr4'</SAMP>) or off (<SAMP>`-msvr3'</SAMP>) compiler extensions
|
|
related to System V release 4 (SVr4). This controls the following:
|
|
<P>
|
|
|
|
<OL>
|
|
<LI>
|
|
Which variant of the assembler syntax to emit.
|
|
<LI>
|
|
<SAMP>`-msvr4'</SAMP> makes the C preprocessor recognize <SAMP>`#pragma weak'</SAMP>
|
|
that is used on System V release 4.
|
|
<LI>
|
|
<SAMP>`-msvr4'</SAMP> makes GCC issue additional declaration directives used in
|
|
SVr4.
|
|
</OL>
|
|
<P>
|
|
|
|
<SAMP>`-msvr4'</SAMP> is the default for the m88k-motorola-sysv4 and
|
|
m88k-dg-dgux m88k configurations. <SAMP>`-msvr3'</SAMP> is the default for all
|
|
other m88k configurations.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mversion-03.00</CODE>
|
|
<DD><A NAME="IDX174"></A>
|
|
This option is obsolete, and is ignored.
|
|
<P>
|
|
|
|
<DT><CODE>-mno-check-zero-division</CODE>
|
|
<DD><DT><CODE>-mcheck-zero-division</CODE>
|
|
<DD><A NAME="IDX175"></A>
|
|
<A NAME="IDX176"></A>
|
|
<A NAME="IDX177"></A>
|
|
Do, or don't, generate code to guarantee that integer division by
|
|
zero will be detected. By default, detection is guaranteed.
|
|
<P>
|
|
|
|
Some models of the MC88100 processor fail to trap upon integer
|
|
division by zero under certain conditions. By default, when
|
|
compiling code that might be run on such a processor, GNU C
|
|
generates code that explicitly checks for zero-valued divisors
|
|
and traps with exception number 503 when one is detected. Use of
|
|
mno-check-zero-division suppresses such checking for code
|
|
generated to run on an MC88100 processor.
|
|
</P><P>
|
|
|
|
GNU C assumes that the MC88110 processor correctly detects all
|
|
instances of integer division by zero. When <SAMP>`-m88110'</SAMP> is
|
|
specified, both <SAMP>`-mcheck-zero-division'</SAMP> and
|
|
<SAMP>`-mno-check-zero-division'</SAMP> are ignored, and no explicit checks for
|
|
zero-valued divisors are generated.
|
|
</P><P>
|
|
|
|
<DT><CODE>-muse-div-instruction</CODE>
|
|
<DD><A NAME="IDX178"></A>
|
|
<A NAME="IDX179"></A>
|
|
Use the div instruction for signed integer division on the
|
|
MC88100 processor. By default, the div instruction is not used.
|
|
<P>
|
|
|
|
On the MC88100 processor the signed integer division instruction
|
|
div) traps to the operating system on a negative operand. The
|
|
operating system transparently completes the operation, but at a
|
|
large cost in execution time. By default, when compiling code
|
|
that might be run on an MC88100 processor, GNU C emulates signed
|
|
integer division using the unsigned integer division instruction
|
|
divu), thereby avoiding the large penalty of a trap to the
|
|
operating system. Such emulation has its own, smaller, execution
|
|
cost in both time and space. To the extent that your code's
|
|
important signed integer division operations are performed on two
|
|
nonnegative operands, it may be desirable to use the div
|
|
instruction directly.
|
|
</P><P>
|
|
|
|
On the MC88110 processor the div instruction (also known as the
|
|
divs instruction) processes negative operands without trapping to
|
|
the operating system. When <SAMP>`-m88110'</SAMP> is specified,
|
|
<SAMP>`-muse-div-instruction'</SAMP> is ignored, and the div instruction is used
|
|
for signed integer division.
|
|
</P><P>
|
|
|
|
Note that the result of dividing INT_MIN by -1 is undefined. In
|
|
particular, the behavior of such a division with and without
|
|
<SAMP>`-muse-div-instruction'</SAMP> may differ.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mtrap-large-shift</CODE>
|
|
<DD><DT><CODE>-mhandle-large-shift</CODE>
|
|
<DD><A NAME="IDX180"></A>
|
|
<A NAME="IDX181"></A>
|
|
<A NAME="IDX182"></A>
|
|
<A NAME="IDX183"></A>
|
|
Include code to detect bit-shifts of more than 31 bits; respectively,
|
|
trap such shifts or emit code to handle them properly. By default GCC
|
|
makes no special provision for large bit shifts.
|
|
<P>
|
|
|
|
<DT><CODE>-mwarn-passed-structs</CODE>
|
|
<DD><A NAME="IDX184"></A>
|
|
<A NAME="IDX185"></A>
|
|
Warn when a function passes a struct as an argument or result.
|
|
Structure-passing conventions have changed during the evolution of the C
|
|
language, and are often the source of portability problems. By default,
|
|
GCC issues no such warning.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="RS/6000 and PowerPC Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC28"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC27" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC27"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC29" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC29"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC18" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC18"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.12 IBM RS/6000 and PowerPC Options </H3>
|
|
<!--docid::SEC28::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for the IBM RS/6000 and PowerPC:
|
|
<DL COMPACT>
|
|
<DT><CODE>-mpower</CODE>
|
|
<DD><DT><CODE>-mno-power</CODE>
|
|
<DD><DT><CODE>-mpower2</CODE>
|
|
<DD><DT><CODE>-mno-power2</CODE>
|
|
<DD><DT><CODE>-mpowerpc</CODE>
|
|
<DD><DT><CODE>-mno-powerpc</CODE>
|
|
<DD><DT><CODE>-mpowerpc-gpopt</CODE>
|
|
<DD><DT><CODE>-mno-powerpc-gpopt</CODE>
|
|
<DD><DT><CODE>-mpowerpc-gfxopt</CODE>
|
|
<DD><DT><CODE>-mno-powerpc-gfxopt</CODE>
|
|
<DD><DT><CODE>-mpowerpc64</CODE>
|
|
<DD><DT><CODE>-mno-powerpc64</CODE>
|
|
<DD><A NAME="IDX186"></A>
|
|
<A NAME="IDX187"></A>
|
|
<A NAME="IDX188"></A>
|
|
<A NAME="IDX189"></A>
|
|
<A NAME="IDX190"></A>
|
|
<A NAME="IDX191"></A>
|
|
GCC supports two related instruction set architectures for the
|
|
RS/6000 and PowerPC. The <EM>POWER</EM> instruction set are those
|
|
instructions supported by the <SAMP>`rios'</SAMP> chip set used in the original
|
|
RS/6000 systems and the <EM>PowerPC</EM> instruction set is the
|
|
architecture of the Motorola MPC5xx, MPC6xx, MPC8xx microprocessors, and
|
|
the IBM 4xx microprocessors.
|
|
<P>
|
|
|
|
Neither architecture is a subset of the other. However there is a
|
|
large common subset of instructions supported by both. An MQ
|
|
register is included in processors supporting the POWER architecture.
|
|
</P><P>
|
|
|
|
You use these options to specify which instructions are available on the
|
|
processor you are using. The default value of these options is
|
|
determined when configuring GCC. Specifying the
|
|
<SAMP>`-mcpu=<VAR>cpu_type</VAR>'</SAMP> overrides the specification of these
|
|
options. We recommend you use the <SAMP>`-mcpu=<VAR>cpu_type</VAR>'</SAMP> option
|
|
rather than the options listed above.
|
|
</P><P>
|
|
|
|
The <SAMP>`-mpower'</SAMP> option allows GCC to generate instructions that
|
|
are found only in the POWER architecture and to use the MQ register.
|
|
Specifying <SAMP>`-mpower2'</SAMP> implies <SAMP>`-power'</SAMP> and also allows GCC
|
|
to generate instructions that are present in the POWER2 architecture but
|
|
not the original POWER architecture.
|
|
</P><P>
|
|
|
|
The <SAMP>`-mpowerpc'</SAMP> option allows GCC to generate instructions that
|
|
are found only in the 32-bit subset of the PowerPC architecture.
|
|
Specifying <SAMP>`-mpowerpc-gpopt'</SAMP> implies <SAMP>`-mpowerpc'</SAMP> and also allows
|
|
GCC to use the optional PowerPC architecture instructions in the
|
|
General Purpose group, including floating-point square root. Specifying
|
|
<SAMP>`-mpowerpc-gfxopt'</SAMP> implies <SAMP>`-mpowerpc'</SAMP> and also allows GCC to
|
|
use the optional PowerPC architecture instructions in the Graphics
|
|
group, including floating-point select.
|
|
</P><P>
|
|
|
|
The <SAMP>`-mpowerpc64'</SAMP> option allows GCC to generate the additional
|
|
64-bit instructions that are found in the full PowerPC64 architecture
|
|
and to treat GPRs as 64-bit, doubleword quantities. GCC defaults to
|
|
<SAMP>`-mno-powerpc64'</SAMP>.
|
|
</P><P>
|
|
|
|
If you specify both <SAMP>`-mno-power'</SAMP> and <SAMP>`-mno-powerpc'</SAMP>, GCC
|
|
will use only the instructions in the common subset of both
|
|
architectures plus some special AIX common-mode calls, and will not use
|
|
the MQ register. Specifying both <SAMP>`-mpower'</SAMP> and <SAMP>`-mpowerpc'</SAMP>
|
|
permits GCC to use any instruction from either architecture and to
|
|
allow use of the MQ register; specify this for the Motorola MPC601.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mnew-mnemonics</CODE>
|
|
<DD><DT><CODE>-mold-mnemonics</CODE>
|
|
<DD><A NAME="IDX192"></A>
|
|
<A NAME="IDX193"></A>
|
|
Select which mnemonics to use in the generated assembler code.
|
|
<SAMP>`-mnew-mnemonics'</SAMP> requests output that uses the assembler mnemonics
|
|
defined for the PowerPC architecture, while <SAMP>`-mold-mnemonics'</SAMP>
|
|
requests the assembler mnemonics defined for the POWER architecture.
|
|
Instructions defined in only one architecture have only one mnemonic;
|
|
GCC uses that mnemonic irrespective of which of these options is
|
|
specified.
|
|
<P>
|
|
|
|
GCC defaults to the mnemonics appropriate for the architecture in
|
|
use. Specifying <SAMP>`-mcpu=<VAR>cpu_type</VAR>'</SAMP> sometimes overrides the
|
|
value of these option. Unless you are building a cross-compiler, you
|
|
should normally not specify either <SAMP>`-mnew-mnemonics'</SAMP> or
|
|
<SAMP>`-mold-mnemonics'</SAMP>, but should instead accept the default.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mcpu=<VAR>cpu_type</VAR></CODE>
|
|
<DD><A NAME="IDX194"></A>
|
|
Set architecture type, register usage, choice of mnemonics, and
|
|
instruction scheduling parameters for machine type <VAR>cpu_type</VAR>.
|
|
Supported values for <VAR>cpu_type</VAR> are <SAMP>`rs6000'</SAMP>, <SAMP>`rios1'</SAMP>,
|
|
<SAMP>`rios2'</SAMP>, <SAMP>`rsc'</SAMP>, <SAMP>`601'</SAMP>, <SAMP>`602'</SAMP>, <SAMP>`603'</SAMP>,
|
|
<SAMP>`603e'</SAMP>, <SAMP>`604'</SAMP>, <SAMP>`604e'</SAMP>, <SAMP>`620'</SAMP>, <SAMP>`740'</SAMP>,
|
|
<SAMP>`750'</SAMP>, <SAMP>`power'</SAMP>, <SAMP>`power2'</SAMP>, <SAMP>`powerpc'</SAMP>, <SAMP>`403'</SAMP>,
|
|
<SAMP>`505'</SAMP>, <SAMP>`801'</SAMP>, <SAMP>`821'</SAMP>, <SAMP>`823'</SAMP>, and <SAMP>`860'</SAMP> and
|
|
<SAMP>`common'</SAMP>. <SAMP>`-mcpu=power'</SAMP>, <SAMP>`-mcpu=power2'</SAMP>, and
|
|
<SAMP>`-mcpu=powerpc'</SAMP> specify generic POWER, POWER2 and pure PowerPC
|
|
(i.e., not MPC601) architecture machine types, with an appropriate,
|
|
generic processor model assumed for scheduling purposes.<P>
|
|
|
|
Specifying any of the following options:
|
|
<SAMP>`-mcpu=rios1'</SAMP>, <SAMP>`-mcpu=rios2'</SAMP>, <SAMP>`-mcpu=rsc'</SAMP>,
|
|
<SAMP>`-mcpu=power'</SAMP>, or <SAMP>`-mcpu=power2'</SAMP>
|
|
enables the <SAMP>`-mpower'</SAMP> option and disables the <SAMP>`-mpowerpc'</SAMP> option;
|
|
<SAMP>`-mcpu=601'</SAMP> enables both the <SAMP>`-mpower'</SAMP> and <SAMP>`-mpowerpc'</SAMP> options.
|
|
All of <SAMP>`-mcpu=602'</SAMP>, <SAMP>`-mcpu=603'</SAMP>, <SAMP>`-mcpu=603e'</SAMP>,
|
|
<SAMP>`-mcpu=604'</SAMP>, <SAMP>`-mcpu=620'</SAMP>,
|
|
enable the <SAMP>`-mpowerpc'</SAMP> option and disable the <SAMP>`-mpower'</SAMP> option.
|
|
Exactly similarly, all of <SAMP>`-mcpu=403'</SAMP>,
|
|
<SAMP>`-mcpu=505'</SAMP>, <SAMP>`-mcpu=821'</SAMP>, <SAMP>`-mcpu=860'</SAMP> and <SAMP>`-mcpu=powerpc'</SAMP>
|
|
enable the <SAMP>`-mpowerpc'</SAMP> option and disable the <SAMP>`-mpower'</SAMP> option.
|
|
<SAMP>`-mcpu=common'</SAMP> disables both the
|
|
<SAMP>`-mpower'</SAMP> and <SAMP>`-mpowerpc'</SAMP> options.</P><P>
|
|
|
|
AIX versions 4 or greater selects <SAMP>`-mcpu=common'</SAMP> by default, so
|
|
that code will operate on all members of the RS/6000 and PowerPC
|
|
families. In that case, GCC will use only the instructions in the
|
|
common subset of both architectures plus some special AIX common-mode
|
|
calls, and will not use the MQ register. GCC assumes a generic
|
|
processor model for scheduling purposes.
|
|
</P><P>
|
|
|
|
Specifying any of the options <SAMP>`-mcpu=rios1'</SAMP>, <SAMP>`-mcpu=rios2'</SAMP>,
|
|
<SAMP>`-mcpu=rsc'</SAMP>, <SAMP>`-mcpu=power'</SAMP>, or <SAMP>`-mcpu=power2'</SAMP> also
|
|
disables the <SAMP>`new-mnemonics'</SAMP> option. Specifying <SAMP>`-mcpu=601'</SAMP>,
|
|
<SAMP>`-mcpu=602'</SAMP>, <SAMP>`-mcpu=603'</SAMP>, <SAMP>`-mcpu=603e'</SAMP>, <SAMP>`-mcpu=604'</SAMP>,
|
|
<SAMP>`620'</SAMP>, <SAMP>`403'</SAMP>, or <SAMP>`-mcpu=powerpc'</SAMP> also enables the
|
|
<SAMP>`new-mnemonics'</SAMP> option.</P><P>
|
|
|
|
Specifying <SAMP>`-mcpu=403'</SAMP>, <SAMP>`-mcpu=821'</SAMP>, or <SAMP>`-mcpu=860'</SAMP> also
|
|
enables the <SAMP>`-msoft-float'</SAMP> option.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mtune=<VAR>cpu_type</VAR></CODE>
|
|
<DD>Set the instruction scheduling parameters for machine type
|
|
<VAR>cpu_type</VAR>, but do not set the architecture type, register usage,
|
|
choice of mnemonics like <SAMP>`-mcpu='</SAMP><VAR>cpu_type</VAR> would. The same
|
|
values for <VAR>cpu_type</VAR> are used for <SAMP>`-mtune='</SAMP><VAR>cpu_type</VAR> as
|
|
for <SAMP>`-mcpu='</SAMP><VAR>cpu_type</VAR>. The <SAMP>`-mtune='</SAMP><VAR>cpu_type</VAR>
|
|
option overrides the <SAMP>`-mcpu='</SAMP><VAR>cpu_type</VAR> option in terms of
|
|
instruction scheduling parameters.
|
|
<P>
|
|
|
|
<DT><CODE>-mfull-toc</CODE>
|
|
<DD><DT><CODE>-mno-fp-in-toc</CODE>
|
|
<DD><DT><CODE>-mno-sum-in-toc</CODE>
|
|
<DD><DT><CODE>-mminimal-toc</CODE>
|
|
<DD><A NAME="IDX195"></A>
|
|
Modify generation of the TOC (Table Of Contents), which is created for
|
|
every executable file. The <SAMP>`-mfull-toc'</SAMP> option is selected by
|
|
default. In that case, GCC will allocate at least one TOC entry for
|
|
each unique non-automatic variable reference in your program. GCC
|
|
will also place floating-point constants in the TOC. However, only
|
|
16,384 entries are available in the TOC.
|
|
<P>
|
|
|
|
If you receive a linker error message that saying you have overflowed
|
|
the available TOC space, you can reduce the amount of TOC space used
|
|
with the <SAMP>`-mno-fp-in-toc'</SAMP> and <SAMP>`-mno-sum-in-toc'</SAMP> options.
|
|
<SAMP>`-mno-fp-in-toc'</SAMP> prevents GCC from putting floating-point
|
|
constants in the TOC and <SAMP>`-mno-sum-in-toc'</SAMP> forces GCC to
|
|
generate code to calculate the sum of an address and a constant at
|
|
run-time instead of putting that sum into the TOC. You may specify one
|
|
or both of these options. Each causes GCC to produce very slightly
|
|
slower and larger code at the expense of conserving TOC space.
|
|
</P><P>
|
|
|
|
If you still run out of space in the TOC even when you specify both of
|
|
these options, specify <SAMP>`-mminimal-toc'</SAMP> instead. This option causes
|
|
GCC to make only one TOC entry for every file. When you specify this
|
|
option, GCC will produce code that is slower and larger but which
|
|
uses extremely little TOC space. You may wish to use this option
|
|
only on files that contain less frequently executed code. </P><P>
|
|
|
|
<DT><CODE>-maix64</CODE>
|
|
<DD><DT><CODE>-maix32</CODE>
|
|
<DD><A NAME="IDX196"></A>
|
|
<A NAME="IDX197"></A>
|
|
Enable AIX 64-bit ABI and calling convention: 64-bit pointers, 64-bit
|
|
<CODE>long</CODE> type, and the infrastructure needed to support them.
|
|
Specifying <SAMP>`-maix64'</SAMP> implies <SAMP>`-mpowerpc64'</SAMP> and
|
|
<SAMP>`-mpowerpc'</SAMP>, while <SAMP>`-maix32'</SAMP> disables the 64-bit ABI and
|
|
implies <SAMP>`-mno-powerpc64'</SAMP>. GCC defaults to <SAMP>`-maix32'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mxl-call</CODE>
|
|
<DD><DT><CODE>-mno-xl-call</CODE>
|
|
<DD><A NAME="IDX198"></A>
|
|
On AIX, pass floating-point arguments to prototyped functions beyond the
|
|
register save area (RSA) on the stack in addition to argument FPRs. The
|
|
AIX calling convention was extended but not initially documented to
|
|
handle an obscure K&R C case of calling a function that takes the
|
|
address of its arguments with fewer arguments than declared. AIX XL
|
|
compilers access floating point arguments which do not fit in the
|
|
RSA from the stack when a subroutine is compiled without
|
|
optimization. Because always storing floating-point arguments on the
|
|
stack is inefficient and rarely needed, this option is not enabled by
|
|
default and only is necessary when calling subroutines compiled by AIX
|
|
XL compilers without optimization.
|
|
<P>
|
|
|
|
<DT><CODE>-mthreads</CODE>
|
|
<DD><A NAME="IDX199"></A>
|
|
Support <EM>AIX Threads</EM>. Link an application written to use
|
|
<EM>pthreads</EM> with special libraries and startup code to enable the
|
|
application to run.
|
|
<P>
|
|
|
|
<DT><CODE>-mpe</CODE>
|
|
<DD><A NAME="IDX200"></A>
|
|
Support <EM>IBM RS/6000 SP</EM> <EM>Parallel Environment</EM> (PE). Link an
|
|
application written to use message passing with special startup code to
|
|
enable the application to run. The system must have PE installed in the
|
|
standard location (<TT>`/usr/lpp/ppe.poe/'</TT>), or the <TT>`specs'</TT> file
|
|
must be overridden with the <SAMP>`-specs='</SAMP> option to specify the
|
|
appropriate directory location. The Parallel Environment does not
|
|
support threads, so the <SAMP>`-mpe'</SAMP> option and the <SAMP>`-mthreads'</SAMP>
|
|
option are incompatible.
|
|
<P>
|
|
|
|
<DT><CODE>-msoft-float</CODE>
|
|
<DD><DT><CODE>-mhard-float</CODE>
|
|
<DD><A NAME="IDX201"></A>
|
|
Generate code that does not use (uses) the floating-point register set.
|
|
Software floating point emulation is provided if you use the
|
|
<SAMP>`-msoft-float'</SAMP> option, and pass the option to GCC when linking.
|
|
<P>
|
|
|
|
<DT><CODE>-mmultiple</CODE>
|
|
<DD><DT><CODE>-mno-multiple</CODE>
|
|
<DD>Generate code that uses (does not use) the load multiple word
|
|
instructions and the store multiple word instructions. These
|
|
instructions are generated by default on POWER systems, and not
|
|
generated on PowerPC systems. Do not use <SAMP>`-mmultiple'</SAMP> on little
|
|
endian PowerPC systems, since those instructions do not work when the
|
|
processor is in little endian mode. The exceptions are PPC740 and
|
|
PPC750 which permit the instructions usage in little endian mode.
|
|
<P>
|
|
|
|
<DT><CODE>-mstring</CODE>
|
|
<DD><DT><CODE>-mno-string</CODE>
|
|
<DD><A NAME="IDX202"></A>
|
|
Generate code that uses (does not use) the load string instructions
|
|
and the store string word instructions to save multiple registers and
|
|
do small block moves. These instructions are generated by default on
|
|
POWER systems, and not generated on PowerPC systems. Do not use
|
|
<SAMP>`-mstring'</SAMP> on little endian PowerPC systems, since those
|
|
instructions do not work when the processor is in little endian mode.
|
|
The exceptions are PPC740 and PPC750 which permit the instructions
|
|
usage in little endian mode.
|
|
<P>
|
|
|
|
<DT><CODE>-mupdate</CODE>
|
|
<DD><DT><CODE>-mno-update</CODE>
|
|
<DD><A NAME="IDX203"></A>
|
|
Generate code that uses (does not use) the load or store instructions
|
|
that update the base register to the address of the calculated memory
|
|
location. These instructions are generated by default. If you use
|
|
<SAMP>`-mno-update'</SAMP>, there is a small window between the time that the
|
|
stack pointer is updated and the address of the previous frame is
|
|
stored, which means code that walks the stack frame across interrupts or
|
|
signals may get corrupted data.
|
|
<P>
|
|
|
|
<DT><CODE>-mfused-madd</CODE>
|
|
<DD><DT><CODE>-mno-fused-madd</CODE>
|
|
<DD><A NAME="IDX204"></A>
|
|
Generate code that uses (does not use) the floating point multiply and
|
|
accumulate instructions. These instructions are generated by default if
|
|
hardware floating is used.
|
|
<P>
|
|
|
|
<DT><CODE>-mno-bit-align</CODE>
|
|
<DD><DT><CODE>-mbit-align</CODE>
|
|
<DD><A NAME="IDX205"></A>
|
|
On System V.4 and embedded PowerPC systems do not (do) force structures
|
|
and unions that contain bit fields to be aligned to the base type of the
|
|
bit field.
|
|
<P>
|
|
|
|
For example, by default a structure containing nothing but 8
|
|
<CODE>unsigned</CODE> bitfields of length 1 would be aligned to a 4 byte
|
|
boundary and have a size of 4 bytes. By using <SAMP>`-mno-bit-align'</SAMP>,
|
|
the structure would be aligned to a 1 byte boundary and be one byte in
|
|
size.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mno-strict-align</CODE>
|
|
<DD><DT><CODE>-mstrict-align</CODE>
|
|
<DD><A NAME="IDX206"></A>
|
|
On System V.4 and embedded PowerPC systems do not (do) assume that
|
|
unaligned memory references will be handled by the system.
|
|
<P>
|
|
|
|
<DT><CODE>-mrelocatable</CODE>
|
|
<DD><DT><CODE>-mno-relocatable</CODE>
|
|
<DD><A NAME="IDX207"></A>
|
|
On embedded PowerPC systems generate code that allows (does not allow)
|
|
the program to be relocated to a different address at runtime. If you
|
|
use <SAMP>`-mrelocatable'</SAMP> on any module, all objects linked together must
|
|
be compiled with <SAMP>`-mrelocatable'</SAMP> or <SAMP>`-mrelocatable-lib'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mrelocatable-lib</CODE>
|
|
<DD><DT><CODE>-mno-relocatable-lib</CODE>
|
|
<DD>On embedded PowerPC systems generate code that allows (does not allow)
|
|
the program to be relocated to a different address at runtime. Modules
|
|
compiled with <SAMP>`-mrelocatable-lib'</SAMP> can be linked with either modules
|
|
compiled without <SAMP>`-mrelocatable'</SAMP> and <SAMP>`-mrelocatable-lib'</SAMP> or
|
|
with modules compiled with the <SAMP>`-mrelocatable'</SAMP> options.
|
|
<P>
|
|
|
|
<DT><CODE>-mno-toc</CODE>
|
|
<DD><DT><CODE>-mtoc</CODE>
|
|
<DD>On System V.4 and embedded PowerPC systems do not (do) assume that
|
|
register 2 contains a pointer to a global area pointing to the addresses
|
|
used in the program.
|
|
<P>
|
|
|
|
<DT><CODE>-mlittle</CODE>
|
|
<DD><DT><CODE>-mlittle-endian</CODE>
|
|
<DD>On System V.4 and embedded PowerPC systems compile code for the
|
|
processor in little endian mode. The <SAMP>`-mlittle-endian'</SAMP> option is
|
|
the same as <SAMP>`-mlittle'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mbig</CODE>
|
|
<DD><DT><CODE>-mbig-endian</CODE>
|
|
<DD>On System V.4 and embedded PowerPC systems compile code for the
|
|
processor in big endian mode. The <SAMP>`-mbig-endian'</SAMP> option is
|
|
the same as <SAMP>`-mbig'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mcall-sysv</CODE>
|
|
<DD>On System V.4 and embedded PowerPC systems compile code using calling
|
|
conventions that adheres to the March 1995 draft of the System V
|
|
Application Binary Interface, PowerPC processor supplement. This is the
|
|
default unless you configured GCC using <SAMP>`powerpc-*-eabiaix'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mcall-sysv-eabi</CODE>
|
|
<DD>Specify both <SAMP>`-mcall-sysv'</SAMP> and <SAMP>`-meabi'</SAMP> options.
|
|
<P>
|
|
|
|
<DT><CODE>-mcall-sysv-noeabi</CODE>
|
|
<DD>Specify both <SAMP>`-mcall-sysv'</SAMP> and <SAMP>`-mno-eabi'</SAMP> options.
|
|
<P>
|
|
|
|
<DT><CODE>-mcall-aix</CODE>
|
|
<DD>On System V.4 and embedded PowerPC systems compile code using calling
|
|
conventions that are similar to those used on AIX. This is the
|
|
default if you configured GCC using <SAMP>`powerpc-*-eabiaix'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mcall-solaris</CODE>
|
|
<DD>On System V.4 and embedded PowerPC systems compile code for the Solaris
|
|
operating system.
|
|
<P>
|
|
|
|
<DT><CODE>-mcall-linux</CODE>
|
|
<DD>On System V.4 and embedded PowerPC systems compile code for the
|
|
Linux-based GNU system.
|
|
<P>
|
|
|
|
<DT><CODE>-mprototype</CODE>
|
|
<DD><DT><CODE>-mno-prototype</CODE>
|
|
<DD>On System V.4 and embedded PowerPC systems assume that all calls to
|
|
variable argument functions are properly prototyped. Otherwise, the
|
|
compiler must insert an instruction before every non prototyped call to
|
|
set or clear bit 6 of the condition code register (<VAR>CR</VAR>) to
|
|
indicate whether floating point values were passed in the floating point
|
|
registers in case the function takes a variable arguments. With
|
|
<SAMP>`-mprototype'</SAMP>, only calls to prototyped variable argument functions
|
|
will set or clear the bit.
|
|
<P>
|
|
|
|
<DT><CODE>-msim</CODE>
|
|
<DD>On embedded PowerPC systems, assume that the startup module is called
|
|
<TT>`sim-crt0.o'</TT> and that the standard C libraries are <TT>`libsim.a'</TT> and
|
|
<TT>`libc.a'</TT>. This is the default for <SAMP>`powerpc-*-eabisim'</SAMP>.
|
|
configurations.
|
|
<P>
|
|
|
|
<DT><CODE>-mmvme</CODE>
|
|
<DD>On embedded PowerPC systems, assume that the startup module is called
|
|
<TT>`crt0.o'</TT> and the standard C libraries are <TT>`libmvme.a'</TT> and
|
|
<TT>`libc.a'</TT>.
|
|
<P>
|
|
|
|
<DT><CODE>-mads</CODE>
|
|
<DD>On embedded PowerPC systems, assume that the startup module is called
|
|
<TT>`crt0.o'</TT> and the standard C libraries are <TT>`libads.a'</TT> and
|
|
<TT>`libc.a'</TT>.
|
|
<P>
|
|
|
|
<DT><CODE>-myellowknife</CODE>
|
|
<DD>On embedded PowerPC systems, assume that the startup module is called
|
|
<TT>`crt0.o'</TT> and the standard C libraries are <TT>`libyk.a'</TT> and
|
|
<TT>`libc.a'</TT>.
|
|
<P>
|
|
|
|
<DT><CODE>-memb</CODE>
|
|
<DD>On embedded PowerPC systems, set the <VAR>PPC_EMB</VAR> bit in the ELF flags
|
|
header to indicate that <SAMP>`eabi'</SAMP> extended relocations are used.
|
|
<P>
|
|
|
|
<DT><CODE>-meabi</CODE>
|
|
<DD><DT><CODE>-mno-eabi</CODE>
|
|
<DD>On System V.4 and embedded PowerPC systems do (do not) adhere to the
|
|
Embedded Applications Binary Interface (eabi) which is a set of
|
|
modifications to the System V.4 specifications. Selecting <CODE>-meabi</CODE>
|
|
means that the stack is aligned to an 8 byte boundary, a function
|
|
<CODE>__eabi</CODE> is called to from <CODE>main</CODE> to set up the eabi
|
|
environment, and the <SAMP>`-msdata'</SAMP> option can use both <CODE>r2</CODE> and
|
|
<CODE>r13</CODE> to point to two separate small data areas. Selecting
|
|
<CODE>-mno-eabi</CODE> means that the stack is aligned to a 16 byte boundary,
|
|
do not call an initialization function from <CODE>main</CODE>, and the
|
|
<SAMP>`-msdata'</SAMP> option will only use <CODE>r13</CODE> to point to a single
|
|
small data area. The <SAMP>`-meabi'</SAMP> option is on by default if you
|
|
configured GCC using one of the <SAMP>`powerpc*-*-eabi*'</SAMP> options.
|
|
<P>
|
|
|
|
<DT><CODE>-msdata=eabi</CODE>
|
|
<DD>On System V.4 and embedded PowerPC systems, put small initialized
|
|
<CODE>const</CODE> global and static data in the <SAMP>`.sdata2'</SAMP> section, which
|
|
is pointed to by register <CODE>r2</CODE>. Put small initialized
|
|
non-<CODE>const</CODE> global and static data in the <SAMP>`.sdata'</SAMP> section,
|
|
which is pointed to by register <CODE>r13</CODE>. Put small uninitialized
|
|
global and static data in the <SAMP>`.sbss'</SAMP> section, which is adjacent to
|
|
the <SAMP>`.sdata'</SAMP> section. The <SAMP>`-msdata=eabi'</SAMP> option is
|
|
incompatible with the <SAMP>`-mrelocatable'</SAMP> option. The
|
|
<SAMP>`-msdata=eabi'</SAMP> option also sets the <SAMP>`-memb'</SAMP> option.
|
|
<P>
|
|
|
|
<DT><CODE>-msdata=sysv</CODE>
|
|
<DD>On System V.4 and embedded PowerPC systems, put small global and static
|
|
data in the <SAMP>`.sdata'</SAMP> section, which is pointed to by register
|
|
<CODE>r13</CODE>. Put small uninitialized global and static data in the
|
|
<SAMP>`.sbss'</SAMP> section, which is adjacent to the <SAMP>`.sdata'</SAMP> section.
|
|
The <SAMP>`-msdata=sysv'</SAMP> option is incompatible with the
|
|
<SAMP>`-mrelocatable'</SAMP> option.
|
|
<P>
|
|
|
|
<DT><CODE>-msdata=default</CODE>
|
|
<DD><DT><CODE>-msdata</CODE>
|
|
<DD>On System V.4 and embedded PowerPC systems, if <SAMP>`-meabi'</SAMP> is used,
|
|
compile code the same as <SAMP>`-msdata=eabi'</SAMP>, otherwise compile code the
|
|
same as <SAMP>`-msdata=sysv'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-msdata-data</CODE>
|
|
<DD>On System V.4 and embedded PowerPC systems, put small global and static
|
|
data in the <SAMP>`.sdata'</SAMP> section. Put small uninitialized global and
|
|
static data in the <SAMP>`.sbss'</SAMP> section. Do not use register <CODE>r13</CODE>
|
|
to address small data however. This is the default behavior unless
|
|
other <SAMP>`-msdata'</SAMP> options are used.
|
|
<P>
|
|
|
|
<DT><CODE>-msdata=none</CODE>
|
|
<DD><DT><CODE>-mno-sdata</CODE>
|
|
<DD>On embedded PowerPC systems, put all initialized global and static data
|
|
in the <SAMP>`.data'</SAMP> section, and all uninitialized data in the
|
|
<SAMP>`.bss'</SAMP> section.
|
|
<P>
|
|
|
|
<DT><CODE>-G <VAR>num</VAR></CODE>
|
|
<DD><A NAME="IDX208"></A>
|
|
<A NAME="IDX209"></A>
|
|
On embedded PowerPC systems, put global and static items less than or
|
|
equal to <VAR>num</VAR> bytes into the small data or bss sections instead of
|
|
the normal data or bss section. By default, <VAR>num</VAR> is 8. The
|
|
<SAMP>`-G <VAR>num</VAR>'</SAMP> switch is also passed to the linker.
|
|
All modules should be compiled with the same <SAMP>`-G <VAR>num</VAR>'</SAMP> value.
|
|
<P>
|
|
|
|
<DT><CODE>-mregnames</CODE>
|
|
<DD><DT><CODE>-mno-regnames</CODE>
|
|
<DD>On System V.4 and embedded PowerPC systems do (do not) emit register
|
|
names in the assembly language output using symbolic forms.
|
|
<P>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="RT Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC29"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC28" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC28"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC30" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC30"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC18" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC18"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.13 IBM RT Options </H3>
|
|
<!--docid::SEC29::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for the IBM RT PC:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-min-line-mul</CODE>
|
|
<DD>Use an in-line code sequence for integer multiplies. This is the
|
|
default.
|
|
<P>
|
|
|
|
<DT><CODE>-mcall-lib-mul</CODE>
|
|
<DD>Call <CODE>lmul$$</CODE> for integer multiples.
|
|
<P>
|
|
|
|
<DT><CODE>-mfull-fp-blocks</CODE>
|
|
<DD>Generate full-size floating point data blocks, including the minimum
|
|
amount of scratch space recommended by IBM. This is the default.
|
|
<P>
|
|
|
|
<DT><CODE>-mminimum-fp-blocks</CODE>
|
|
<DD>Do not include extra scratch space in floating point data blocks. This
|
|
results in smaller code, but slower execution, since scratch space must
|
|
be allocated dynamically.
|
|
<P>
|
|
|
|
<A NAME="IDX210"></A>
|
|
<A NAME="IDX211"></A>
|
|
<DT><CODE>-mfp-arg-in-fpregs</CODE>
|
|
<DD>Use a calling sequence incompatible with the IBM calling convention in
|
|
which floating point arguments are passed in floating point registers.
|
|
Note that <CODE>varargs.h</CODE> and <CODE>stdargs.h</CODE> will not work with
|
|
floating point operands if this option is specified.
|
|
<P>
|
|
|
|
<DT><CODE>-mfp-arg-in-gregs</CODE>
|
|
<DD>Use the normal calling convention for floating point arguments. This is
|
|
the default.
|
|
<P>
|
|
|
|
<DT><CODE>-mhc-struct-return</CODE>
|
|
<DD>Return structures of more than one word in memory, rather than in a
|
|
register. This provides compatibility with the MetaWare HighC (hc)
|
|
compiler. Use the option <SAMP>`-fpcc-struct-return'</SAMP> for compatibility
|
|
with the Portable C Compiler (pcc).
|
|
<P>
|
|
|
|
<DT><CODE>-mnohc-struct-return</CODE>
|
|
<DD>Return some structures of more than one word in registers, when
|
|
convenient. This is the default. For compatibility with the
|
|
IBM-supplied compilers, use the option <SAMP>`-fpcc-struct-return'</SAMP> or the
|
|
option <SAMP>`-mhc-struct-return'</SAMP>.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="MIPS Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC30"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC29" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC29"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC31" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC31"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC18" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC18"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.14 MIPS Options </H3>
|
|
<!--docid::SEC30::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for the MIPS family of computers:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-mcpu=<VAR>cpu type</VAR></CODE>
|
|
<DD>Assume the defaults for the machine type <VAR>cpu type</VAR> when scheduling
|
|
instructions. The choices for <VAR>cpu type</VAR> are <SAMP>`r2000'</SAMP>, <SAMP>`r3000'</SAMP>,
|
|
<SAMP>`r3900'</SAMP>, <SAMP>`r4000'</SAMP>, <SAMP>`r4100'</SAMP>, <SAMP>`r4300'</SAMP>, <SAMP>`r4400'</SAMP>,
|
|
<SAMP>`r4600'</SAMP>, <SAMP>`r4650'</SAMP>, <SAMP>`r5000'</SAMP>, <SAMP>`r6000'</SAMP>, <SAMP>`r8000'</SAMP>,
|
|
and <SAMP>`orion'</SAMP>. Additionally, the <SAMP>`r2000'</SAMP>, <SAMP>`r3000'</SAMP>,
|
|
<SAMP>`r4000'</SAMP>, <SAMP>`r5000'</SAMP>, and <SAMP>`r6000'</SAMP> can be abbreviated as
|
|
<SAMP>`r2k'</SAMP> (or <SAMP>`r2K'</SAMP>), <SAMP>`r3k'</SAMP>, etc. While picking a specific
|
|
<VAR>cpu type</VAR> will schedule things appropriately for that particular
|
|
chip, the compiler will not generate any code that does not meet level 1
|
|
of the MIPS ISA (instruction set architecture) without a <SAMP>`-mipsX'</SAMP>
|
|
or <SAMP>`-mabi'</SAMP> switch being used.
|
|
<P>
|
|
|
|
<DT><CODE>-mips1</CODE>
|
|
<DD>Issue instructions from level 1 of the MIPS ISA. This is the default.
|
|
<SAMP>`r3000'</SAMP> is the default <VAR>cpu type</VAR> at this ISA level.
|
|
<P>
|
|
|
|
<DT><CODE>-mips2</CODE>
|
|
<DD>Issue instructions from level 2 of the MIPS ISA (branch likely, square
|
|
root instructions). <SAMP>`r6000'</SAMP> is the default <VAR>cpu type</VAR> at this
|
|
ISA level.
|
|
<P>
|
|
|
|
<DT><CODE>-mips3</CODE>
|
|
<DD>Issue instructions from level 3 of the MIPS ISA (64 bit instructions).
|
|
<SAMP>`r4000'</SAMP> is the default <VAR>cpu type</VAR> at this ISA level.
|
|
<P>
|
|
|
|
<DT><CODE>-mips4</CODE>
|
|
<DD>Issue instructions from level 4 of the MIPS ISA (conditional move,
|
|
prefetch, enhanced FPU instructions). <SAMP>`r8000'</SAMP> is the default
|
|
<VAR>cpu type</VAR> at this ISA level.
|
|
<P>
|
|
|
|
<DT><CODE>-mfp32</CODE>
|
|
<DD>Assume that 32 32-bit floating point registers are available. This is
|
|
the default.
|
|
<P>
|
|
|
|
<DT><CODE>-mfp64</CODE>
|
|
<DD>Assume that 32 64-bit floating point registers are available. This is
|
|
the default when the <SAMP>`-mips3'</SAMP> option is used.
|
|
<P>
|
|
|
|
<DT><CODE>-mgp32</CODE>
|
|
<DD>Assume that 32 32-bit general purpose registers are available. This is
|
|
the default.
|
|
<P>
|
|
|
|
<DT><CODE>-mgp64</CODE>
|
|
<DD>Assume that 32 64-bit general purpose registers are available. This is
|
|
the default when the <SAMP>`-mips3'</SAMP> option is used.
|
|
<P>
|
|
|
|
<DT><CODE>-mint64</CODE>
|
|
<DD>Force int and long types to be 64 bits wide. See <SAMP>`-mlong32'</SAMP> for an
|
|
explanation of the default, and the width of pointers.
|
|
<P>
|
|
|
|
<DT><CODE>-mlong64</CODE>
|
|
<DD>Force long types to be 64 bits wide. See <SAMP>`-mlong32'</SAMP> for an
|
|
explanation of the default, and the width of pointers.
|
|
<P>
|
|
|
|
<DT><CODE>-mlong32</CODE>
|
|
<DD>Force long, int, and pointer types to be 32 bits wide.
|
|
<P>
|
|
|
|
If none of <SAMP>`-mlong32'</SAMP>, <SAMP>`-mlong64'</SAMP>, or <SAMP>`-mint64'</SAMP> are set,
|
|
the size of ints, longs, and pointers depends on the ABI and ISA choosen.
|
|
For <SAMP>`-mabi=32'</SAMP>, and <SAMP>`-mabi=n32'</SAMP>, ints and longs are 32 bits
|
|
wide. For <SAMP>`-mabi=64'</SAMP>, ints are 32 bits, and longs are 64 bits wide.
|
|
For <SAMP>`-mabi=eabi'</SAMP> and either <SAMP>`-mips1'</SAMP> or <SAMP>`-mips2'</SAMP>, ints
|
|
and longs are 32 bits wide. For <SAMP>`-mabi=eabi'</SAMP> and higher ISAs, ints
|
|
are 32 bits, and longs are 64 bits wide. The width of pointer types is
|
|
the smaller of the width of longs or the width of general purpose
|
|
registers (which in turn depends on the ISA).
|
|
</P><P>
|
|
|
|
<DT><CODE>-mabi=32</CODE>
|
|
<DD><DT><CODE>-mabi=o64</CODE>
|
|
<DD><DT><CODE>-mabi=n32</CODE>
|
|
<DD><DT><CODE>-mabi=64</CODE>
|
|
<DD><DT><CODE>-mabi=eabi</CODE>
|
|
<DD>Generate code for the indicated ABI. The default instruction level is
|
|
<SAMP>`-mips1'</SAMP> for <SAMP>`32'</SAMP>, <SAMP>`-mips3'</SAMP> for <SAMP>`n32'</SAMP>, and
|
|
<SAMP>`-mips4'</SAMP> otherwise. Conversely, with <SAMP>`-mips1'</SAMP> or
|
|
<SAMP>`-mips2'</SAMP>, the default ABI is <SAMP>`32'</SAMP>; otherwise, the default ABI
|
|
is <SAMP>`64'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mmips-as</CODE>
|
|
<DD>Generate code for the MIPS assembler, and invoke <TT>`mips-tfile'</TT> to
|
|
add normal debug information. This is the default for all
|
|
platforms except for the OSF/1 reference platform, using the OSF/rose
|
|
object format. If the either of the <SAMP>`-gstabs'</SAMP> or <SAMP>`-gstabs+'</SAMP>
|
|
switches are used, the <TT>`mips-tfile'</TT> program will encapsulate the
|
|
stabs within MIPS ECOFF.
|
|
<P>
|
|
|
|
<DT><CODE>-mgas</CODE>
|
|
<DD>Generate code for the GNU assembler. This is the default on the OSF/1
|
|
reference platform, using the OSF/rose object format. Also, this is
|
|
the default if the configure option <SAMP>`--with-gnu-as'</SAMP> is used.
|
|
<P>
|
|
|
|
<DT><CODE>-msplit-addresses</CODE>
|
|
<DD><DT><CODE>-mno-split-addresses</CODE>
|
|
<DD>Generate code to load the high and low parts of address constants separately.
|
|
This allows <CODE>gcc</CODE> to optimize away redundant loads of the high order
|
|
bits of addresses. This optimization requires GNU as and GNU ld.
|
|
This optimization is enabled by default for some embedded targets where
|
|
GNU as and GNU ld are standard.
|
|
<P>
|
|
|
|
<DT><CODE>-mrnames</CODE>
|
|
<DD><DT><CODE>-mno-rnames</CODE>
|
|
<DD>The <SAMP>`-mrnames'</SAMP> switch says to output code using the MIPS software
|
|
names for the registers, instead of the hardware names (ie, <VAR>a0</VAR>
|
|
instead of <VAR>$4</VAR>). The only known assembler that supports this option
|
|
is the Algorithmics assembler.
|
|
<P>
|
|
|
|
<DT><CODE>-mgpopt</CODE>
|
|
<DD><DT><CODE>-mno-gpopt</CODE>
|
|
<DD>The <SAMP>`-mgpopt'</SAMP> switch says to write all of the data declarations
|
|
before the instructions in the text section, this allows the MIPS
|
|
assembler to generate one word memory references instead of using two
|
|
words for short global or static data items. This is on by default if
|
|
optimization is selected.
|
|
<P>
|
|
|
|
<DT><CODE>-mstats</CODE>
|
|
<DD><DT><CODE>-mno-stats</CODE>
|
|
<DD>For each non-inline function processed, the <SAMP>`-mstats'</SAMP> switch
|
|
causes the compiler to emit one line to the standard error file to
|
|
print statistics about the program (number of registers saved, stack
|
|
size, etc.).
|
|
<P>
|
|
|
|
<DT><CODE>-mmemcpy</CODE>
|
|
<DD><DT><CODE>-mno-memcpy</CODE>
|
|
<DD>The <SAMP>`-mmemcpy'</SAMP> switch makes all block moves call the appropriate
|
|
string function (<SAMP>`memcpy'</SAMP> or <SAMP>`bcopy'</SAMP>) instead of possibly
|
|
generating inline code.
|
|
<P>
|
|
|
|
<DT><CODE>-mmips-tfile</CODE>
|
|
<DD><DT><CODE>-mno-mips-tfile</CODE>
|
|
<DD>The <SAMP>`-mno-mips-tfile'</SAMP> switch causes the compiler not
|
|
postprocess the object file with the <TT>`mips-tfile'</TT> program,
|
|
after the MIPS assembler has generated it to add debug support. If
|
|
<TT>`mips-tfile'</TT> is not run, then no local variables will be
|
|
available to the debugger. In addition, <TT>`stage2'</TT> and
|
|
<TT>`stage3'</TT> objects will have the temporary file names passed to the
|
|
assembler embedded in the object file, which means the objects will
|
|
not compare the same. The <SAMP>`-mno-mips-tfile'</SAMP> switch should only
|
|
be used when there are bugs in the <TT>`mips-tfile'</TT> program that
|
|
prevents compilation.
|
|
<P>
|
|
|
|
<DT><CODE>-msoft-float</CODE>
|
|
<DD>Generate output containing library calls for floating point.
|
|
<STRONG>Warning:</STRONG> the requisite libraries are not part of GCC.
|
|
Normally the facilities of the machine's usual C compiler are used, but
|
|
this can't be done directly in cross-compilation. You must make your
|
|
own arrangements to provide suitable library functions for
|
|
cross-compilation.
|
|
<P>
|
|
|
|
<DT><CODE>-mhard-float</CODE>
|
|
<DD>Generate output containing floating point instructions. This is the
|
|
default if you use the unmodified sources.
|
|
<P>
|
|
|
|
<DT><CODE>-mabicalls</CODE>
|
|
<DD><DT><CODE>-mno-abicalls</CODE>
|
|
<DD>Emit (or do not emit) the pseudo operations <SAMP>`.abicalls'</SAMP>,
|
|
<SAMP>`.cpload'</SAMP>, and <SAMP>`.cprestore'</SAMP> that some System V.4 ports use for
|
|
position independent code.
|
|
<P>
|
|
|
|
<DT><CODE>-mlong-calls</CODE>
|
|
<DD><DT><CODE>-mno-long-calls</CODE>
|
|
<DD>Do all calls with the <SAMP>`JALR'</SAMP> instruction, which requires
|
|
loading up a function's address into a register before the call.
|
|
You need to use this switch, if you call outside of the current
|
|
512 megabyte segment to functions that are not through pointers.
|
|
<P>
|
|
|
|
<DT><CODE>-mhalf-pic</CODE>
|
|
<DD><DT><CODE>-mno-half-pic</CODE>
|
|
<DD>Put pointers to extern references into the data section and load them
|
|
up, rather than put the references in the text section.
|
|
<P>
|
|
|
|
<DT><CODE>-membedded-pic</CODE>
|
|
<DD><DT><CODE>-mno-embedded-pic</CODE>
|
|
<DD>Generate PIC code suitable for some embedded systems. All calls are
|
|
made using PC relative address, and all data is addressed using the $gp
|
|
register. No more than 65536 bytes of global data may be used. This
|
|
requires GNU as and GNU ld which do most of the work. This currently
|
|
only works on targets which use ECOFF; it does not work with ELF.
|
|
<P>
|
|
|
|
<DT><CODE>-membedded-data</CODE>
|
|
<DD><DT><CODE>-mno-embedded-data</CODE>
|
|
<DD>Allocate variables to the read-only data section first if possible, then
|
|
next in the small data section if possible, otherwise in data. This gives
|
|
slightly slower code than the default, but reduces the amount of RAM required
|
|
when executing, and thus may be preferred for some embedded systems.
|
|
<P>
|
|
|
|
<DT><CODE>-msingle-float</CODE>
|
|
<DD><DT><CODE>-mdouble-float</CODE>
|
|
<DD>The <SAMP>`-msingle-float'</SAMP> switch tells gcc to assume that the floating
|
|
point coprocessor only supports single precision operations, as on the
|
|
<SAMP>`r4650'</SAMP> chip. The <SAMP>`-mdouble-float'</SAMP> switch permits gcc to use
|
|
double precision operations. This is the default.
|
|
<P>
|
|
|
|
<DT><CODE>-mmad</CODE>
|
|
<DD><DT><CODE>-mno-mad</CODE>
|
|
<DD>Permit use of the <SAMP>`mad'</SAMP>, <SAMP>`madu'</SAMP> and <SAMP>`mul'</SAMP> instructions,
|
|
as on the <SAMP>`r4650'</SAMP> chip.
|
|
<P>
|
|
|
|
<DT><CODE>-m4650</CODE>
|
|
<DD>Turns on <SAMP>`-msingle-float'</SAMP>, <SAMP>`-mmad'</SAMP>, and, at least for now,
|
|
<SAMP>`-mcpu=r4650'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mips16</CODE>
|
|
<DD><DT><CODE>-mno-mips16</CODE>
|
|
<DD>Enable 16-bit instructions.
|
|
<P>
|
|
|
|
<DT><CODE>-mentry</CODE>
|
|
<DD>Use the entry and exit pseudo ops. This option can only be used with
|
|
<SAMP>`-mips16'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-EL</CODE>
|
|
<DD>Compile code for the processor in little endian mode.
|
|
The requisite libraries are assumed to exist.
|
|
<P>
|
|
|
|
<DT><CODE>-EB</CODE>
|
|
<DD>Compile code for the processor in big endian mode.
|
|
The requisite libraries are assumed to exist.
|
|
<P>
|
|
|
|
<DT><CODE>-G <VAR>num</VAR></CODE>
|
|
<DD><A NAME="IDX212"></A>
|
|
<A NAME="IDX213"></A>
|
|
Put global and static items less than or equal to <VAR>num</VAR> bytes into
|
|
the small data or bss sections instead of the normal data or bss
|
|
section. This allows the assembler to emit one word memory reference
|
|
instructions based on the global pointer (<VAR>gp</VAR> or <VAR>$28</VAR>),
|
|
instead of the normal two words used. By default, <VAR>num</VAR> is 8 when
|
|
the MIPS assembler is used, and 0 when the GNU assembler is used. The
|
|
<SAMP>`-G <VAR>num</VAR>'</SAMP> switch is also passed to the assembler and linker.
|
|
All modules should be compiled with the same <SAMP>`-G <VAR>num</VAR>'</SAMP>
|
|
value.
|
|
<P>
|
|
|
|
<DT><CODE>-nocpp</CODE>
|
|
<DD>Tell the MIPS assembler to not run its preprocessor over user
|
|
assembler files (with a <SAMP>`.s'</SAMP> suffix) when assembling them.
|
|
</DL>
|
|
<P>
|
|
|
|
These options are defined by the macro
|
|
<CODE>TARGET_SWITCHES</CODE> in the machine description. The default for the
|
|
options is also defined by that macro, which enables you to change the
|
|
defaults.
|
|
</P><P>
|
|
|
|
<A NAME="i386 Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC31"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC30" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC30"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC32" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC32"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC18" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC18"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.15 Intel 386 Options </H3>
|
|
<!--docid::SEC31::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for the i386 family of computers:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-mcpu=<VAR>cpu type</VAR></CODE>
|
|
<DD>Assume the defaults for the machine type <VAR>cpu type</VAR> when scheduling
|
|
instructions. The choices for <VAR>cpu type</VAR> are:
|
|
<P>
|
|
|
|
<TABLE>
|
|
<TR><TD><SAMP>`i386'</SAMP> </TD><TD> <SAMP>`i486'</SAMP> </TD><TD> <SAMP>`i586'</SAMP> </TD><TD> <SAMP>`i686'</SAMP></TD>
|
|
</TR>
|
|
<TR><TD><SAMP>`pentium'</SAMP> </TD><TD> <SAMP>`pentiumpro'</SAMP> </TD><TD> <SAMP>`k6'</SAMP></TD>
|
|
</TR></TABLE>
|
|
<P>
|
|
|
|
While picking a specific <VAR>cpu type</VAR> will schedule things appropriately
|
|
for that particular chip, the compiler will not generate any code that
|
|
does not run on the i386 without the <SAMP>`-march=<VAR>cpu type</VAR>'</SAMP> option
|
|
being used. <SAMP>`i586'</SAMP> is equivalent to <SAMP>`pentium'</SAMP> and <SAMP>`i686'</SAMP>
|
|
is equivalent to <SAMP>`pentiumpro'</SAMP>. <SAMP>`k6'</SAMP> is the AMD chip as
|
|
opposed to the Intel ones.
|
|
</P><P>
|
|
|
|
<DT><CODE>-march=<VAR>cpu type</VAR></CODE>
|
|
<DD>Generate instructions for the machine type <VAR>cpu type</VAR>. The choices
|
|
for <VAR>cpu type</VAR> are the same as for <SAMP>`-mcpu'</SAMP>. Moreover,
|
|
specifying <SAMP>`-march=<VAR>cpu type</VAR>'</SAMP> implies <SAMP>`-mcpu=<VAR>cpu type</VAR>'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-m386</CODE>
|
|
<DD><DT><CODE>-m486</CODE>
|
|
<DD><DT><CODE>-mpentium</CODE>
|
|
<DD><DT><CODE>-mpentiumpro</CODE>
|
|
<DD>Synonyms for -mcpu=i386, -mcpu=i486, -mcpu=pentium, and -mcpu=pentiumpro
|
|
respectively. These synonyms are deprecated.
|
|
<P>
|
|
|
|
<DT><CODE>-mieee-fp</CODE>
|
|
<DD><DT><CODE>-mno-ieee-fp</CODE>
|
|
<DD>Control whether or not the compiler uses IEEE floating point
|
|
comparisons. These handle correctly the case where the result of a
|
|
comparison is unordered.
|
|
<P>
|
|
|
|
<DT><CODE>-msoft-float</CODE>
|
|
<DD>Generate output containing library calls for floating point.
|
|
<STRONG>Warning:</STRONG> the requisite libraries are not part of GCC.
|
|
Normally the facilities of the machine's usual C compiler are used, but
|
|
this can't be done directly in cross-compilation. You must make your
|
|
own arrangements to provide suitable library functions for
|
|
cross-compilation.
|
|
<P>
|
|
|
|
On machines where a function returns floating point results in the 80387
|
|
register stack, some floating point opcodes may be emitted even if
|
|
<SAMP>`-msoft-float'</SAMP> is used.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mno-fp-ret-in-387</CODE>
|
|
<DD>Do not use the FPU registers for return values of functions.
|
|
<P>
|
|
|
|
The usual calling convention has functions return values of types
|
|
<CODE>float</CODE> and <CODE>double</CODE> in an FPU register, even if there
|
|
is no FPU. The idea is that the operating system should emulate
|
|
an FPU.
|
|
</P><P>
|
|
|
|
The option <SAMP>`-mno-fp-ret-in-387'</SAMP> causes such values to be returned
|
|
in ordinary CPU registers instead.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mno-fancy-math-387</CODE>
|
|
<DD>Some 387 emulators do not support the <CODE>sin</CODE>, <CODE>cos</CODE> and
|
|
<CODE>sqrt</CODE> instructions for the 387. Specify this option to avoid
|
|
generating those instructions. This option is the default on FreeBSD.
|
|
As of revision 2.6.1, these instructions are not generated unless you
|
|
also use the <SAMP>`-ffast-math'</SAMP> switch.
|
|
<P>
|
|
|
|
<DT><CODE>-malign-double</CODE>
|
|
<DD><DT><CODE>-mno-align-double</CODE>
|
|
<DD>Control whether GCC aligns <CODE>double</CODE>, <CODE>long double</CODE>, and
|
|
<CODE>long long</CODE> variables on a two word boundary or a one word
|
|
boundary. Aligning <CODE>double</CODE> variables on a two word boundary will
|
|
produce code that runs somewhat faster on a <SAMP>`Pentium'</SAMP> at the
|
|
expense of more memory.
|
|
<P>
|
|
|
|
<STRONG>Warning:</STRONG> if you use the <SAMP>`-malign-double'</SAMP> switch,
|
|
structures containing the above types will be aligned differently than
|
|
the published application binary interface specifications for the 386.
|
|
</P><P>
|
|
|
|
<DT><CODE>-msvr3-shlib</CODE>
|
|
<DD><DT><CODE>-mno-svr3-shlib</CODE>
|
|
<DD>Control whether GCC places uninitialized locals into <CODE>bss</CODE> or
|
|
<CODE>data</CODE>. <SAMP>`-msvr3-shlib'</SAMP> places these locals into <CODE>bss</CODE>.
|
|
These options are meaningful only on System V Release 3.
|
|
<P>
|
|
|
|
<DT><CODE>-mno-wide-multiply</CODE>
|
|
<DD><DT><CODE>-mwide-multiply</CODE>
|
|
<DD>Control whether GCC uses the <CODE>mul</CODE> and <CODE>imul</CODE> that produce
|
|
64 bit results in <CODE>eax:edx</CODE> from 32 bit operands to do <CODE>long
|
|
long</CODE> multiplies and 32-bit division by constants.
|
|
<P>
|
|
|
|
<DT><CODE>-mrtd</CODE>
|
|
<DD>Use a different function-calling convention, in which functions that
|
|
take a fixed number of arguments return with the <CODE>ret</CODE> <VAR>num</VAR>
|
|
instruction, which pops their arguments while returning. This saves one
|
|
instruction in the caller since there is no need to pop the arguments
|
|
there.
|
|
<P>
|
|
|
|
You can specify that an individual function is called with this calling
|
|
sequence with the function attribute <SAMP>`stdcall'</SAMP>. You can also
|
|
override the <SAMP>`-mrtd'</SAMP> option by using the function attribute
|
|
<SAMP>`cdecl'</SAMP>. See section <A HREF="gcc_4.html#SEC84" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_4.html#SEC84">4.23 Declaring Attributes of Functions</A>.
|
|
</P><P>
|
|
|
|
<STRONG>Warning:</STRONG> this calling convention is incompatible with the one
|
|
normally used on Unix, so you cannot use it if you need to call
|
|
libraries compiled with the Unix compiler.
|
|
</P><P>
|
|
|
|
Also, you must provide function prototypes for all functions that
|
|
take variable numbers of arguments (including <CODE>printf</CODE>);
|
|
otherwise incorrect code will be generated for calls to those
|
|
functions.
|
|
</P><P>
|
|
|
|
In addition, seriously incorrect code will result if you call a
|
|
function with too many arguments. (Normally, extra arguments are
|
|
harmlessly ignored.)
|
|
</P><P>
|
|
|
|
<DT><CODE>-mreg-alloc=<VAR>regs</VAR></CODE>
|
|
<DD>Control the default allocation order of integer registers. The
|
|
string <VAR>regs</VAR> is a series of letters specifying a register. The
|
|
supported letters are: <CODE>a</CODE> allocate EAX; <CODE>b</CODE> allocate EBX;
|
|
<CODE>c</CODE> allocate ECX; <CODE>d</CODE> allocate EDX; <CODE>S</CODE> allocate ESI;
|
|
<CODE>D</CODE> allocate EDI; <CODE>B</CODE> allocate EBP.
|
|
<P>
|
|
|
|
<DT><CODE>-mregparm=<VAR>num</VAR></CODE>
|
|
<DD>Control how many registers are used to pass integer arguments. By
|
|
default, no registers are used to pass arguments, and at most 3
|
|
registers can be used. You can control this behavior for a specific
|
|
function by using the function attribute <SAMP>`regparm'</SAMP>.
|
|
See section <A HREF="gcc_4.html#SEC84" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_4.html#SEC84">4.23 Declaring Attributes of Functions</A>.
|
|
<P>
|
|
|
|
<STRONG>Warning:</STRONG> if you use this switch, and
|
|
<VAR>num</VAR> is nonzero, then you must build all modules with the same
|
|
value, including any libraries. This includes the system libraries and
|
|
startup modules.
|
|
</P><P>
|
|
|
|
<DT><CODE>-malign-loops=<VAR>num</VAR></CODE>
|
|
<DD>Align loops to a 2 raised to a <VAR>num</VAR> byte boundary. If
|
|
<SAMP>`-malign-loops'</SAMP> is not specified, the default is 2 unless
|
|
gas 2.8 (or later) is being used in which case the default is
|
|
to align the loop on a 16 byte boundary if it is less than 8
|
|
bytes away.
|
|
<P>
|
|
|
|
<DT><CODE>-malign-jumps=<VAR>num</VAR></CODE>
|
|
<DD>Align instructions that are only jumped to to a 2 raised to a <VAR>num</VAR>
|
|
byte boundary. If <SAMP>`-malign-jumps'</SAMP> is not specified, the default is
|
|
2 if optimizing for a 386, and 4 if optimizing for a 486 unless
|
|
gas 2.8 (or later) is being used in which case the default is
|
|
to align the instruction on a 16 byte boundary if it is less
|
|
than 8 bytes away.
|
|
<P>
|
|
|
|
<DT><CODE>-malign-functions=<VAR>num</VAR></CODE>
|
|
<DD>Align the start of functions to a 2 raised to <VAR>num</VAR> byte boundary.
|
|
If <SAMP>`-malign-functions'</SAMP> is not specified, the default is 2 if optimizing
|
|
for a 386, and 4 if optimizing for a 486.
|
|
<P>
|
|
|
|
<DT><CODE>-mpreferred-stack-boundary=<VAR>num</VAR></CODE>
|
|
<DD>Attempt to keep the stack boundary aligned to a 2 raised to <VAR>num</VAR>
|
|
byte boundary. If <SAMP>`-mpreferred-stack-boundary'</SAMP> is not specified,
|
|
the default is 4 (16 bytes or 128 bits).
|
|
<P>
|
|
|
|
The stack is required to be aligned on a 4 byte boundary. On Pentium
|
|
and PentiumPro, <CODE>double</CODE> and <CODE>long double</CODE> values should be
|
|
aligned to an 8 byte boundary (see <SAMP>`-malign-double'</SAMP>) or suffer
|
|
significant run time performance penalties. On Pentium III, the
|
|
Streaming SIMD Extention (SSE) data type <CODE>__m128</CODE> suffers similar
|
|
penalties if it is not 16 byte aligned.
|
|
</P><P>
|
|
|
|
To ensure proper alignment of this values on the stack, the stack boundary
|
|
must be as aligned as that required by any value stored on the stack.
|
|
Further, every function must be generated such that it keeps the stack
|
|
aligned. Thus calling a function compiled with a higher preferred
|
|
stack boundary from a function compiled with a lower preferred stack
|
|
boundary will most likely misalign the stack. It is recommended that
|
|
libraries that use callbacks always use the default setting.
|
|
</P><P>
|
|
|
|
This extra alignment does consume extra stack space. Code that is sensitive
|
|
to stack space usage, such as embedded systems and operating system kernels,
|
|
may want to reduce the preferred alignment to
|
|
<SAMP>`-mpreferred-stack-boundary=2'</SAMP>.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="HPPA Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC32"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC31" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC31"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC33" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC33"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC18" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC18"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.16 HPPA Options </H3>
|
|
<!--docid::SEC32::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for the HPPA family of computers:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-march=<VAR>architecture type</VAR></CODE>
|
|
<DD>Generate code for the specified architecture. The choices for
|
|
<VAR>architecture type</VAR> are <SAMP>`1.0'</SAMP> for PA 1.0, <SAMP>`1.1'</SAMP> for PA
|
|
1.1, and <SAMP>`2.0'</SAMP> for PA 2.0 processors. Refer to
|
|
<TT>`/usr/lib/sched.models'</TT> on an HP-UX system to determine the proper
|
|
architecture option for your machine. Code compiled for lower numbered
|
|
architectures will run on higher numbered architectures, but not the
|
|
other way around.
|
|
<P>
|
|
|
|
PA 2.0 support currently requires gas snapshot 19990413 or later. The
|
|
next release of binutils (current is 2.9.1) will probably contain PA 2.0
|
|
support.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mpa-risc-1-0</CODE>
|
|
<DD><DT><CODE>-mpa-risc-1-1</CODE>
|
|
<DD><DT><CODE>-mpa-risc-2-0</CODE>
|
|
<DD>Synonyms for -march=1.0, -march=1.1, and -march=2.0 respectively.
|
|
<P>
|
|
|
|
<DT><CODE>-mbig-switch</CODE>
|
|
<DD>Generate code suitable for big switch tables. Use this option only if
|
|
the assembler/linker complain about out of range branches within a switch
|
|
table.
|
|
<P>
|
|
|
|
<DT><CODE>-mjump-in-delay</CODE>
|
|
<DD>Fill delay slots of function calls with unconditional jump instructions
|
|
by modifying the return pointer for the function call to be the target
|
|
of the conditional jump.
|
|
<P>
|
|
|
|
<DT><CODE>-mdisable-fpregs</CODE>
|
|
<DD>Prevent floating point registers from being used in any manner. This is
|
|
necessary for compiling kernels which perform lazy context switching of
|
|
floating point registers. If you use this option and attempt to perform
|
|
floating point operations, the compiler will abort.
|
|
<P>
|
|
|
|
<DT><CODE>-mdisable-indexing</CODE>
|
|
<DD>Prevent the compiler from using indexing address modes. This avoids some
|
|
rather obscure problems when compiling MIG generated code under MACH.
|
|
<P>
|
|
|
|
<DT><CODE>-mno-space-regs</CODE>
|
|
<DD>Generate code that assumes the target has no space registers. This allows
|
|
GCC to generate faster indirect calls and use unscaled index address modes.
|
|
<P>
|
|
|
|
Such code is suitable for level 0 PA systems and kernels.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mfast-indirect-calls</CODE>
|
|
<DD>Generate code that assumes calls never cross space boundaries. This
|
|
allows GCC to emit code which performs faster indirect calls.
|
|
<P>
|
|
|
|
This option will not work in the presense of shared libraries or nested
|
|
functions.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mspace</CODE>
|
|
<DD>Optimize for space rather than execution time. Currently this only
|
|
enables out of line function prologues and epilogues. This option is
|
|
incompatible with PIC code generation and profiling.
|
|
<P>
|
|
|
|
<DT><CODE>-mlong-load-store</CODE>
|
|
<DD>Generate 3-instruction load and store sequences as sometimes required by
|
|
the HP-UX 10 linker. This is equivalent to the <SAMP>`+k'</SAMP> option to
|
|
the HP compilers.
|
|
<P>
|
|
|
|
<DT><CODE>-mportable-runtime</CODE>
|
|
<DD>Use the portable calling conventions proposed by HP for ELF systems.
|
|
<P>
|
|
|
|
<DT><CODE>-mgas</CODE>
|
|
<DD>Enable the use of assembler directives only GAS understands.
|
|
<P>
|
|
|
|
<DT><CODE>-mschedule=<VAR>cpu type</VAR></CODE>
|
|
<DD>Schedule code according to the constraints for the machine type
|
|
<VAR>cpu type</VAR>. The choices for <VAR>cpu type</VAR> are <SAMP>`700'</SAMP>
|
|
<SAMP>`7100'</SAMP>, <SAMP>`7100LC'</SAMP>, <SAMP>`7200'</SAMP>, and <SAMP>`8000'</SAMP>. Refer to
|
|
<TT>`/usr/lib/sched.models'</TT> on an HP-UX system to determine the
|
|
proper scheduling option for your machine.
|
|
<P>
|
|
|
|
<DT><CODE>-mlinker-opt</CODE>
|
|
<DD>Enable the optimization pass in the HPUX linker. Note this makes symbolic
|
|
debugging impossible. It also triggers a bug in the HPUX 8 and HPUX 9 linkers
|
|
in which they give bogus error messages when linking some programs.
|
|
<P>
|
|
|
|
<DT><CODE>-msoft-float</CODE>
|
|
<DD>Generate output containing library calls for floating point.
|
|
<STRONG>Warning:</STRONG> the requisite libraries are not available for all HPPA
|
|
targets. Normally the facilities of the machine's usual C compiler are
|
|
used, but this cannot be done directly in cross-compilation. You must make
|
|
your own arrangements to provide suitable library functions for
|
|
cross-compilation. The embedded target <SAMP>`hppa1.1-*-pro'</SAMP>
|
|
does provide software floating point support.
|
|
<P>
|
|
|
|
<SAMP>`-msoft-float'</SAMP> changes the calling convention in the output file;
|
|
therefore, it is only useful if you compile <EM>all</EM> of a program with
|
|
this option. In particular, you need to compile <TT>`libgcc.a'</TT>, the
|
|
library that comes with GCC, with <SAMP>`-msoft-float'</SAMP> in order for
|
|
this to work.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Intel 960 Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC33"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC32" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC32"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC34" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC34"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC18" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC18"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.17 Intel 960 Options </H3>
|
|
<!--docid::SEC33::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for the Intel 960 implementations:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-m<VAR>cpu type</VAR></CODE>
|
|
<DD>Assume the defaults for the machine type <VAR>cpu type</VAR> for some of
|
|
the other options, including instruction scheduling, floating point
|
|
support, and addressing modes. The choices for <VAR>cpu type</VAR> are
|
|
<SAMP>`ka'</SAMP>, <SAMP>`kb'</SAMP>, <SAMP>`mc'</SAMP>, <SAMP>`ca'</SAMP>, <SAMP>`cf'</SAMP>,
|
|
<SAMP>`sa'</SAMP>, and <SAMP>`sb'</SAMP>.
|
|
The default is
|
|
<SAMP>`kb'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mnumerics</CODE>
|
|
<DD><DT><CODE>-msoft-float</CODE>
|
|
<DD>The <SAMP>`-mnumerics'</SAMP> option indicates that the processor does support
|
|
floating-point instructions. The <SAMP>`-msoft-float'</SAMP> option indicates
|
|
that floating-point support should not be assumed.
|
|
<P>
|
|
|
|
<DT><CODE>-mleaf-procedures</CODE>
|
|
<DD><DT><CODE>-mno-leaf-procedures</CODE>
|
|
<DD>Do (or do not) attempt to alter leaf procedures to be callable with the
|
|
<CODE>bal</CODE> instruction as well as <CODE>call</CODE>. This will result in more
|
|
efficient code for explicit calls when the <CODE>bal</CODE> instruction can be
|
|
substituted by the assembler or linker, but less efficient code in other
|
|
cases, such as calls via function pointers, or using a linker that doesn't
|
|
support this optimization.
|
|
<P>
|
|
|
|
<DT><CODE>-mtail-call</CODE>
|
|
<DD><DT><CODE>-mno-tail-call</CODE>
|
|
<DD>Do (or do not) make additional attempts (beyond those of the
|
|
machine-independent portions of the compiler) to optimize tail-recursive
|
|
calls into branches. You may not want to do this because the detection of
|
|
cases where this is not valid is not totally complete. The default is
|
|
<SAMP>`-mno-tail-call'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mcomplex-addr</CODE>
|
|
<DD><DT><CODE>-mno-complex-addr</CODE>
|
|
<DD>Assume (or do not assume) that the use of a complex addressing mode is a
|
|
win on this implementation of the i960. Complex addressing modes may not
|
|
be worthwhile on the K-series, but they definitely are on the C-series.
|
|
The default is currently <SAMP>`-mcomplex-addr'</SAMP> for all processors except
|
|
the CB and CC.
|
|
<P>
|
|
|
|
<DT><CODE>-mcode-align</CODE>
|
|
<DD><DT><CODE>-mno-code-align</CODE>
|
|
<DD>Align code to 8-byte boundaries for faster fetching (or don't bother).
|
|
Currently turned on by default for C-series implementations only.
|
|
<P>
|
|
|
|
<DT><CODE>-mic-compat</CODE>
|
|
<DD><DT><CODE>-mic2.0-compat</CODE>
|
|
<DD><DT><CODE>-mic3.0-compat</CODE>
|
|
<DD>Enable compatibility with iC960 v2.0 or v3.0.
|
|
<P>
|
|
|
|
<DT><CODE>-masm-compat</CODE>
|
|
<DD><DT><CODE>-mintel-asm</CODE>
|
|
<DD>Enable compatibility with the iC960 assembler.
|
|
<P>
|
|
|
|
<DT><CODE>-mstrict-align</CODE>
|
|
<DD><DT><CODE>-mno-strict-align</CODE>
|
|
<DD>Do not permit (do permit) unaligned accesses.
|
|
<P>
|
|
|
|
<DT><CODE>-mold-align</CODE>
|
|
<DD>Enable structure-alignment compatibility with Intel's gcc release version
|
|
1.3 (based on gcc 1.37). This option implies <SAMP>`-mstrict-align'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mlong-double-64</CODE>
|
|
<DD>Implement type <SAMP>`long double'</SAMP> as 64-bit floating point numbers.
|
|
Without the option <SAMP>`long double'</SAMP> is implemented by 80-bit
|
|
floating point numbers. The only reason we have it because there is
|
|
no 128-bit <SAMP>`long double'</SAMP> support in <SAMP>`fp-bit.c'</SAMP> yet. So it
|
|
is only useful for people using soft-float targets. Otherwise, we
|
|
should recommend against use of it.
|
|
<P>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="DEC Alpha Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC34"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC33" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC33"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC35" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC35"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC18" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC18"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.18 DEC Alpha Options </H3>
|
|
<!--docid::SEC34::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for the DEC Alpha implementations:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-mno-soft-float</CODE>
|
|
<DD><DT><CODE>-msoft-float</CODE>
|
|
<DD>Use (do not use) the hardware floating-point instructions for
|
|
floating-point operations. When <CODE>-msoft-float</CODE> is specified,
|
|
functions in <TT>`libgcc1.c'</TT> will be used to perform floating-point
|
|
operations. Unless they are replaced by routines that emulate the
|
|
floating-point operations, or compiled in such a way as to call such
|
|
emulations routines, these routines will issue floating-point
|
|
operations. If you are compiling for an Alpha without floating-point
|
|
operations, you must ensure that the library is built so as not to call
|
|
them.
|
|
<P>
|
|
|
|
Note that Alpha implementations without floating-point operations are
|
|
required to have floating-point registers.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mfp-reg</CODE>
|
|
<DD><DT><CODE>-mno-fp-regs</CODE>
|
|
<DD>Generate code that uses (does not use) the floating-point register set.
|
|
<CODE>-mno-fp-regs</CODE> implies <CODE>-msoft-float</CODE>. If the floating-point
|
|
register set is not used, floating point operands are passed in integer
|
|
registers as if they were integers and floating-point results are passed
|
|
in $0 instead of $f0. This is a non-standard calling sequence, so any
|
|
function with a floating-point argument or return value called by code
|
|
compiled with <CODE>-mno-fp-regs</CODE> must also be compiled with that
|
|
option.
|
|
<P>
|
|
|
|
A typical use of this option is building a kernel that does not use,
|
|
and hence need not save and restore, any floating-point registers.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mieee</CODE>
|
|
<DD>The Alpha architecture implements floating-point hardware optimized for
|
|
maximum performance. It is mostly compliant with the IEEE floating
|
|
point standard. However, for full compliance, software assistance is
|
|
required. This option generates code fully IEEE compliant code
|
|
<EM>except</EM> that the <VAR>inexact flag</VAR> is not maintained (see below).
|
|
If this option is turned on, the CPP macro <CODE>_IEEE_FP</CODE> is defined
|
|
during compilation. The option is a shorthand for: <SAMP>`-D_IEEE_FP
|
|
-mfp-trap-mode=su -mtrap-precision=i -mieee-conformant'</SAMP>. The resulting
|
|
code is less efficient but is able to correctly support denormalized
|
|
numbers and exceptional IEEE values such as not-a-number and plus/minus
|
|
infinity. Other Alpha compilers call this option
|
|
<CODE>-ieee_with_no_inexact</CODE>.
|
|
<P>
|
|
|
|
<DT><CODE>-mieee-with-inexact</CODE>
|
|
<DD>This is like <SAMP>`-mieee'</SAMP> except the generated code also maintains the
|
|
IEEE <VAR>inexact flag</VAR>. Turning on this option causes the generated
|
|
code to implement fully-compliant IEEE math. The option is a shorthand
|
|
for <SAMP>`-D_IEEE_FP -D_IEEE_FP_INEXACT'</SAMP> plus the three following:
|
|
<SAMP>`-mieee-conformant'</SAMP>,
|
|
<SAMP>`-mfp-trap-mode=sui'</SAMP>,
|
|
and <SAMP>`-mtrap-precision=i'</SAMP>.
|
|
On some Alpha implementations the resulting code may execute
|
|
significantly slower than the code generated by default. Since there
|
|
is very little code that depends on the <VAR>inexact flag</VAR>, you should
|
|
normally not specify this option. Other Alpha compilers call this
|
|
option <SAMP>`-ieee_with_inexact'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mfp-trap-mode=<VAR>trap mode</VAR></CODE>
|
|
<DD>This option controls what floating-point related traps are enabled.
|
|
Other Alpha compilers call this option <SAMP>`-fptm '</SAMP><VAR>trap mode</VAR>.
|
|
The trap mode can be set to one of four values:
|
|
<P>
|
|
|
|
<DL COMPACT>
|
|
<DT><SAMP>`n'</SAMP>
|
|
<DD>This is the default (normal) setting. The only traps that are enabled
|
|
are the ones that cannot be disabled in software (e.g., division by zero
|
|
trap).
|
|
<P>
|
|
|
|
<DT><SAMP>`u'</SAMP>
|
|
<DD>In addition to the traps enabled by <SAMP>`n'</SAMP>, underflow traps are enabled
|
|
as well.
|
|
<P>
|
|
|
|
<DT><SAMP>`su'</SAMP>
|
|
<DD>Like <SAMP>`su'</SAMP>, but the instructions are marked to be safe for software
|
|
completion (see Alpha architecture manual for details).
|
|
<P>
|
|
|
|
<DT><SAMP>`sui'</SAMP>
|
|
<DD>Like <SAMP>`su'</SAMP>, but inexact traps are enabled as well.
|
|
</DL>
|
|
<P>
|
|
|
|
<DT><CODE>-mfp-rounding-mode=<VAR>rounding mode</VAR></CODE>
|
|
<DD>Selects the IEEE rounding mode. Other Alpha compilers call this option
|
|
<SAMP>`-fprm '</SAMP><VAR>rounding mode</VAR>. The <VAR>rounding mode</VAR> can be one
|
|
of:
|
|
<P>
|
|
|
|
<DL COMPACT>
|
|
<DT><SAMP>`n'</SAMP>
|
|
<DD>Normal IEEE rounding mode. Floating point numbers are rounded towards
|
|
the nearest machine number or towards the even machine number in case
|
|
of a tie.
|
|
<P>
|
|
|
|
<DT><SAMP>`m'</SAMP>
|
|
<DD>Round towards minus infinity.
|
|
<P>
|
|
|
|
<DT><SAMP>`c'</SAMP>
|
|
<DD>Chopped rounding mode. Floating point numbers are rounded towards zero.
|
|
<P>
|
|
|
|
<DT><SAMP>`d'</SAMP>
|
|
<DD>Dynamic rounding mode. A field in the floating point control register
|
|
(<VAR>fpcr</VAR>, see Alpha architecture reference manual) controls the
|
|
rounding mode in effect. The C library initializes this register for
|
|
rounding towards plus infinity. Thus, unless your program modifies the
|
|
<VAR>fpcr</VAR>, <SAMP>`d'</SAMP> corresponds to round towards plus infinity.
|
|
</DL>
|
|
<P>
|
|
|
|
<DT><CODE>-mtrap-precision=<VAR>trap precision</VAR></CODE>
|
|
<DD>In the Alpha architecture, floating point traps are imprecise. This
|
|
means without software assistance it is impossible to recover from a
|
|
floating trap and program execution normally needs to be terminated.
|
|
GCC can generate code that can assist operating system trap handlers
|
|
in determining the exact location that caused a floating point trap.
|
|
Depending on the requirements of an application, different levels of
|
|
precisions can be selected:
|
|
<P>
|
|
|
|
<DL COMPACT>
|
|
<DT><SAMP>`p'</SAMP>
|
|
<DD>Program precision. This option is the default and means a trap handler
|
|
can only identify which program caused a floating point exception.
|
|
<P>
|
|
|
|
<DT><SAMP>`f'</SAMP>
|
|
<DD>Function precision. The trap handler can determine the function that
|
|
caused a floating point exception.
|
|
<P>
|
|
|
|
<DT><SAMP>`i'</SAMP>
|
|
<DD>Instruction precision. The trap handler can determine the exact
|
|
instruction that caused a floating point exception.
|
|
</DL>
|
|
<P>
|
|
|
|
Other Alpha compilers provide the equivalent options called
|
|
<SAMP>`-scope_safe'</SAMP> and <SAMP>`-resumption_safe'</SAMP>.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mieee-conformant</CODE>
|
|
<DD>This option marks the generated code as IEEE conformant. You must not
|
|
use this option unless you also specify <SAMP>`-mtrap-precision=i'</SAMP> and either
|
|
<SAMP>`-mfp-trap-mode=su'</SAMP> or <SAMP>`-mfp-trap-mode=sui'</SAMP>. Its only effect
|
|
is to emit the line <SAMP>`.eflag 48'</SAMP> in the function prologue of the
|
|
generated assembly file. Under DEC Unix, this has the effect that
|
|
IEEE-conformant math library routines will be linked in.
|
|
<P>
|
|
|
|
<DT><CODE>-mbuild-constants</CODE>
|
|
<DD>Normally GCC examines a 32- or 64-bit integer constant to
|
|
see if it can construct it from smaller constants in two or three
|
|
instructions. If it cannot, it will output the constant as a literal and
|
|
generate code to load it from the data segment at runtime.
|
|
<P>
|
|
|
|
Use this option to require GCC to construct <EM>all</EM> integer constants
|
|
using code, even if it takes more instructions (the maximum is six).
|
|
</P><P>
|
|
|
|
You would typically use this option to build a shared library dynamic
|
|
loader. Itself a shared library, it must relocate itself in memory
|
|
before it can find the variables and constants in its own data segment.
|
|
</P><P>
|
|
|
|
<DT><CODE>-malpha-as</CODE>
|
|
<DD><DT><CODE>-mgas</CODE>
|
|
<DD>Select whether to generate code to be assembled by the vendor-supplied
|
|
assembler (<SAMP>`-malpha-as'</SAMP>) or by the GNU assembler <SAMP>`-mgas'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-mbwx</CODE>
|
|
<DD><DT><CODE>-mno-bwx</CODE>
|
|
<DD><DT><CODE>-mcix</CODE>
|
|
<DD><DT><CODE>-mno-cix</CODE>
|
|
<DD><DT><CODE>-mmax</CODE>
|
|
<DD><DT><CODE>-mno-max</CODE>
|
|
<DD>Indicate whether GCC should generate code to use the optional BWX,
|
|
CIX, and MAX instruction sets. The default is to use the instruction sets
|
|
supported by the CPU type specified via <SAMP>`-mcpu='</SAMP> option or that
|
|
of the CPU on which GCC was built if none was specified.
|
|
<P>
|
|
|
|
<DT><CODE>-mcpu=<VAR>cpu_type</VAR></CODE>
|
|
<DD>Set the instruction set, register set, and instruction scheduling
|
|
parameters for machine type <VAR>cpu_type</VAR>. You can specify either the
|
|
<SAMP>`EV'</SAMP> style name or the corresponding chip number. GCC
|
|
supports scheduling parameters for the EV4 and EV5 family of processors
|
|
and will choose the default values for the instruction set from
|
|
the processor you specify. If you do not specify a processor type,
|
|
GCC will default to the processor on which the compiler was built.
|
|
<P>
|
|
|
|
Supported values for <VAR>cpu_type</VAR> are
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><SAMP>`ev4'</SAMP>
|
|
<DD><DT><SAMP>`21064'</SAMP>
|
|
<DD>Schedules as an EV4 and has no instruction set extensions.
|
|
<P>
|
|
|
|
<DT><SAMP>`ev5'</SAMP>
|
|
<DD><DT><SAMP>`21164'</SAMP>
|
|
<DD>Schedules as an EV5 and has no instruction set extensions.
|
|
<P>
|
|
|
|
<DT><SAMP>`ev56'</SAMP>
|
|
<DD><DT><SAMP>`21164a'</SAMP>
|
|
<DD>Schedules as an EV5 and supports the BWX extension.
|
|
<P>
|
|
|
|
<DT><SAMP>`pca56'</SAMP>
|
|
<DD><DT><SAMP>`21164pc'</SAMP>
|
|
<DD><DT><SAMP>`21164PC'</SAMP>
|
|
<DD>Schedules as an EV5 and supports the BWX and MAX extensions.
|
|
<P>
|
|
|
|
<DT><SAMP>`ev6'</SAMP>
|
|
<DD><DT><SAMP>`21264'</SAMP>
|
|
<DD>Schedules as an EV5 (until Digital releases the scheduling parameters
|
|
for the EV6) and supports the BWX, CIX, and MAX extensions.
|
|
</DL>
|
|
<P>
|
|
|
|
<DT><CODE>-mmemory-latency=<VAR>time</VAR></CODE>
|
|
<DD>Sets the latency the scheduler should assume for typical memory
|
|
references as seen by the application. This number is highly
|
|
dependant on the memory access patterns used by the application
|
|
and the size of the external cache on the machine.
|
|
<P>
|
|
|
|
Valid options for <VAR>time</VAR> are
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><SAMP>`<VAR>number</VAR>'</SAMP>
|
|
<DD>A decimal number representing clock cycles.
|
|
<P>
|
|
|
|
<DT><SAMP>`L1'</SAMP>
|
|
<DD><DT><SAMP>`L2'</SAMP>
|
|
<DD><DT><SAMP>`L3'</SAMP>
|
|
<DD><DT><SAMP>`main'</SAMP>
|
|
<DD>The compiler contains estimates of the number of clock cycles for
|
|
"typical" EV4 & EV5 hardware for the Level 1, 2 & 3 caches
|
|
(also called Dcache, Scache, and Bcache), as well as to main memory.
|
|
Note that L3 is only valid for EV5.
|
|
<P>
|
|
|
|
</DL>
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Clipper Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC35"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC34" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC34"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC36" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC36"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC18" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC18"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.19 Clipper Options </H3>
|
|
<!--docid::SEC35::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for the Clipper implementations:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-mc300</CODE>
|
|
<DD>Produce code for a C300 Clipper processor. This is the default.
|
|
<P>
|
|
|
|
<DT><CODE>-mc400</CODE>
|
|
<DD>Produce code for a C400 Clipper processor i.e. use floating point
|
|
registers f8..f15.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="H8/300 Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC36"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC35" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC35"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC37" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC37"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC19" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC19"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.20 H8/300 Options </H3>
|
|
<!--docid::SEC36::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for the H8/300 implementations:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-mrelax</CODE>
|
|
<DD>Shorten some address references at link time, when possible; uses the
|
|
linker option <SAMP>`-relax'</SAMP>. See section `<CODE>ld</CODE> and the H8/300' in <CITE>Using ld</CITE>, for a fuller description.
|
|
<P>
|
|
|
|
<DT><CODE>-mh</CODE>
|
|
<DD>Generate code for the H8/300H.
|
|
<P>
|
|
|
|
<DT><CODE>-ms</CODE>
|
|
<DD>Generate code for the H8/S.
|
|
<P>
|
|
|
|
<DT><CODE>-mint32</CODE>
|
|
<DD>Make <CODE>int</CODE> data 32 bits by default.
|
|
<P>
|
|
|
|
<DT><CODE>-malign-300</CODE>
|
|
<DD>On the h8/300h, use the same alignment rules as for the h8/300.
|
|
The default for the h8/300h is to align longs and floats on 4 byte boundaries.
|
|
<SAMP>`-malign-300'</SAMP> causes them to be aligned on 2 byte boundaries.
|
|
This option has no effect on the h8/300.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="SH Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC37"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC36" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC36"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC38" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC38"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC19" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC19"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.21 SH Options </H3>
|
|
<!--docid::SEC37::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for the SH implementations:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-m1</CODE>
|
|
<DD>Generate code for the SH1.
|
|
<P>
|
|
|
|
<DT><CODE>-m2</CODE>
|
|
<DD>Generate code for the SH2.
|
|
<P>
|
|
|
|
<DT><CODE>-m3</CODE>
|
|
<DD>Generate code for the SH3.
|
|
<P>
|
|
|
|
<DT><CODE>-m3e</CODE>
|
|
<DD>Generate code for the SH3e.
|
|
<P>
|
|
|
|
<DT><CODE>-mb</CODE>
|
|
<DD>Compile code for the processor in big endian mode.
|
|
<P>
|
|
|
|
<DT><CODE>-ml</CODE>
|
|
<DD>Compile code for the processor in little endian mode.
|
|
<P>
|
|
|
|
<DT><CODE>-mdalign</CODE>
|
|
<DD>Align doubles at 64 bit boundaries. Note that this changes the calling
|
|
conventions, and thus some functions from the standard C library will
|
|
not work unless you recompile it first with -mdalign.
|
|
<P>
|
|
|
|
<DT><CODE>-mrelax</CODE>
|
|
<DD>Shorten some address references at link time, when possible; uses the
|
|
linker option <SAMP>`-relax'</SAMP>.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="System V Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC38"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC37" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC37"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC39" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC39"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC19" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC19"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.22 Options for System V </H3>
|
|
<!--docid::SEC38::-->
|
|
<P>
|
|
|
|
These additional options are available on System V Release 4 for
|
|
compatibility with other compilers on those systems:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-G</CODE>
|
|
<DD>Create a shared object.
|
|
It is recommended that <SAMP>`-symbolic'</SAMP> or <SAMP>`-shared'</SAMP> be used instead.
|
|
<P>
|
|
|
|
<DT><CODE>-Qy</CODE>
|
|
<DD>Identify the versions of each tool used by the compiler, in a
|
|
<CODE>.ident</CODE> assembler directive in the output.
|
|
<P>
|
|
|
|
<DT><CODE>-Qn</CODE>
|
|
<DD>Refrain from adding <CODE>.ident</CODE> directives to the output file (this is
|
|
the default).
|
|
<P>
|
|
|
|
<DT><CODE>-YP,<VAR>dirs</VAR></CODE>
|
|
<DD>Search the directories <VAR>dirs</VAR>, and no others, for libraries
|
|
specified with <SAMP>`-l'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-Ym,<VAR>dir</VAR></CODE>
|
|
<DD>Look in the directory <VAR>dir</VAR> to find the M4 preprocessor.
|
|
The assembler uses this option.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="TMS320C3x/C4x Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC39"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC38" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC38"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC40" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC40"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC19" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC19"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.23 TMS320C3x/C4x Options </H3>
|
|
<!--docid::SEC39::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for TMS320C3x/C4x implementations:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
|
|
<DT><CODE>-mcpu=<VAR>cpu_type</VAR></CODE>
|
|
<DD>Set the instruction set, register set, and instruction scheduling
|
|
parameters for machine type <VAR>cpu_type</VAR>. Supported values for
|
|
<VAR>cpu_type</VAR> are <SAMP>`c30'</SAMP>, <SAMP>`c31'</SAMP>, <SAMP>`c32'</SAMP>, <SAMP>`c40'</SAMP>, and
|
|
<SAMP>`c44'</SAMP>. The default is <SAMP>`c40'</SAMP> to generate code for the
|
|
TMS320C40.
|
|
<P>
|
|
|
|
<DT><CODE>-mbig-memory</CODE>
|
|
<DD><DT><CODE>-mbig</CODE>
|
|
<DD><DT><CODE>-msmall-memory</CODE>
|
|
<DD><DT><CODE>-msmall</CODE>
|
|
<DD>Generates code for the big or small memory model. The small memory
|
|
model assumed that all data fits into one 64K word page. At run-time
|
|
the data page (DP) register must be set to point to the 64K page
|
|
containing the .bss and .data program sections. The big memory model is
|
|
the default and requires reloading of the DP register for every direct
|
|
memory access.
|
|
<P>
|
|
|
|
<DT><CODE>-mbk</CODE>
|
|
<DD><DT><CODE>-mno-bk</CODE>
|
|
<DD>Allow (disallow) allocation of general integer operands into the block
|
|
count register BK.
|
|
<P>
|
|
|
|
<DT><CODE>-mdb</CODE>
|
|
<DD><DT><CODE>-mno-db</CODE>
|
|
<DD>Enable (disable) generation of code using decrement and branch,
|
|
DBcond(D), instructions. This is enabled by default for the C4x. To be
|
|
on the safe side, this is disabled for the C3x, since the maximum
|
|
iteration count on the C3x is 2^23 + 1 (but who iterates loops more than
|
|
2^23 times on the C3x?). Note that GCC will try to reverse a loop so
|
|
that it can utilise the decrement and branch instruction, but will give
|
|
up if there is more than one memory reference in the loop. Thus a loop
|
|
where the loop counter is decremented can generate slightly more
|
|
efficient code, in cases where the RPTB instruction cannot be utilised.
|
|
<P>
|
|
|
|
<DT><CODE>-mdp-isr-reload</CODE>
|
|
<DD><DT><CODE>-mparanoid</CODE>
|
|
<DD>Force the DP register to be saved on entry to an interrupt service
|
|
routine (ISR), reloaded to point to the data section, and restored on
|
|
exit from the ISR. This should not be required unless someone has
|
|
violated the small memory model by modifying the DP register, say within
|
|
an object library.
|
|
<P>
|
|
|
|
<DT><CODE>-mmpyi</CODE>
|
|
<DD><DT><CODE>-mno-mpyi</CODE>
|
|
<DD>For the C3x use the 24-bit MPYI instruction for integer multiplies
|
|
instead of a library call to guarantee 32-bit results. Note that if one
|
|
of the operands is a constant, then the multiplication will be performed
|
|
using shifts and adds. If the -mmpyi option is not specified for the C3x,
|
|
then squaring operations are performed inline instead of a library call.
|
|
<P>
|
|
|
|
<DT><CODE>-mfast-fix</CODE>
|
|
<DD><DT><CODE>-mno-fast-fix</CODE>
|
|
<DD>The C3x/C4x FIX instruction to convert a floating point value to an
|
|
integer value chooses the nearest integer less than or equal to the
|
|
floating point value rather than to the nearest integer. Thus if the
|
|
floating point number is negative, the result will be incorrectly
|
|
truncated an additional code is necessary to detect and correct this
|
|
case. This option can be used to disable generation of the additional
|
|
code required to correct the result.
|
|
<P>
|
|
|
|
<DT><CODE>-mrptb</CODE>
|
|
<DD><DT><CODE>-mno-rptb</CODE>
|
|
<DD>Enable (disable) generation of repeat block sequences using the RPTB
|
|
instruction for zero overhead looping. The RPTB construct is only used
|
|
for innermost loops that do not call functions or jump across the loop
|
|
boundaries. There is no advantage having nested RPTB loops due to the
|
|
overhead required to save and restore the RC, RS, and RE registers.
|
|
This is enabled by default with -O2.
|
|
<P>
|
|
|
|
<DT><CODE>-mrpts=<VAR>count</VAR></CODE>
|
|
<DD><DT><CODE>-mno-rpts</CODE>
|
|
<DD>Enable (disable) the use of the single instruction repeat instruction
|
|
RPTS. If a repeat block contains a single instruction, and the loop
|
|
count can be guaranteed to be less than the value <VAR>count</VAR>, GCC will
|
|
emit a RPTS instruction instead of a RPTB. If no value is specified,
|
|
then a RPTS will be emitted even if the loop count cannot be determined
|
|
at compile time. Note that the repeated instruction following RPTS does
|
|
not have to be reloaded from memory each iteration, thus freeing up the
|
|
CPU buses for oeprands. However, since interrupts are blocked by this
|
|
instruction, it is disabled by default.
|
|
<P>
|
|
|
|
<DT><CODE>-mloop-unsigned</CODE>
|
|
<DD><DT><CODE>-mno-loop-unsigned</CODE>
|
|
<DD>The maximum iteration count when using RPTS and RPTB (and DB on the C40)
|
|
is 2^31 + 1 since these instructions test if the iteration count is
|
|
negative to terminate the loop. If the iteration count is unsigned
|
|
there is a possibility than the 2^31 + 1 maximum iteration count may be
|
|
exceeded. This switch allows an unsigned iteration count.
|
|
<P>
|
|
|
|
<DT><CODE>-mti</CODE>
|
|
<DD>Try to emit an assembler syntax that the TI assembler (asm30) is happy
|
|
with. This also enforces compatibility with the API employed by the TI
|
|
C3x C compiler. For example, long doubles are passed as structures
|
|
rather than in floating point registers.
|
|
<P>
|
|
|
|
<DT><CODE>-mregparm</CODE>
|
|
<DD><DT><CODE>-mmemparm</CODE>
|
|
<DD>Generate code that uses registers (stack) for passing arguments to functions.
|
|
By default, arguments are passed in registers where possible rather
|
|
than by pushing arguments on to the stack.
|
|
<P>
|
|
|
|
<DT><CODE>-mparallel-insns</CODE>
|
|
<DD><DT><CODE>-mno-parallel-insns</CODE>
|
|
<DD>Allow the generation of parallel instructions. This is enabled by
|
|
default with -O2.
|
|
<P>
|
|
|
|
<DT><CODE>-mparallel-mpy</CODE>
|
|
<DD><DT><CODE>-mno-parallel-mpy</CODE>
|
|
<DD>Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
|
|
provided -mparallel-insns is also specified. These instructions have
|
|
tight register constraints which can pessimize the code generation
|
|
of large functions.
|
|
<P>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="V850 Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC40"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC39" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC39"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC41" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC41"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC19" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC19"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.24 V850 Options </H3>
|
|
<!--docid::SEC40::-->
|
|
<P>
|
|
|
|
These <SAMP>`-m'</SAMP> options are defined for V850 implementations:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-mlong-calls</CODE>
|
|
<DD><DT><CODE>-mno-long-calls</CODE>
|
|
<DD>Treat all calls as being far away (near). If calls are assumed to be
|
|
far away, the compiler will always load the functions address up into a
|
|
register, and call indirect through the pointer.
|
|
<P>
|
|
|
|
<DT><CODE>-mno-ep</CODE>
|
|
<DD><DT><CODE>-mep</CODE>
|
|
<DD>Do not optimize (do optimize) basic blocks that use the same index
|
|
pointer 4 or more times to copy pointer into the <CODE>ep</CODE> register, and
|
|
use the shorter <CODE>sld</CODE> and <CODE>sst</CODE> instructions. The <SAMP>`-mep'</SAMP>
|
|
option is on by default if you optimize.
|
|
<P>
|
|
|
|
<DT><CODE>-mno-prolog-function</CODE>
|
|
<DD><DT><CODE>-mprolog-function</CODE>
|
|
<DD>Do not use (do use) external functions to save and restore registers at
|
|
the prolog and epilog of a function. The external functions are slower,
|
|
but use less code space if more than one function saves the same number
|
|
of registers. The <SAMP>`-mprolog-function'</SAMP> option is on by default if
|
|
you optimize.
|
|
<P>
|
|
|
|
<DT><CODE>-mspace</CODE>
|
|
<DD>Try to make the code as small as possible. At present, this just turns
|
|
on the <SAMP>`-mep'</SAMP> and <SAMP>`-mprolog-function'</SAMP> options.
|
|
<P>
|
|
|
|
<DT><CODE>-mtda=<VAR>n</VAR></CODE>
|
|
<DD>Put static or global variables whose size is <VAR>n</VAR> bytes or less into
|
|
the tiny data area that register <CODE>ep</CODE> points to. The tiny data
|
|
area can hold up to 256 bytes in total (128 bytes for byte references).
|
|
<P>
|
|
|
|
<DT><CODE>-msda=<VAR>n</VAR></CODE>
|
|
<DD>Put static or global variables whose size is <VAR>n</VAR> bytes or less into
|
|
the small data area that register <CODE>gp</CODE> points to. The small data
|
|
area can hold up to 64 kilobytes.
|
|
<P>
|
|
|
|
<DT><CODE>-mzda=<VAR>n</VAR></CODE>
|
|
<DD>Put static or global variables whose size is <VAR>n</VAR> bytes or less into
|
|
the first 32 kilobytes of memory.
|
|
|
|
<DT><CODE>-mv850</CODE>
|
|
<DD>Specify that the target processor is the V850.
|
|
<P>
|
|
|
|
<DT><CODE>-mbig-switch</CODE>
|
|
<DD>Generate code suitable for big switch tables. Use this option only if
|
|
the assembler/linker complain about out of range branches within a switch
|
|
table.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="ARC Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC41"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC40" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC40"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC42" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC42"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC19" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC19"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.25 ARC Options </H3>
|
|
<!--docid::SEC41::-->
|
|
<P>
|
|
|
|
These options are defined for ARC implementations:
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-EL</CODE>
|
|
<DD>Compile code for little endian mode. This is the default.
|
|
<P>
|
|
|
|
<DT><CODE>-EB</CODE>
|
|
<DD>Compile code for big endian mode.
|
|
<P>
|
|
|
|
<DT><CODE>-mmangle-cpu</CODE>
|
|
<DD>Prepend the name of the cpu to all public symbol names.
|
|
In multiple-processor systems, there are many ARC variants with different
|
|
instruction and register set characteristics. This flag prevents code
|
|
compiled for one cpu to be linked with code compiled for another.
|
|
No facility exists for handling variants that are "almost identical".
|
|
This is an all or nothing option.
|
|
<P>
|
|
|
|
<DT><CODE>-mcpu=<VAR>cpu</VAR></CODE>
|
|
<DD>Compile code for ARC variant <VAR>cpu</VAR>.
|
|
Which variants are supported depend on the configuration.
|
|
All variants support <SAMP>`-mcpu=base'</SAMP>, this is the default.
|
|
<P>
|
|
|
|
<DT><CODE>-mtext=<VAR>text section</VAR></CODE>
|
|
<DD><DT><CODE>-mdata=<VAR>data section</VAR></CODE>
|
|
<DD><DT><CODE>-mrodata=<VAR>readonly data section</VAR></CODE>
|
|
<DD>Put functions, data, and readonly data in <VAR>text section</VAR>,
|
|
<VAR>data section</VAR>, and <VAR>readonly data section</VAR> respectively
|
|
by default. This can be overridden with the <CODE>section</CODE> attribute.
|
|
See section <A HREF="gcc_4.html#SEC90" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_4.html#SEC90">4.29 Specifying Attributes of Variables</A>.
|
|
<P>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="NS32K Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC42"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC41" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC41"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC19" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC19"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC16" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC16"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H3> 2.14.26 NS32K Options </H3>
|
|
<!--docid::SEC42::-->
|
|
<P>
|
|
|
|
These are the <SAMP>`-m'</SAMP> options defined for the 32000 series. The default
|
|
values for these options depends on which style of 32000 was selected when
|
|
the compiler was configured; the defaults for the most common choices are
|
|
given below.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-m32032</CODE>
|
|
<DD><DT><CODE>-m32032</CODE>
|
|
<DD>Generate output for a 32032. This is the default
|
|
when the compiler is configured for 32032 and 32016 based systems.
|
|
<P>
|
|
|
|
<DT><CODE>-m32332</CODE>
|
|
<DD><DT><CODE>-m32332</CODE>
|
|
<DD>Generate output for a 32332. This is the default
|
|
when the compiler is configured for 32332-based systems.
|
|
<P>
|
|
|
|
<DT><CODE>-m32532</CODE>
|
|
<DD><DT><CODE>-m32532</CODE>
|
|
<DD>Generate output for a 32532. This is the default
|
|
when the compiler is configured for 32532-based systems.
|
|
<P>
|
|
|
|
<DT><CODE>-m32081</CODE>
|
|
<DD>Generate output containing 32081 instructions for floating point.
|
|
This is the default for all systems.
|
|
<P>
|
|
|
|
<DT><CODE>-m32381</CODE>
|
|
<DD>Generate output containing 32381 instructions for floating point. This
|
|
also implies <SAMP>`-m32081'</SAMP>. The 32381 is only compatible with the 32332
|
|
and 32532 cpus. This is the default for the pc532-netbsd configuration.
|
|
<P>
|
|
|
|
<DT><CODE>-mmulti-add</CODE>
|
|
<DD>Try and generate multiply-add floating point instructions <CODE>polyF</CODE>
|
|
and <CODE>dotF</CODE>. This option is only available if the <SAMP>`-m32381'</SAMP>
|
|
option is in effect. Using these instructions requires changes to to
|
|
register allocation which generally has a negative impact on
|
|
performance. This option should only be enabled when compiling code
|
|
particularly likely to make heavy use of multiply-add instructions.
|
|
<P>
|
|
|
|
<DT><CODE>-mnomulti-add</CODE>
|
|
<DD>Do not try and generate multiply-add floating point instructions
|
|
<CODE>polyF</CODE> and <CODE>dotF</CODE>. This is the default on all platforms.
|
|
<P>
|
|
|
|
<DT><CODE>-msoft-float</CODE>
|
|
<DD>Generate output containing library calls for floating point.
|
|
<STRONG>Warning:</STRONG> the requisite libraries may not be available.
|
|
<P>
|
|
|
|
<DT><CODE>-mnobitfield</CODE>
|
|
<DD>Do not use the bit-field instructions. On some machines it is faster to
|
|
use shifting and masking operations. This is the default for the pc532.
|
|
<P>
|
|
|
|
<DT><CODE>-mbitfield</CODE>
|
|
<DD>Do use the bit-field instructions. This is the default for all platforms
|
|
except the pc532.
|
|
<P>
|
|
|
|
<DT><CODE>-mrtd</CODE>
|
|
<DD>Use a different function-calling convention, in which functions
|
|
that take a fixed number of arguments return pop their
|
|
arguments on return with the <CODE>ret</CODE> instruction.
|
|
<P>
|
|
|
|
This calling convention is incompatible with the one normally
|
|
used on Unix, so you cannot use it if you need to call libraries
|
|
compiled with the Unix compiler.
|
|
</P><P>
|
|
|
|
Also, you must provide function prototypes for all functions that
|
|
take variable numbers of arguments (including <CODE>printf</CODE>);
|
|
otherwise incorrect code will be generated for calls to those
|
|
functions.
|
|
</P><P>
|
|
|
|
In addition, seriously incorrect code will result if you call a
|
|
function with too many arguments. (Normally, extra arguments are
|
|
harmlessly ignored.)
|
|
</P><P>
|
|
|
|
This option takes its name from the 680x0 <CODE>rtd</CODE> instruction.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mregparam</CODE>
|
|
<DD>Use a different function-calling convention where the first two arguments
|
|
are passed in registers.
|
|
<P>
|
|
|
|
This calling convention is incompatible with the one normally
|
|
used on Unix, so you cannot use it if you need to call libraries
|
|
compiled with the Unix compiler.
|
|
</P><P>
|
|
|
|
<DT><CODE>-mnoregparam</CODE>
|
|
<DD>Do not pass any arguments in registers. This is the default for all
|
|
targets.
|
|
<P>
|
|
|
|
<DT><CODE>-msb</CODE>
|
|
<DD>It is OK to use the sb as an index register which is always loaded with
|
|
zero. This is the default for the pc532-netbsd target.
|
|
<P>
|
|
|
|
<DT><CODE>-mnosb</CODE>
|
|
<DD>The sb register is not available for use or has not been initialized to
|
|
zero by the run time system. This is the default for all targets except
|
|
the pc532-netbsd. It is also implied whenever <SAMP>`-mhimem'</SAMP> or
|
|
<SAMP>`-fpic'</SAMP> is set.
|
|
<P>
|
|
|
|
<DT><CODE>-mhimem</CODE>
|
|
<DD>Many ns32000 series addressing modes use displacements of up to 512MB.
|
|
If an address is above 512MB then displacements from zero can not be used.
|
|
This option causes code to be generated which can be loaded above 512MB.
|
|
This may be useful for operating systems or ROM code.
|
|
<P>
|
|
|
|
<DT><CODE>-mnohimem</CODE>
|
|
<DD>Assume code will be loaded in the first 512MB of virtual address space.
|
|
This is the default for all platforms.
|
|
<P>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Code "Gen.class" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/Gen.class" Options"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC43"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC42" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC42"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC44" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC44"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC4" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC4"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 2.15 Options for Code Generation Conventions </H2>
|
|
<!--docid::SEC43::-->
|
|
<P>
|
|
|
|
These machine-independent options control the interface conventions
|
|
used in code generation.
|
|
</P><P>
|
|
|
|
Most of them have both positive and negative forms; the negative form
|
|
of <SAMP>`-ffoo'</SAMP> would be <SAMP>`-fno-foo'</SAMP>. In the table below, only
|
|
one of the forms is listed--the one which is not the default. You
|
|
can figure out the other form by either removing <SAMP>`no-'</SAMP> or adding
|
|
it.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-fexceptions</CODE>
|
|
<DD>Enable exception handling. Generates extra code needed to propagate
|
|
exceptions. For some targets, this implies generation of frame unwind
|
|
information for all functions. This can produce significant data size
|
|
overhead, although it does not affect execution.
|
|
If you do not specify this option, it is enabled by
|
|
default for languages like C++ which normally require exception handling,
|
|
and disabled for languages like C that do not normally require it.
|
|
However, when compiling C code that needs to interoperate properly with
|
|
exception handlers written in C++, you may need to enable this option.
|
|
You may also wish to disable this option is you are compiling older C++
|
|
programs that don't use exception handling.
|
|
<P>
|
|
|
|
<DT><CODE>-fpcc-struct-return</CODE>
|
|
<DD>Return "short" <CODE>struct</CODE> and <CODE>union</CODE> values in memory like
|
|
longer ones, rather than in registers. This convention is less
|
|
efficient, but it has the advantage of allowing intercallability between
|
|
GCC-compiled files and files compiled with other compilers.
|
|
<P>
|
|
|
|
The precise convention for returning structures in memory depends
|
|
on the target configuration macros.
|
|
</P><P>
|
|
|
|
Short structures and unions are those whose size and alignment match
|
|
that of some integer type.
|
|
</P><P>
|
|
|
|
<DT><CODE>-freg-struct-return</CODE>
|
|
<DD>Use the convention that <CODE>struct</CODE> and <CODE>union</CODE> values are
|
|
returned in registers when possible. This is more efficient for small
|
|
structures than <SAMP>`-fpcc-struct-return'</SAMP>.
|
|
<P>
|
|
|
|
If you specify neither <SAMP>`-fpcc-struct-return'</SAMP> nor its contrary
|
|
<SAMP>`-freg-struct-return'</SAMP>, GCC defaults to whichever convention is
|
|
standard for the target. If there is no standard convention, GCC
|
|
defaults to <SAMP>`-fpcc-struct-return'</SAMP>, except on targets where GCC
|
|
is the principal compiler. In those cases, we can choose the standard,
|
|
and we chose the more efficient register return alternative.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fshort-enums</CODE>
|
|
<DD>Allocate to an <CODE>enum</CODE> type only as many bytes as it needs for the
|
|
declared range of possible values. Specifically, the <CODE>enum</CODE> type
|
|
will be equivalent to the smallest integer type which has enough room.
|
|
<P>
|
|
|
|
<DT><CODE>-fshort-double</CODE>
|
|
<DD>Use the same size for <CODE>double</CODE> as for <CODE>float</CODE>.
|
|
<P>
|
|
|
|
<DT><CODE>-fshared-data</CODE>
|
|
<DD>Requests that the data and non-<CODE>const</CODE> variables of this
|
|
compilation be shared data rather than private data. The distinction
|
|
makes sense only on certain operating systems, where shared data is
|
|
shared between processes running the same program, while private data
|
|
exists in one copy per process.
|
|
<P>
|
|
|
|
<DT><CODE>-fno-common</CODE>
|
|
<DD>Allocate even uninitialized global variables in the bss section of the
|
|
object file, rather than generating them as common blocks. This has the
|
|
effect that if the same variable is declared (without <CODE>extern</CODE>) in
|
|
two different compilations, you will get an error when you link them.
|
|
The only reason this might be useful is if you wish to verify that the
|
|
program will work on other systems which always work this way.
|
|
<P>
|
|
|
|
<DT><CODE>-fno-ident</CODE>
|
|
<DD>Ignore the <SAMP>`#ident'</SAMP> directive.
|
|
<P>
|
|
|
|
<DT><CODE>-fno-gnu-linker</CODE>
|
|
<DD>Do not output global initializations (such as C++ constructors and
|
|
destructors) in the form used by the GNU linker (on systems where the GNU
|
|
linker is the standard method of handling them). Use this option when
|
|
you want to use a non-GNU linker, which also requires using the
|
|
<CODE>collect2</CODE> program to make sure the system linker includes
|
|
constructors and destructors. (<CODE>collect2</CODE> is included in the GCC
|
|
distribution.) For systems which <EM>must</EM> use <CODE>collect2</CODE>, the
|
|
compiler driver <CODE>gcc</CODE> is configured to do this automatically.
|
|
<P>
|
|
|
|
<DT><CODE>-finhibit-size-directive</CODE>
|
|
<DD>Don't output a <CODE>.size</CODE> assembler directive, or anything else that
|
|
would cause trouble if the function is split in the middle, and the
|
|
two halves are placed at locations far apart in memory. This option is
|
|
used when compiling <TT>`crtstuff.c'</TT>; you should not need to use it
|
|
for anything else.
|
|
<P>
|
|
|
|
<DT><CODE>-fverbose-asm</CODE>
|
|
<DD>Put extra commentary information in the generated assembly code to
|
|
make it more readable. This option is generally only of use to those
|
|
who actually need to read the generated assembly code (perhaps while
|
|
debugging the compiler itself).
|
|
<P>
|
|
|
|
<SAMP>`-fno-verbose-asm'</SAMP>, the default, causes the
|
|
extra information to be omitted and is useful when comparing two assembler
|
|
files.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fvolatile</CODE>
|
|
<DD>Consider all memory references through pointers to be volatile.
|
|
<P>
|
|
|
|
<DT><CODE>-fvolatile-global</CODE>
|
|
<DD>Consider all memory references to extern and global data items to
|
|
be volatile. GCC does not consider static data items to be volatile
|
|
because of this switch.
|
|
<P>
|
|
|
|
<DT><CODE>-fvolatile-static</CODE>
|
|
<DD>Consider all memory references to static data to be volatile.
|
|
<P>
|
|
|
|
<DT><CODE>-fpic</CODE>
|
|
<DD><A NAME="IDX214"></A>
|
|
<A NAME="IDX215"></A>
|
|
Generate position-independent code (PIC) suitable for use in a shared
|
|
library, if supported for the target machine. Such code accesses all
|
|
constant addresses through a global offset table (GOT). The dynamic
|
|
loader resolves the GOT entries when the program starts (the dynamic
|
|
loader is not part of GCC; it is part of the operating system). If
|
|
the GOT size for the linked executable exceeds a machine-specific
|
|
maximum size, you get an error message from the linker indicating that
|
|
<SAMP>`-fpic'</SAMP> does not work; in that case, recompile with <SAMP>`-fPIC'</SAMP>
|
|
instead. (These maximums are 16k on the m88k, 8k on the Sparc, and 32k
|
|
on the m68k and RS/6000. The 386 has no such limit.)
|
|
<P>
|
|
|
|
Position-independent code requires special support, and therefore works
|
|
only on certain machines. For the 386, GCC supports PIC for System V
|
|
but not for the Sun 386i. Code generated for the IBM RS/6000 is always
|
|
position-independent.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fPIC</CODE>
|
|
<DD>If supported for the target machine, emit position-independent code,
|
|
suitable for dynamic linking and avoiding any limit on the size of the
|
|
global offset table. This option makes a difference on the m68k, m88k,
|
|
and the Sparc.
|
|
<P>
|
|
|
|
Position-independent code requires special support, and therefore works
|
|
only on certain machines.
|
|
</P><P>
|
|
|
|
<DT><CODE>-ffixed-<VAR>reg</VAR></CODE>
|
|
<DD>Treat the register named <VAR>reg</VAR> as a fixed register; generated code
|
|
should never refer to it (except perhaps as a stack pointer, frame
|
|
pointer or in some other fixed role).
|
|
<P>
|
|
|
|
<VAR>reg</VAR> must be the name of a register. The register names accepted
|
|
are machine-specific and are defined in the <CODE>REGISTER_NAMES</CODE>
|
|
macro in the machine description macro file.
|
|
</P><P>
|
|
|
|
This flag does not have a negative form, because it specifies a
|
|
three-way choice.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fcall-used-<VAR>reg</VAR></CODE>
|
|
<DD>Treat the register named <VAR>reg</VAR> as an allocable register that is
|
|
clobbered by function calls. It may be allocated for temporaries or
|
|
variables that do not live across a call. Functions compiled this way
|
|
will not save and restore the register <VAR>reg</VAR>.
|
|
<P>
|
|
|
|
It is an error to used this flag with the frame pointer or stack pointer.
|
|
Use of this flag for other registers that have fixed pervasive roles in
|
|
the machine's execution model will produce disastrous results.
|
|
</P><P>
|
|
|
|
This flag does not have a negative form, because it specifies a
|
|
three-way choice.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fcall-saved-<VAR>reg</VAR></CODE>
|
|
<DD>Treat the register named <VAR>reg</VAR> as an allocable register saved by
|
|
functions. It may be allocated even for temporaries or variables that
|
|
live across a call. Functions compiled this way will save and restore
|
|
the register <VAR>reg</VAR> if they use it.
|
|
<P>
|
|
|
|
It is an error to used this flag with the frame pointer or stack pointer.
|
|
Use of this flag for other registers that have fixed pervasive roles in
|
|
the machine's execution model will produce disastrous results.
|
|
</P><P>
|
|
|
|
A different sort of disaster will result from the use of this flag for
|
|
a register in which function values may be returned.
|
|
</P><P>
|
|
|
|
This flag does not have a negative form, because it specifies a
|
|
three-way choice.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fpack-struct</CODE>
|
|
<DD>Pack all structure members together without holes. Usually you would
|
|
not want to use this option, since it makes the code suboptimal, and
|
|
the offsets of structure members won't agree with system libraries.
|
|
<P>
|
|
|
|
<DT><CODE>-fcheck-memory-usage</CODE>
|
|
<DD>Generate extra code to check each memory access. GCC will generate
|
|
code that is suitable for a detector of bad memory accesses such as
|
|
<TT>`Checker'</TT>.
|
|
<P>
|
|
|
|
Normally, you should compile all, or none, of your code with this option.
|
|
</P><P>
|
|
|
|
If you do mix code compiled with and without this option,
|
|
you must ensure that all code that has side effects
|
|
and that is called by code compiled with this option
|
|
is, itself, compiled with this option.
|
|
If you do not, you might get erroneous messages from the detector.
|
|
</P><P>
|
|
|
|
If you use functions from a library that have side-effects (such as
|
|
<CODE>read</CODE>), you might not be able to recompile the library and
|
|
specify this option. In that case, you can enable the
|
|
<SAMP>`-fprefix-function-name'</SAMP> option, which requests GCC to encapsulate
|
|
your code and make other functions look as if they were compiled with
|
|
<SAMP>`-fcheck-memory-usage'</SAMP>. This is done by calling "stubs",
|
|
which are provided by the detector. If you cannot find or build
|
|
stubs for every function you call, you might have to specify
|
|
<SAMP>`-fcheck-memory-usage'</SAMP> without <SAMP>`-fprefix-function-name'</SAMP>.
|
|
</P><P>
|
|
|
|
If you specify this option, you can not use the <CODE>asm</CODE> or
|
|
<CODE>__asm__</CODE> keywords in functions with memory checking enabled. The
|
|
compiler cannot understand what the <CODE>asm</CODE> statement will do, and
|
|
therefore cannot generate the appropriate code, so it is rejected.
|
|
However, the function attribute <CODE>no_check_memory_usage</CODE> will
|
|
disable memory checking within a function, and <CODE>asm</CODE> statements can
|
|
be put inside such functions. Inline expansion of a non-checked
|
|
function within a checked function is permitted; the inline function's
|
|
memory accesses won't be checked, but the rest will.
|
|
</P><P>
|
|
|
|
If you move your <CODE>asm</CODE> statements to non-checked inline functions,
|
|
but they do access memory, you can add calls to the support code in your
|
|
inline function, to indicate any reads, writes, or copies being done.
|
|
These calls would be similar to those done in the stubs described above.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fprefix-function-name</CODE>
|
|
<DD>Request GCC to add a prefix to the symbols generated for function names.
|
|
GCC adds a prefix to the names of functions defined as well as
|
|
functions called. Code compiled with this option and code compiled
|
|
without the option can't be linked together, unless stubs are used.
|
|
<P>
|
|
|
|
If you compile the following code with <SAMP>`-fprefix-function-name'</SAMP>
|
|
<TABLE><tr><td> </td><td class=example><pre>extern void bar (int);
|
|
void
|
|
foo (int a)
|
|
{
|
|
return bar (a + 5);
|
|
}
|
|
</pre></td></tr></table></P><P>
|
|
|
|
GCC will compile the code as if it was written:
|
|
<TABLE><tr><td> </td><td class=example><pre>extern void prefix_bar (int);
|
|
void
|
|
prefix_foo (int a)
|
|
{
|
|
return prefix_bar (a + 5);
|
|
}
|
|
</pre></td></tr></table>This option is designed to be used with <SAMP>`-fcheck-memory-usage'</SAMP>.
|
|
</P><P>
|
|
|
|
<DT><CODE>-finstrument-functions</CODE>
|
|
<DD>Generate instrumentation calls for entry and exit to functions. Just
|
|
after function entry and just before function exit, the following
|
|
profiling functions will be called with the address of the current
|
|
function and its call site. (On some platforms,
|
|
<CODE>__builtin_return_address</CODE> does not work beyond the current
|
|
function, so the call site information may not be available to the
|
|
profiling functions otherwise.)
|
|
<P>
|
|
|
|
<TABLE><tr><td> </td><td class=example><pre>void __cyg_profile_func_enter (void *this_fn, void *call_site);
|
|
void __cyg_profile_func_exit (void *this_fn, void *call_site);
|
|
</pre></td></tr></table></P><P>
|
|
|
|
The first argument is the address of the start of the current function,
|
|
which may be looked up exactly in the symbol table.
|
|
</P><P>
|
|
|
|
This instrumentation is also done for functions expanded inline in other
|
|
functions. The profiling calls will indicate where, conceptually, the
|
|
inline function is entered and exited. This means that addressable
|
|
versions of such functions must be available. If all your uses of a
|
|
function are expanded inline, this may mean an additional expansion of
|
|
code size. If you use <SAMP>`extern inline'</SAMP> in your C code, an
|
|
addressable version of such functions must be provided. (This is
|
|
normally the case anyways, but if you get lucky and the optimizer always
|
|
expands the functions inline, you might have gotten away without
|
|
providing static copies.)
|
|
</P><P>
|
|
|
|
A function may be given the attribute <CODE>no_instrument_function</CODE>, in
|
|
which case this instrumentation will not be done. This can be used, for
|
|
example, for the profiling functions listed above, high-priority
|
|
interrupt routines, and any functions from which the profiling functions
|
|
cannot safely be called (perhaps signal handlers, if the profiling
|
|
routines generate output or allocate memory).
|
|
</P><P>
|
|
|
|
<DT><CODE>-fstack-check</CODE>
|
|
<DD>Generate code to verify that you do not go beyond the boundary of the
|
|
stack. You should specify this flag if you are running in an
|
|
environment with multiple threads, but only rarely need to specify it in
|
|
a single-threaded environment since stack overflow is automatically
|
|
detected on nearly all systems if there is only one stack.
|
|
<P>
|
|
|
|
<A NAME="IDX216"></A>
|
|
<A NAME="IDX217"></A>
|
|
<DT><CODE>-fargument-alias</CODE>
|
|
<DD><DT><CODE>-fargument-noalias</CODE>
|
|
<DD><DT><CODE>-fargument-noalias-global</CODE>
|
|
<DD>Specify the possible relationships among parameters and between
|
|
parameters and global data.
|
|
<P>
|
|
|
|
<SAMP>`-fargument-alias'</SAMP> specifies that arguments (parameters) may
|
|
alias each other and may alias global storage.
|
|
<SAMP>`-fargument-noalias'</SAMP> specifies that arguments do not alias
|
|
each other, but may alias global storage.
|
|
<SAMP>`-fargument-noalias-global'</SAMP> specifies that arguments do not
|
|
alias each other and do not alias global storage.
|
|
</P><P>
|
|
|
|
Each language will automatically use whatever option is required by
|
|
the language standard. You should not need to use these options yourself.
|
|
</P><P>
|
|
|
|
<DT><CODE>-fleading-underscore</CODE>
|
|
<DD>This option and its counterpart, -fno-leading-underscore, forcibly
|
|
change the way C symbols are represented in the object file. One use
|
|
is to help link with legacy assembly code.
|
|
<P>
|
|
|
|
Be warned that you should know what you are doing when invoking this
|
|
option, and that not all targets provide complete support for it.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Environment Variables"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC44"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC43" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC43"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC45" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC45"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC4" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC4"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 2.16 Environment Variables Affecting GCC </H2>
|
|
<!--docid::SEC44::-->
|
|
<P>
|
|
|
|
This section describes several environment variables that affect how GCC
|
|
operates. Some of them work by specifying directories or prefixes to use
|
|
when searching for various kinds of files. Some are used to specify other
|
|
aspects of the compilation environment.
|
|
</P><P>
|
|
|
|
Note that you can also specify places to search using options such as
|
|
<SAMP>`-B'</SAMP>, <SAMP>`-I'</SAMP> and <SAMP>`-L'</SAMP> (see section <A HREF="gcc_2.html#SEC14" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC14">2.12 Options for Directory Search</A>). These
|
|
take precedence over places specified using environment variables, which
|
|
in turn take precedence over those specified by the configuration of GCC.
|
|
See section <A HREF="gcc_17.html#SEC200" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_17.html#SEC200">17.1 Controlling the Compilation Driver, <TT>`gcc'</TT></A>.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>LANG</CODE>
|
|
<DD><DT><CODE>LC_CTYPE</CODE>
|
|
<DD><DT><CODE>LC_MESSAGES</CODE>
|
|
<DD><DT><CODE>LC_ALL</CODE>
|
|
<DD><A NAME="IDX218"></A>
|
|
<A NAME="IDX219"></A>
|
|
<A NAME="IDX220"></A>
|
|
<A NAME="IDX221"></A>
|
|
<A NAME="IDX222"></A>
|
|
These environment variables control the way that GCC uses
|
|
localization information that allow GCC to work with different
|
|
national conventions. GCC inspects the locale categories
|
|
<CODE>LC_CTYPE</CODE> and <CODE>LC_MESSAGES</CODE> if it has been configured to do
|
|
so. These locale categories can be set to any value supported by your
|
|
installation. A typical value is <SAMP>`en_UK'</SAMP> for English in the United
|
|
Kingdom.
|
|
<P>
|
|
|
|
The <CODE>LC_CTYPE</CODE> environment variable specifies character
|
|
classification. GCC uses it to determine the character boundaries in
|
|
a string; this is needed for some multibyte encodings that contain quote
|
|
and escape characters that would otherwise be interpreted as a string
|
|
end or escape.
|
|
</P><P>
|
|
|
|
The <CODE>LC_MESSAGES</CODE> environment variable specifies the language to
|
|
use in diagnostic messages.
|
|
</P><P>
|
|
|
|
If the <CODE>LC_ALL</CODE> environment variable is set, it overrides the value
|
|
of <CODE>LC_CTYPE</CODE> and <CODE>LC_MESSAGES</CODE>; otherwise, <CODE>LC_CTYPE</CODE>
|
|
and <CODE>LC_MESSAGES</CODE> default to the value of the <CODE>LANG</CODE>
|
|
environment variable. If none of these variables are set, GCC
|
|
defaults to traditional C English behavior.
|
|
</P><P>
|
|
|
|
<DT><CODE>TMPDIR</CODE>
|
|
<DD><A NAME="IDX223"></A>
|
|
If <CODE>TMPDIR</CODE> is set, it specifies the directory to use for temporary
|
|
files. GCC uses temporary files to hold the output of one stage of
|
|
compilation which is to be used as input to the next stage: for example,
|
|
the output of the preprocessor, which is the input to the compiler
|
|
proper.
|
|
<P>
|
|
|
|
<DT><CODE>GCC_EXEC_PREFIX</CODE>
|
|
<DD><A NAME="IDX224"></A>
|
|
If <CODE>GCC_EXEC_PREFIX</CODE> is set, it specifies a prefix to use in the
|
|
names of the subprograms executed by the compiler. No slash is added
|
|
when this prefix is combined with the name of a subprogram, but you can
|
|
specify a prefix that ends with a slash if you wish.
|
|
<P>
|
|
|
|
If GCC cannot find the subprogram using the specified prefix, it
|
|
tries looking in the usual places for the subprogram.
|
|
</P><P>
|
|
|
|
The default value of <CODE>GCC_EXEC_PREFIX</CODE> is
|
|
<TT>`<VAR>prefix</VAR>/lib/gcc-lib/'</TT> where <VAR>prefix</VAR> is the value
|
|
of <CODE>prefix</CODE> when you ran the <TT>`configure'</TT> script.
|
|
</P><P>
|
|
|
|
Other prefixes specified with <SAMP>`-B'</SAMP> take precedence over this prefix.
|
|
</P><P>
|
|
|
|
This prefix is also used for finding files such as <TT>`crt0.o'</TT> that are
|
|
used for linking.
|
|
</P><P>
|
|
|
|
In addition, the prefix is used in an unusual way in finding the
|
|
directories to search for header files. For each of the standard
|
|
directories whose name normally begins with <SAMP>`/usr/local/lib/gcc-lib'</SAMP>
|
|
(more precisely, with the value of <CODE>GCC_INCLUDE_DIR</CODE>), GCC tries
|
|
replacing that beginning with the specified prefix to produce an
|
|
alternate directory name. Thus, with <SAMP>`-Bfoo/'</SAMP>, GCC will search
|
|
<TT>`foo/bar'</TT> where it would normally search <TT>`/usr/local/lib/bar'</TT>.
|
|
These alternate directories are searched first; the standard directories
|
|
come next.
|
|
</P><P>
|
|
|
|
<DT><CODE>COMPILER_PATH</CODE>
|
|
<DD><A NAME="IDX225"></A>
|
|
The value of <CODE>COMPILER_PATH</CODE> is a colon-separated list of
|
|
directories, much like <CODE>PATH</CODE>. GCC tries the directories thus
|
|
specified when searching for subprograms, if it can't find the
|
|
subprograms using <CODE>GCC_EXEC_PREFIX</CODE>.
|
|
<P>
|
|
|
|
<DT><CODE>LIBRARY_PATH</CODE>
|
|
<DD><A NAME="IDX226"></A>
|
|
The value of <CODE>LIBRARY_PATH</CODE> is a colon-separated list of
|
|
directories, much like <CODE>PATH</CODE>. When configured as a native compiler,
|
|
GCC tries the directories thus specified when searching for special
|
|
linker files, if it can't find them using <CODE>GCC_EXEC_PREFIX</CODE>. Linking
|
|
using GCC also uses these directories when searching for ordinary
|
|
libraries for the <SAMP>`-l'</SAMP> option (but directories specified with
|
|
<SAMP>`-L'</SAMP> come first).
|
|
<P>
|
|
|
|
<DT><CODE>C_INCLUDE_PATH</CODE>
|
|
<DD><DT><CODE>CPLUS_INCLUDE_PATH</CODE>
|
|
<DD><DT><CODE>OBJC_INCLUDE_PATH</CODE>
|
|
<DD><A NAME="IDX227"></A>
|
|
<A NAME="IDX228"></A>
|
|
<A NAME="IDX229"></A>
|
|
These environment variables pertain to particular languages. Each
|
|
variable's value is a colon-separated list of directories, much like
|
|
<CODE>PATH</CODE>. When GCC searches for header files, it tries the
|
|
directories listed in the variable for the language you are using, after
|
|
the directories specified with <SAMP>`-I'</SAMP> but before the standard header
|
|
file directories.
|
|
<P>
|
|
|
|
<DT><CODE>DEPENDENCIES_OUTPUT</CODE>
|
|
<DD><A NAME="IDX230"></A>
|
|
<A NAME="IDX231"></A>
|
|
If this variable is set, its value specifies how to output dependencies
|
|
for Make based on the header files processed by the compiler. This
|
|
output looks much like the output from the <SAMP>`-M'</SAMP> option
|
|
(see section <A HREF="gcc_2.html#SEC11" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC11">2.9 Options Controlling the Preprocessor</A>), but it goes to a separate file, and is
|
|
in addition to the usual results of compilation.
|
|
<P>
|
|
|
|
The value of <CODE>DEPENDENCIES_OUTPUT</CODE> can be just a file name, in
|
|
which case the Make rules are written to that file, guessing the target
|
|
name from the source file name. Or the value can have the form
|
|
<SAMP>`<VAR>file</VAR> <VAR>target</VAR>'</SAMP>, in which case the rules are written to
|
|
file <VAR>file</VAR> using <VAR>target</VAR> as the target name.
|
|
</P><P>
|
|
|
|
<DT><CODE>LANG</CODE>
|
|
<DD><A NAME="IDX232"></A>
|
|
<A NAME="IDX233"></A>
|
|
This variable is used to pass locale information to the compiler. One way in
|
|
which this information is used is to determine the character set to be used
|
|
when character literals, string literals and comments are parsed in C and C++.
|
|
When the compiler is configured to allow multibyte characters,
|
|
the following values for <CODE>LANG</CODE> are recognized:
|
|
<P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>C-JIS</CODE>
|
|
<DD>Recognize JIS characters.
|
|
<DT><CODE>C-SJIS</CODE>
|
|
<DD>Recognize SJIS characters.
|
|
<DT><CODE>C-EUCJP</CODE>
|
|
<DD>Recognize EUCJP characters.
|
|
</DL>
|
|
<P>
|
|
|
|
If <CODE>LANG</CODE> is not defined, or if it has some other value, then the
|
|
compiler will use mblen and mbtowc as defined by the default locale to
|
|
recognize and translate multibyte characters.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Running Protoize"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC45"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC44" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC44"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC4" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC4"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC2" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 2.17 Running Protoize </H2>
|
|
<!--docid::SEC45::-->
|
|
<P>
|
|
|
|
The program <CODE>protoize</CODE> is an optional part of GNU C. You can use
|
|
it to add prototypes to a program, thus converting the program to ANSI
|
|
C in one respect. The companion program <CODE>unprotoize</CODE> does the
|
|
reverse: it removes argument types from any prototypes that are found.
|
|
</P><P>
|
|
|
|
When you run these programs, you must specify a set of source files as
|
|
command line arguments. The conversion programs start out by compiling
|
|
these files to see what functions they define. The information gathered
|
|
about a file <VAR>foo</VAR> is saved in a file named <TT>`<VAR>foo</VAR>.X'</TT>.
|
|
</P><P>
|
|
|
|
After scanning comes actual conversion. The specified files are all
|
|
eligible to be converted; any files they include (whether sources or
|
|
just headers) are eligible as well.
|
|
</P><P>
|
|
|
|
But not all the eligible files are converted. By default,
|
|
<CODE>protoize</CODE> and <CODE>unprotoize</CODE> convert only source and header
|
|
files in the current directory. You can specify additional directories
|
|
whose files should be converted with the <SAMP>`-d <VAR>directory</VAR>'</SAMP>
|
|
option. You can also specify particular files to exclude with the
|
|
<SAMP>`-x <VAR>file</VAR>'</SAMP> option. A file is converted if it is eligible, its
|
|
directory name matches one of the specified directory names, and its
|
|
name within the directory has not been excluded.
|
|
</P><P>
|
|
|
|
Basic conversion with <CODE>protoize</CODE> consists of rewriting most
|
|
function definitions and function declarations to specify the types of
|
|
the arguments. The only ones not rewritten are those for varargs
|
|
functions.
|
|
</P><P>
|
|
|
|
<CODE>protoize</CODE> optionally inserts prototype declarations at the
|
|
beginning of the source file, to make them available for any calls that
|
|
precede the function's definition. Or it can insert prototype
|
|
declarations with block scope in the blocks where undeclared functions
|
|
are called.
|
|
</P><P>
|
|
|
|
Basic conversion with <CODE>unprotoize</CODE> consists of rewriting most
|
|
function declarations to remove any argument types, and rewriting
|
|
function definitions to the old-style pre-ANSI form.
|
|
</P><P>
|
|
|
|
Both conversion programs print a warning for any function declaration or
|
|
definition that they can't convert. You can suppress these warnings
|
|
with <SAMP>`-q'</SAMP>.
|
|
</P><P>
|
|
|
|
The output from <CODE>protoize</CODE> or <CODE>unprotoize</CODE> replaces the
|
|
original source file. The original file is renamed to a name ending
|
|
with <SAMP>`.save'</SAMP>. If the <SAMP>`.save'</SAMP> file already exists, then
|
|
the source file is simply discarded.
|
|
</P><P>
|
|
|
|
<CODE>protoize</CODE> and <CODE>unprotoize</CODE> both depend on GCC itself to
|
|
scan the program and collect information about the functions it uses.
|
|
So neither of these programs will work until GCC is installed.
|
|
</P><P>
|
|
|
|
Here is a table of the options you can use with <CODE>protoize</CODE> and
|
|
<CODE>unprotoize</CODE>. Each option works with both programs unless
|
|
otherwise stated.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<DT><CODE>-B <VAR>directory</VAR></CODE>
|
|
<DD>Look for the file <TT>`SYSCALLS.c.X'</TT> in <VAR>directory</VAR>, instead of the
|
|
usual directory (normally <TT>`/usr/local/lib'</TT>). This file contains
|
|
prototype information about standard system functions. This option
|
|
applies only to <CODE>protoize</CODE>.
|
|
<P>
|
|
|
|
<DT><CODE>-c <VAR>compilation-options</VAR></CODE>
|
|
<DD>Use <VAR>compilation-options</VAR> as the options when running <CODE>gcc</CODE> to
|
|
produce the <SAMP>`.X'</SAMP> files. The special option <SAMP>`-aux-info'</SAMP> is
|
|
always passed in addition, to tell <CODE>gcc</CODE> to write a <SAMP>`.X'</SAMP> file.
|
|
<P>
|
|
|
|
Note that the compilation options must be given as a single argument to
|
|
<CODE>protoize</CODE> or <CODE>unprotoize</CODE>. If you want to specify several
|
|
<CODE>gcc</CODE> options, you must quote the entire set of compilation options
|
|
to make them a single word in the shell.
|
|
</P><P>
|
|
|
|
There are certain <CODE>gcc</CODE> arguments that you cannot use, because they
|
|
would produce the wrong kind of output. These include <SAMP>`-g'</SAMP>,
|
|
<SAMP>`-O'</SAMP>, <SAMP>`-c'</SAMP>, <SAMP>`-S'</SAMP>, and <SAMP>`-o'</SAMP> If you include these in
|
|
the <VAR>compilation-options</VAR>, they are ignored.
|
|
</P><P>
|
|
|
|
<DT><CODE>-C</CODE>
|
|
<DD>Rename files to end in <SAMP>`.C'</SAMP> instead of <SAMP>`.c'</SAMP>.
|
|
This is convenient if you are converting a C program to C++.
|
|
This option applies only to <CODE>protoize</CODE>.
|
|
<P>
|
|
|
|
<DT><CODE>-g</CODE>
|
|
<DD>Add explicit global declarations. This means inserting explicit
|
|
declarations at the beginning of each source file for each function
|
|
that is called in the file and was not declared. These declarations
|
|
precede the first function definition that contains a call to an
|
|
undeclared function. This option applies only to <CODE>protoize</CODE>.
|
|
<P>
|
|
|
|
<DT><CODE>-i <VAR>string</VAR></CODE>
|
|
<DD>Indent old-style parameter declarations with the string <VAR>string</VAR>.
|
|
This option applies only to <CODE>protoize</CODE>.
|
|
<P>
|
|
|
|
<CODE>unprotoize</CODE> converts prototyped function definitions to old-style
|
|
function definitions, where the arguments are declared between the
|
|
argument list and the initial <SAMP>`{'</SAMP>. By default, <CODE>unprotoize</CODE>
|
|
uses five spaces as the indentation. If you want to indent with just
|
|
one space instead, use <SAMP>`-i " "'</SAMP>.
|
|
</P><P>
|
|
|
|
<DT><CODE>-k</CODE>
|
|
<DD>Keep the <SAMP>`.X'</SAMP> files. Normally, they are deleted after conversion
|
|
is finished.
|
|
<P>
|
|
|
|
<DT><CODE>-l</CODE>
|
|
<DD>Add explicit local declarations. <CODE>protoize</CODE> with <SAMP>`-l'</SAMP> inserts
|
|
a prototype declaration for each function in each block which calls the
|
|
function without any declaration. This option applies only to
|
|
<CODE>protoize</CODE>.
|
|
<P>
|
|
|
|
<DT><CODE>-n</CODE>
|
|
<DD>Make no real changes. This mode just prints information about the conversions
|
|
that would have been done without <SAMP>`-n'</SAMP>.
|
|
<P>
|
|
|
|
<DT><CODE>-N</CODE>
|
|
<DD>Make no <SAMP>`.save'</SAMP> files. The original files are simply deleted.
|
|
Use this option with caution.
|
|
<P>
|
|
|
|
<DT><CODE>-p <VAR>program</VAR></CODE>
|
|
<DD>Use the program <VAR>program</VAR> as the compiler. Normally, the name
|
|
<TT>`gcc'</TT> is used.
|
|
<P>
|
|
|
|
<DT><CODE>-q</CODE>
|
|
<DD>Work quietly. Most warnings are suppressed.
|
|
<P>
|
|
|
|
<DT><CODE>-v</CODE>
|
|
<DD>Print the version number, just like <SAMP>`-v'</SAMP> for <CODE>gcc</CODE>.
|
|
</DL>
|
|
<P>
|
|
|
|
If you need special compiler options to compile one of your program's
|
|
source files, then you should generate that file's <SAMP>`.X'</SAMP> file
|
|
specially, by running <CODE>gcc</CODE> on that source file with the
|
|
appropriate options and the option <SAMP>`-aux-info'</SAMP>. Then run
|
|
<CODE>protoize</CODE> on the entire set of files. <CODE>protoize</CODE> will use
|
|
the existing <SAMP>`.X'</SAMP> file because it is newer than the source file.
|
|
For example:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=example><pre>gcc -Dfoo=bar file1.c -aux-info
|
|
protoize *.c
|
|
</pre></td></tr></table></P><P>
|
|
|
|
You need to include the special files along with the rest in the
|
|
<CODE>protoize</CODE> command, even though their <SAMP>`.X'</SAMP> files already
|
|
exist, because otherwise they won't get converted.
|
|
</P><P>
|
|
|
|
See section <A HREF="gcc_7.html#SEC132" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_7.html#SEC132">7.11 Caveats of using <CODE>protoize</CODE></A>, for more information on how to use
|
|
<CODE>protoize</CODE> successfully.
|
|
</P><P>
|
|
|
|
Note most of this information is out of date and superceded by the EGCS
|
|
install procedures. It is provided for historical reference only.
|
|
</P><P>
|
|
|
|
<A NAME="Installation"></A>
|
|
<HR SIZE="6">
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_2.html#SEC4" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC4"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_3.html#SEC46" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC46"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc.html#SEC_Top" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_toc.html#SEC_Contents" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_24.html#SEC261" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_24.html#SEC261">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gcc_abt.html#SEC_About" tppabs="http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<BR>
|
|
<FONT SIZE="-1">
|
|
This document was generated
|
|
by <I>GCC Administrator</I> on <I>March, 17 2001</I>
|
|
using <A HREF="tppmsgs/msgs0.htm#1" tppabs="http://www.mathematik.uni-kl.de/~obachman/Texi2html"><I>texi2html</I></A>
|
|
|
|
</BODY>
|
|
</HTML>
|