Dec 312017
GCC 2.1 for OS/2 2.0 documentation in Unix text format. Part 2 of 2.
File GCCDOC2.ZIP from The Programmer’s Corner in
Category OS/2 Files
GCC 2.1 for OS/2 2.0 documentation in Unix text format. Part 2 of 2.
File Name File Size Zip Size Zip Type
INVOKE.TXT 118210 29282 deflated
LIBGPP.TXT 176475 47956 deflated
MD.TXT 150471 37104 deflated
RTL.TXT 130770 32155 deflated
TM.TXT 275533 61853 deflated

Download File GCCDOC2.ZIP Here

Contents of the INVOKE.TXT file

1. GNU CC Command Options

When you invoke GNU CC, it normally does preprocessing,
compilation, assembly and linking. The ``overall options''
allow you to stop this process at an intermediate stage.
For example, the `-c' option says not to run the linker.
Then the output consists of object files output by the

Other options are passed on to one stage of processing.
Some options control the preprocessor and others the com-
piler 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.

The GNU C compiler uses a command syntax much like the
Unix C compiler. The gcc program accepts options and file
names as operands. Multiple single-letter options may not
be grouped: `-dr' is very different from `-d -r'

You can mix options and other arguments. For the most
part, the order you use doesn't matter; gcc reorders the
command-line options so that the choices specified by option
flags are applied to all input files. Order does matter
when you use several options of the same kind; for example,
if you specify `-L' more than once, the directories are
searched in the order specified.

Many options have long names starting with `-f' or with
`-W'---for example, `-fforce-mem', `-fstrength-reduce', `-
Wformat' and so on. Most of these have both positive and
negative forms; the negative form of `-ffoo' would be `-
fno-foo'. This manual documents only one of these two
forms, whichever one is not the default.

Here is a summary of all the options, grouped by type.
Explanations are in the following sections.

Overall Options
See section Overall Options,,Options Controlling
the Kind of Output.

-c -S -E -o file -pipe -v -x language

Language Options
See section Dialect Options,,Options Control-
ling Dialect.

-ansi -fbuiltin -fcond-mismatch -fno-asm

-fsigned-bitfields -fsigned-char
-funsigned-bitfields -funsigned-char -fwritable-strings
-traditional -traditional-cpp -trigraphs

Warning Options
See section Warning Options,,Options to Re-
quest or Suppress Warnings.

-fsyntax-only -pedantic -pedantic-errors
-w -W -Wall -Waggregate-return
-Wcast-align -Wcast-qual -Wcomment -Wconversion -Werror
-Wformat -Wid-clash-len -Wimplicit -Wmissing-prototypes
-Wno-parentheses -Wpointer-arith -Wreturn-type -Wshadow
-Wstrict-prototypes -Wswitch -Wtraditional -Wtrigraphs
-Wuninitialized -Wunused -Wwrite-strings -Wchar-subscripts

Debugging Options
See section Debugging Options,,Options for De-
bugging Your Program or GCC.

-a -dletters -fpretend-float
-g -ggdb -gdwarf -gstabs -gstabs+ -gcoff
-p -pg -save-temps

Optimization Options
See section Optimize Options,,Options that
Control Optimization.

-fcaller-saves -fcse-follow-jumps -fdelayed-branch
-fexpensive-optimizations -ffloat-store -fforce-addr -fforce-mem
-finline -finline-functions -fkeep-inline-functions
-fno-defer-pop -fno-function-cse -fomit-frame-pointer
-frerun-cse-after-loop -fschedule-insns -fschedule-insns2
-fstrength-reduce -fthread-jumps
-funroll-all-loops -funroll-loops
-O -O2

Preprocessor Options
See section Preprocessor Options,,Options Con-
trolling the Preprocessor.

-C -dD -dM -dN
-Dmacro[=defn] -E -H
-include file -imacros file
-M -MD -MM -MMD -nostdinc -P -trigraphs -Umacro

Linker Options
See section Link Options,,Options for Linking.

-llibrary -nostdlib -static

Directory Options
See section Directory Options,,Options for
Directory Search.

-Bprefix -Idir -I- -Ldir

Target Options
See section Target Options,,Target Machine and
Compiler Version.

-b machine -V version

Machine Dependent Options
See section Submodel Options,,Hardware Models
and Configurations.

M680x0 Options
-m68000 -m68020 -m68881 -mbitfield -mc68000 -mc68020 -mfpa
-mnobitfield -mrtd -mshort -msoft-float

VAX Options
-mg -mgnu -munix

SPARC Options
-mfpu -mno-epilogue

Convex Options
-margcount -mc1 -mc2 -mnoargcount

AMD29K Options

-m29000 -m29050 -mbw -mdw -mkernel-registers -mlarge
-mnbw -mnodw -msmall -mstack-check -muser-registers

M88K Options
-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-underscores
-mocs-debug-info -mocs-frame-position -moptimize-arg-area
-mshort-data-num -msvr3 -msvr4 -mtrap-large-shift
-muse-div-instruction -mversion-03.00 -mwarn-passed-structs

RS/6000 Options
-mfp-in-toc -mno-fop-in-toc

RT Options
-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

MIPS Options
-mcpu=cpu type -mips2 -mips3 -mint64 -mlong64 -mlonglong128
-mmips-as -mgas -mrnames -mno-rnames -mgpopt -mno-gpopt -mstats
-mno-stats -mmemcpy -mno-memcpy -mno-mips-tfile -mmips-tfile
-msoft-float -mhard-float -mabicalls -mno-abicalls -mhalf-pic
-mno-half-pic -G num

Code Generation Options
See section Code Gen Options,,Options for Code
Generation Conventions.

-fcall-saved-reg -fcall-used-reg -ffixed-reg
-fno-common -fpcc-struct-return -fpic -fPIC -fshared-data
-fshort-enums -fshort-double -fvolatile

1.1. Options Controlling the Kind of Output

Compilation can involve up to four stages: preprocess-
ing, 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.

For any given input file, the file name suffix deter-
mines what kind of compilation is done:

C source code which must be preprocessed.

C source code which should not be preprocessed.

Objective-C source code

C header file (not to be compiled or linked).


C++ source code which must be preprocessed.

Assembler code.

Assembler code which must be preprocessed.

An object file to be fed straight into linking.
Any file name with no recognized suffix is treated
this way.

You can specify the input language explicitly with the
`-x' option:

-x language
Specify explicitly the language for the following
input files (rather than choosing a default based
on the file name suffix). This option applies to
all following input files until the next `-x' op-
tion. Possible values of language are `c',
`objective-c', `c-header', `c++', `cpp-output',
`assembler', and `assembler-with-cpp'.

-x none
Turn off any specification of a language, so that
subsequent files are handled according to their
file name suffixes (as they are if `-x' has not
been used at all).

If you only want some of the stages of compilation, you
can use `-x' (or filename suffixes) to tell gcc where to
start, and one of the options `-c', `-S', or `-E' to say

where gcc is to stop. Note that some combinations (for
example, `-x cpp-output -E' instruct gcc to do nothing at

-c 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.

By default, the object file name for a source file
is made by replacing the suffix `.c', `.i', `.s',
etc., with `.o'.

Unrecognized input files, not requiring compila-
tion or assembly, are ignored.

-S Stop after the stage of compilation proper; do not
assemble. The output is in the form of an assem-
bler code file for each non-assembler input file

By default, the assembler file name for a source
file is made by replacing the suffix `.c', `.i',
etc., with `.s'.

Input files that don't require compilation are ig-

-E 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.

Input files which don't require preprocessing are

-o file
Place output in file file. This applies regard-
less to whatever sort of output is being produced,
whether it be an executable file, an object file,
an assembler file or preprocessed C code.

Since only one output file can be specified, it
does not make sense to use `-o' when compiling
more than one input file, unless you are producing
an executable file as output.

If `-o' is not specified, the default is to put an
executable file in `a.out', the object file for
`source.suffix' in `source.o', its assembler file
in `source.s', and all preprocessed C source on
standard output.

-v Print (on standard error output) the commands exe-
cuted to run the stages of compilation. Also
print the version number of the compiler driver
program and of the preprocessor and the compiler

Use pipes rather than temporary files for communi-
cation between the various stages of compilation.
This fails to work on some systems where the as-
sembler is unable to read from a pipe; but the GNU
assembler has no trouble.

1.2. Options Controlling Dialect

The following options control the dialect of C that the
compiler accepts:

Support all ANSI standard C programs.

This turns off certain features of GNU C that are
incompatible with ANSI C, such as the asm, inline
and typeof keywords, and predefined macros such as
unix and vax that identify the type of system you
are using. It also enables the undesirable and
rarely used ANSI trigraph feature, and disallows
`$' as part of identifiers.

The alternate keywords __asm__, __extension__,
__inline__ and __typeof__ continue to work despite
`-ansi'. You would not want to use them in an
ANSI C program, of course, but it useful to put
them in header files that might be included in
compilations done with `-ansi'. Alternate prede-
fined macros such as __unix__ and __vax__ are also
available, with or without `-ansi'.

The `-ansi' option does not cause non-ANSI pro-
grams to be rejected gratuitously. For that, `-
pedantic' is required in addition to `-ansi'. See
section Warning Options.

The macro __STRICT_ANSI__ is predefined when the
`-ansi' option is used. Some header files may no-
tice this macro and refrain from declaring certain
functions or defining certain macros that the ANSI
standard doesn't call for; this is to avoid in-
terfering with any programs that might use these
names for other things.

Do not recognize asm, inline or typeof as a key-
word. These words may then be used as identif-
iers. You can use __asm__, __inline__ and
__typeof__ instead. `-ansi' implies `-fno-asm'.

Don't recognize non-ANSI built-in functions. `-
ansi' also has this effect. Currently, the only
function affected is alloca.

Support ANSI C trigraphs. You don't want to know
about this brain-damage. The `-ansi' option im-
plies `-trigraphs'.

Attempt to support some aspects of traditional C
compilers. Specifically:

o+ All extern declarations take effect globally
even if they are written inside of a function
definition. This includes implicit declara-
tions of functions.

o+ The keywords typeof, inline, signed, const
and volatile are not recognized. (You can
still use the alternative keywords such as
__typeof__, __inline__, and so on.)

o+ Comparisons between pointers and integers are
always allowed.

o+ Integer types unsigned short and unsigned
char promote to unsigned int.

o+ Out-of-range floating point literals are not
an error.

o+ String ``constants'' are not necessarily con-
stant; they are stored in writable space, and
identical looking constants are allocated
separately. (This is the same as the effect
of `-fwritable-strings'.)

o+ All automatic variables not declared register
are preserved by longjmp. Ordinarily, GNU C
follows ANSI C: automatic variables not de-
clared volatile may be clobbered.

o+ In the preprocessor, comments convert to
nothing at all, rather than to a space. This
allows traditional token concatenation.

o+ In the preprocessor, 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 prepro-
cessor always considers a string constant to
end at a newline.

o+ The predefined macro __STDC__ is not defined
when you use `-traditional', but __GNUC__ is
(since the GNU extensions which __GNUC__ in-
dicates are not affected by `-traditional').
If you need to write header files that work
differently depending on whether `-
traditional' 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 com-

Attempt to support some aspects of traditional C
preprocessors. This includes the last three items
in the table immediately above, but none of the
other effects of `-traditional'.

Allow conditional expressions with mismatched
types in the second and third arguments. The
value of such an expression is void.

Let the type char be unsigned, like unsigned char.

Each kind of machine has a default for what char
should be. It is either like unsigned char by de-
fault or like signed char by default.

Ideally, a portable program should always use
signed char or unsigned char when it depends on
the signedness of an object. But many programs
have been written to use plain char and expect it
to be signed, or expect it to be unsigned, depend-
ing on the machines they were written for. This
option, and its inverse, let you make such a pro-
gram work with the opposite default.

The type char is always a distinct type from each
of signed char or unsigned char, even though its
behavior is always just like one of those two.

Let the type char be signed, like signed char.

Note that this is equivalent to `-fno-unsigned-
char', which is the negative form of `-funsigned-
char'. Likewise, `-fno-signed-char' is equivalent
to `-funsigned-char'.




These options control whether a bitfield is signed
or unsigned, when the declaration does not use ei-
ther signed or unsigned. By default, such a bit-
field is signed, because this is consistent: the
basic integer types such as int are signed types.

However, when `-traditional' is used, bitfields
are all unsigned no matter what.

Store string constants in the writable data seg-
ment and don't uniquize them. This is for compa-
tibility with old programs which assume they can
write into string constants. `-traditional' also
has this effect.

Writing into string constants is a very bad idea;
``constants'' should be constant.

1.3. Options to Request or Suppress Warnings

Warnings are diagnostic messages that report construc-
tions which are not inherently erroneous but which are risky
or suggest there may have been an error.

You can request many specific warnings with options
beginning `-W', for example `-Wimplicit' to request warnings
on implicit declarations. Each of these specific warning
options also has a negative form beginning `-Wno-' to turn
off warnings; for example, `-Wno-implicit'. This manual
lists only one of the two forms, whichever is not the

These options control the amount and kinds of warnings
produced by GNU CC:

Check the code for syntax errors, but don't emit
any output.

-w Inhibit all warning messages.

Issue all the warnings demanded by strict ANSI
standard C; reject all programs that use forbidden

Valid ANSI standard C programs should compile
properly with or without this option (though a
rare few will require `-ansi'). However, without
this option, certain GNU extensions and tradition-
al C features are supported as well. With this
option, they are rejected.

`-pedantic' does not cause warning messages for
use of the alternate keywords whose names begin
and end with `__'. Pedantic warnings are also
disabled in the expression that follows __exten-
sion__. However, only system header files should
use these escape routes; application programs
should avoid them. See section Alternate Key-

This option is not intended to be useful; it ex-
ists only to satisfy pedants who would otherwise
claim that GNU CC fails to support the ANSI stan-

Some users try to use `-pedantic' to check pro-
grams 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 requires a diagnostic.

A feature to report any failure to conform to ANSI
C might be useful in some instances, but would re-
quire considerable additional work and would be
quite different from `-pedantic'. We recommend,
rather, that users take advantage of the exten-
sions of GNU C and disregard the limitations of
other compilers. Aside from certain supercomput-
ers and obsolete small machines, there is less and
less reason ever to use any other C compiler other
than for bootstrapping GNU CC.

Like `-pedantic', except that errors are produced
rather than warnings.

-W Print extra warning messages for these events:

o+ A nonvolatile automatic variable might be
changed by a call to longjmp. These warnings
as well are possible only in optimizing com-

The compiler sees only the calls to setjmp.
It cannot know where longjmp 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 longjmp cannot in fact be
called at the place which would cause a prob-

o+ A function can return either with or without
a value. (Falling off the end of the func-
tion body is considered returning without a
value.) For example, this function would
evoke such a warning:

foo (a)
if (a > 0)
return a;

o+ An expression-statement contains no side

o+ An unsigned value is compared against
zero with `>' or `<='.

Warn whenever a function or parameter is im-
plicitly declared.

Warn whenever a function is defined with a
return-type that defaults to int. Also warn
about any return statement with no return-
value in a function whose return-type is not

Warn whenever a local variable is unused aside
from its declaration, whenever a function is
declared static but never defined, and whenev-

er a statement computes a result that is ex-
plicitly not used.

Warn whenever a switch statement has an index
of enumeral type and lacks a case for one or
more of the named codes of that enumeration.
(The presence of a default label prevents this
warning.) case labels outside the enumeration
range also provoke warnings when this option
is used.

Warn whenever a comment-start sequence `/*'
appears in a comment.

Warn if any trigraphs are encountered (assum-
ing they are enabled).

Check calls to printf and scanf, etc., to make
sure that the arguments supplied have types
appropriate to the format string specified.

Warn if an array subscript has type char.
This is a common cause of error, as program-
mers often forget that this type is signed on
some machines.

An automatic variable is used without first
being initialized.

These warnings are possible only in optimizing
compilation, because they require data flow
information that is computed only when optim-
izing. If you don't specify `-O', you simply
won't get these warnings.

These warnings occur only for variables that
are candidates for register allocation.
Therefore, they do not occur for a variable
that is declared volatile, or whose address is
taken, or whose size is other than 1, 2, 4 or
8 bytes. Also, they do not occur for struc-
tures, unions or arrays, even when they are in

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 compu-

tations may be deleted by data flow analysis
before the warnings are printed.

These warnings are made optional because GNU
CC is not smart enough to see all the reasons
why the code might be correct despite appear-
ing to have an error. Here is one example of
how this can happen:

int x;
switch (y)
case 1: x = 1;
case 2: x = 4;
case 3: x = 5;
foo (x);

If the value of y is always 1, 2 or 3, then x is
always initialized, but GNU CC doesn't know this.
Here is another common case:

int save_y;
if (change_y) save_y = y, y = new_y;
if (change_y) y = save_y;

This has no bug because save_y is used only if it
is set.

Some spurious warnings can be avoided if you
declare as volatile all the functions you use
that never return. See section Function At-

All of the above `-W' options combined. These
are all the options which pertain to usage
that we recommend avoiding and that we believe
is easy to avoid, even in conjunction with

The remaining `-W...' options are not implied by `-
Wall' because they warn about constructions that we consider
reasonable to use, on occasion, in clean programs.

Warn about certain constructs that behave dif-
ferently in traditional and ANSI C.

o+ Macro arguments occurring within string con-
stants in the macro body. These would sub-
stitute the argument in traditional C, but
are part of the constant in ANSI C.

o+ A function declared external in one block and
then used after the end of the block.

o+ A switch statement has an operand of type

Warn whenever a local variable shadows another lo-
cal variable.

Warn whenever two distinct identifiers match in
the first len characters. This may help you
prepare a program that will compile with certain
obsolete, brain-damaged compilers.

Warn about anything that depends on the ``size
of'' a function type or of void. GNU C assigns
these types a size of 1, for convenience in calcu-
lations with void * pointers and pointers to func-

Warn whenever a pointer is cast so as to remove a
type qualifier from the target type. For example,
warn if a const char * is cast to an ordinary char

Warn whenever a pointer is cast such that the re-
quired alignment of the target is increased. For
example, warn if a char * is cast to an int * on
machines where integers can only be accessed at
two- or four-byte boundaries.

Give string constants the type const char[length]
so that copying the address of one into a non-

const char * 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
const in declarations and prototypes. Otherwise,
it will just be a nuisance; this is why we did not
make `-Wall' request these warnings.

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 in-
cludes 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.

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 warn-

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.)

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.

Warn if anything is declared more than once in the
same scope, even in cases where multiple declara-
tion is valid and changes nothing.

Warn if an extern declaration is encountered
within an function.

Disable warnings that parentheses are suggested
around an expression.

Make all warnings into errors.

1.4. Options for Debugging Your Program or GNU CC

GNU CC has various special options that are used for
debugging either your program or GCC:

-g Produce debugging information in the operating
system's native format (stabs or COFF or DWARF).
GDB can work with this debugging information.

On most systems that use stabs format, `-g' en-
ables use of extra debugging information that only
GDB can use; this extra information makes debug-
ging work better in GDB but will probably make DBX
crash or refuse to read the program. If you want
to control for certain whether to generate the ex-
tra information, use `-gstabs+' or `-gstabs' (see

Unlike most other C compilers, GNU CC allows you
to use `-g' with `-O'. The shortcuts taken by op-
timized 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 exe-
cuted 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.

Nevertheless it proves possible to debug optimized
output. This makes it reasonable to use the op-
timizer for programs that might have bugs.

The following options are useful when GNU CC is
generated with the capability for more than one
debugging format.

Produce debugging information in the native format
(if that is supported), including GDB extensions
if at all possible.

Produce debugging information in stabs format (if
that is supported), without GDB extensions. This
is the format used by DBX on most BSD systems.

Produce debugging information in stabs format (if
that is supported), using GDB extensions. The use
of these extensions is likely to make DBX crash or
refuse to read the program.

Produce debugging information in COFF format (if
that is supported). This is the format used by
SDB on COFF systems.

Produce debugging information in DWARF format (if
that is supported). This is the format used by
SDB on systems that use DWARF.





Request debugging information and also use level
to specify how much information. The default lev-
el is 2.

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 infor-
mation about local variables and no line numbers.

Level 3 includes extra information, such as all
the macro definitions present in the program.
Some debuggers support macro expansion when you
use `-g3'.

-p Generate extra code to write profile information
suitable for the analysis program prof.

-pg Generate extra code to write profile information
suitable for the analysis program gprof.

-a Generate extra code to write profile information
for basic blocks, which will record the number of
times each basic block is executed. This data
could be analyzed by a program like tcov. Note,
however, that the format of the data is not what
tcov expects. Eventually GNU gprof should be ex-
tended to process this data.

Says to make debugging dumps during compilation at
times specified by letters. This is used for de-
bugging the compiler. The file names for most of
the dumps are made by appending a word to the

source file name (e.g. `foo.c.rtl' or
`foo.c.jump'). Here are the possible letters for
use in letters, and their meanings:

`M' Dump all macro definitions, at the end of
preprocessing, and write no output.

`N' Dump all macro names, at the end of prepro-

`D' Dump all macro definitions, at the end of
preprocessing, in addition to normal output.

`y' Dump debugging information during parsing, to
standard error.

`r' Dump after RTL generation, to `file.rtl'.

`x' Just generate RTL for a function instead of
compiling it. Usually used with `r'.

`j' Dump after first jump optimization, to

`s' Dump after CSE (including the jump optimiza-
tion that sometimes follows CSE), to

`L' Dump after loop optimization, to `file.loop'.

`t' Dump after the second CSE pass (including the
jump optimization that sometimes follows
CSE), to `file.cse2'.

`f' Dump after flow analysis, to `file.flow'.

`c' Dump after instruction combination, to

`S' Dump after the first instruction scheduling
pass, to `file.sched'.

`l' Dump after local register allocation, to

`g' Dump after global register allocation, to

`R' Dump after the second instruction scheduling
pass, to `file.sched2'.

`J' Dump after last jump optimization, to

`d' Dump after delayed branch scheduling, to

`k' Dump after conversion from registers to
stack, to `file.stack'.

`a' Produce all the dumps listed above.

`m' Print statistics on memory usage, at the end
of the run, to standard error.

`p' Annotate the assembler output with a comment
indicating which pattern and alternative was

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
GNU CC would make when running on the target

Store the usual ``temporary'' intermediate files
permanently; place them in the current directory
and name them based on the source file. Thus,
compiling `foo.c' with `-c -save-temps' would pro-
duce files `foo.cpp' and `foo.s', as well as

1.5. Options That Control Optimization

These options control various sorts of optimizations:

-O Optimize. Optimizing compilation takes somewhat
more time, and a lot more memory for a large func-

Without `-O', 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 oth-
er statement in the function and get exactly the
results you would expect from the source code.

Without `-O', only variables declared register are
allocated in registers. The resulting compiled

code is a little worse than produced by PCC
without `-O'.

With `-O', the compiler tries to reduce code size
and execution time.

When `-O' is specified, `-fthread-jumps' and `-
fdelayed-branch' are turned on. On some machines
other flags may also be turned on.

-O2 Highly optimize. All supported optimizations that
do not involve a space-speed tradeoff are per-
formed. As compared to `-O', this option will in-
crease both compilation time and the performance
of the generated code.

All `-fflag' options that control optimization are
turned on when `-O2' is specified, except for `-
funroll-loops' and `-funroll-all-loops'.

Options of the form `-fflag' specify machine-
independent flags. Most flags have both positive and nega-
tive forms; the negative form of `-ffoo' would be `-fno-
foo'. 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 `no-' or adding it.

Do not store floating point variables in regis-
ters. This prevents undesirable excess precision
on machines such as the 68000 where the floating
registers (of the 68881) keep more precision than
a double is supposed to have.

For most programs, the excess precision does only
good, but a few programs rely on the precise de-
finition of IEEE floating point. Use `-ffloat-
store' for such programs.

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 com-
piler normally lets arguments accumulate on the
stack for several function calls and pops them all
at once.

Force memory operands to be copied into registers
before doing arithmetic on them. This may produce
better code by making all memory references poten-
tial common subexpressions. When they are not

common subexpressions, instruction combination
should eliminate the separate register-load. I am
interested in hearing about the difference this

Force memory address constants to be copied into
registers before doing arithmetic on them. This
may produce better code just as `-fforce-mem' may.
I am interested in hearing about the difference
this makes.

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 avail-
able in many functions. It also makes debugging
impossible on some machines.

INTERNALS 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 ex-
ist. The machine-description macro
FRAME_POINTER_REQUIRED controls whether a target
machine supports this flag. See section Regis-
INTERNALS 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 ex-
ist. The machine-description macro
FRAME_POINTER_REQUIRED controls whether a target
machine supports this flag. See section
Registers,,Register Usage,, Using and
Porting GCC.

Pay attention to the inline keyword. Normally the
negation of this option `-fno-inline' is used to
keep the compiler from expanding any functions in-
line. However, the opposite effect may be desir-
able when compiling without optimization, since
inline expansion is turned off in that case.

Integrate all simple functions into their callers.
The compiler heuristically decides which functions
are simple enough to be worth integrating in this

If all calls to a given function are integrated,
and the function is declared static, then the
function is normally not output as assembler code
in its own right.

Enable values to be allocated in registers that
will be clobbered by function calls, by emitting
extra instructions to save and restore the regis-
ters around such calls. Such allocation is done
only when it seems to result in better code than
would otherwise be produced.

This option is enabled by default on certain
machines, usually those which have no call-
preserved registers to use instead.

Even if all calls to a given function are in-
tegrated, and the function is declared static,
nevertheless output a separate run-time callable
version of the function.

Do not put function addresses in registers; make
each instruction that calls a constant function
contain the function's address explicitly.

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.

The following options control specific optimizations.
The `-O2' option turns on all of these optimizations except
`-funroll-loops' and `-funroll-all-loops'. The `-O' option
usually turns on the `-fthread-jumps' and `-fdelayed-branch'
options, but specific machines may change the default optim-

You can use the following flags in the rare cases when
``fine-tuning'' of optimizations to be performed is desired.

Perform the optimizations of loop strength reduc-
tion and elimination of iteration variables.

Perform optimizations where we check to see if a
jump branches to a location where another com-
parison subsumed by the first is found. If so,
the first branch is redirected to either the des-

tination of the second branch or a point immedi-
ately following it, depending on whether the con-
dition is known to be true or false.

In common subexpression elimination, scan through
jump instructions in certain cases. This is not
as powerful as completely global CSE, but not as
slow either.

Re-run common subexpression elimination after loop
optimizations has been performed.

Perform a number of minor optimizations that are
relatively expensive.

If supported for the target machine, attempt to
reorder instructions to exploit instruction slots
available after delayed branch instructions.

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 in-
structions to be issued until the result of the
load or floating point instruction is required.

Similar to `-fschedule-insns', but requests an ad-
ditional pass of instruction scheduling after re-
gister allocation has been done. This is espe-
cially useful on machines with a relatively small
number of registers and where memory load instruc-
tions take more than one cycle.

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.
`-funroll-loop' implies `-fstrength-reduce' and

Perform the optimization of loop unrolling. This
is done for all loops and usually makes programs
run more slowly. `-funroll-all-loops' implies `-
fstrength-reduce' and `-frerun-cse-after-loop'.

Disable any machine-specific peephole optimiza-

1.6. Options Controlling the Preprocessor

These options control the C preprocessor, which is run
on each C source file before actual compilation.

If you use the `-E' option, nothing is done except
preprocessing. Some of these options make sense only
together with `-E' because they cause the preprocessor out-
put to be unsuitable for actual compilation.

-include file
Process file as input before processing the regu-
lar input file. In effect, the contents of file
are compiled first. Any `-D' and `-U' options on
the command line are always processed before `-
include file', regardless of the order in which
they are written. All the `-include' and `-
imacros' options are processed in the order in
which they are written.

-imacros file
Process file as input, discarding the resulting
output, before processing the regular input file.
Because the output generated from file is discard-
ed, the only effect of `-imacros file' is to make
the macros defined in file available for use in
the main input.

Any `-D' and `-U' options on the command line are
always processed before `-imacros file', regard-
less of the order in which they are written. All
the `-include' and `-imacros' options are pro-
cessed in the order in which they are written.

Do not search the standard system directories for
header files. Only the directories you have
specified with `-I' options (and the current
directory, if appropriate) are searched. See sec-
tion Directory Options, for information on `-I'.

By using both `-nostdinc' and `-I-', you can limit
the include-file search path to only those direc-
tories you specify explicitly.

Do not predefine any nonstandard macros. (Includ-
ing architecture flags).

-E 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.

-C Tell the preprocessor not to discard comments.
Used with the `-E' option.

-P Tell the preprocessor not to generate `#line' com-
mands. Used with the `-E' option.

-M Tell the preprocessor to output a rule suitable
for make describing the dependencies of each ob-
ject file. For each source file, the preprocessor
outputs one make-rule whose target is the object
file name for that source file and whose dependen-
cies are all the files `#include'd in it. This
rule may be a single line or may be continued with
`\'-newline if it is long. The list of rules is
printed on standard output instead of the prepro-
cessed C program.

`-M' implies `-E'.

Another way to specify output of a make rule is by
setting the environment variable
DEPENDENCIES_OUTPUT (see section Environment

-MM Like `-M' but the output mentions only the user
header files included with `#include "file"'.
System header files included with `#include
' are omitted.

-MD Like `-M' but the dependency information is writ-
ten to files with names made by replacing `.c'
with `.d' at the end of the input file names.
This is in addition to compiling the file as
specified---`-MD' does not inhibit ordinary compi-
lation the way `-M' does.

The Mach utility `md' can be used to merge the
`.d' files into a single dependency file suitable
for using with the `make' command.

Like `-MD' except mention only user header files,
not system header files.

-H Print the name of each header file used, in addi-
tion to other normal activities.

Define macro macro with the string `1' as its de-


Define macro macro as defn. All instances of `-D'
on the command line are processed before any `-U'

Undefine macro macro. `-U' options are evaluated
after all `-D' options, but before any `-include'
and `-imacros' options.

-dM Tell the preprocessor to output only a list of the
macro definitions that are in effect at the end of
preprocessing. Used with the `-E' option.

-dD Tell the preprocessing to pass all macro defini-
tions into the output, in their proper sequence in
the rest of the output.

-dN Like `-dD' except that the macro arguments and
contents are omitted. Only `#define name' is in-
cluded in the output.

Support ANSI C trigraphs. You don't want to know
about this brain-damage. The `-ansi' option also
has this effect.

1.7. Options for Linking

These options come into play when the compiler links
object files into an executable output file. They are mean-
ingless if the compiler is not doing a link step.

A file name that does not end in a special recog-
nized suffix is considered to name an object file
or library. (Object files are distinguished from
libraries by the linker according to the file con-
tents.) If linking is done, these object files
are used as input to the linker.



-E 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 Overall Options.

Search the library named library when linking.

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, `foo.o -lz bar.o' seaches li-
brary `z' after file `foo.o' but before `bar.o'.
If `bar.o' refers to functions in `z', those func-
tions may not be loaded.

The linker searches a standard list of directories
for the library, which is actually a file named
`liblibrary.a'. The linker then uses this file as
if it had been specified precisely by name.

The directories searched include several standard
system directories plus any that you specify with

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 sym-
bols that have so far been referenced but not de-
fined. But if the file that is found is an ordi-
nary object file, it is linked in the usual
fashion. The only difference between using an `-
l' option and specifying a file name is that `-l'
surrounds library with `lib' and `.a' and searches
several directories.

Don't use the standard system libraries and start-
up files when linking. Only the files you specify
will be passed to the linker.

On systems that support dynamic linking, this
prevents linking with the shared libraries. On
other systems, this option has no effect.

On systems that support dynamic linking, you can
use this option to request it explicitly.

Produce a shared object which can then be linked
with other objects to form an executable. Only a
few systems support this option.

Bind references to global symbols when building a

shared object. Warn about any unresolved refer-
ences (unless overridden by the link editor option
`-Xlinker -z -Xlinker defs'). Only a few systems
support this option.

-Xlinker option
Pass option as an option to the linker. You can
use this to supply system-specific linker options
which GNU CC does not know how to recognize.

If you want to pass an option that takes an argu-
ment, you must use `-Xlinker' twice, once for the
option and once for the argument. For example, to
pass `-assert definitions', you must write `-
Xlinker -assert -Xlinker definitions'. It does
not work to write `-Xlinker "-assert defini-
tions"', because this passes the entire string as
a single argument, which is not what the linker

1.8. Options for Directory Search

These options specify directories to search for header
files, for libraries and for parts of the compiler:

Append directory dir to the list of directories
searched for include files.

-I- Any directories you specify with `-I' options be-
fore the `-I-' option are searched only for the
case of `#include "file"'; they are not searched
for `#include '.

If additional directories are specified with `-I'
options after the `-I-', these directories are
searched for all `#include' directives. (Ordi-
narily all `-I' directories are used this way.)

In addition, the `-I-' option inhibits the use of
the current directory (where the current input
file came from) as the first search directory for
`#include "file"'. There is no way to override
this effect of `-I-'. With `-I.' 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.

`-I-' does not inhibit the use of the standard
system directories for header files. Thus, `-I-'
and `-nostdinc' are independent.

Add directory dir to the list of directories to be
searched for `-l'.

This option specifies where to find the execut-
ables, libraries and data files of the compiler

The compiler driver program runs one or more of
the subprograms `cpp', `cc1', `as' and `ld'. It
tries prefix as a prefix for each program it tries
to run, both with and without `machine/version/'
(see section Target Options).

For each subprogram to be run, the compiler driver
first tries the `-B' prefix, if any. If that name
is not found, or if `-B' was not specified, the
driver tries two standard prefixes, which are
`/usr/lib/gcc/' and `/usr/local/lib/gcc/'. 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 `PATH' en-
vironment variable.

`-B' prefixes that effectively specify directory
names also apply to libraries in the linker, be-
cause the compiler translates these options into
`-L' options for the linker.

The run-time support file `libgcc.a' can also be
searched for using the `-B' 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

Another way to specify a prefix much like the `-B'
prefix is to use the environment variable
GCC_EXEC_PREFIX. See section Environment Vari-

1.9. Specifying Target Machine and Compiler Version

By default, GNU CC 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 GNU CC, for different target machines, can be installed
side by side. Then you specify which one to use with the
`-b' option.

In addition, older and newer versions of GNU CC can be
installed side by side. One of them (probably the newest)
will be the default, but you may sometimes wish to use

-b machine
The argument machine specifies the target machine
for compilation. This is useful when you have in-
stalled GNU CC as a cross-compiler.

The value to use for machine is the same as was
specified as the machine type when configuring GNU
CC as a cross-compiler. For example, if a cross-
compiler was configured with `configure i386v',
meaning to compile for an 80386 running System V,
then you would specify `-b i386v' to run that
cross compiler.

When you do not specify `-b', it normally means to
compile for the same type of machine that you are

-V version
The argument version specifies which version of
GNU CC to run. This is useful when multiple ver-
sions are installed. For example, version might
be `2.0', meaning to run GNU CC version 2.0.

The default version, when you do not specify `-V',
is controlled by the way GNU CC is installed.
Normally, it will be a version that is recommended
for general use.

The `-b' and `-V' options actually work by controlling
part of the file name used for the executable files and
libraries used for compilation. A given version of GNU CC,
for a given target machine, is normally kept in the direc-
tory `/usr/local/lib/gcc/machine/version'.

It follows that sites can customize the effect of `-b'
or `-V' either by changing the names of these directories or
adding alternate names (or symbolic links). Thus, if
`/usr/local/lib/gcc/80386' is a link to
`/usr/local/lib/gcc/i386v', then `-b 80386' will be an alias
for `-b i386v'.

In one respect, the `-b' or `-V' do not completely
change to a different compiler: the top-level driver program
gcc that you originally invoked continues to run and invoke
the other executables (preprocessor, compiler per se, assem-
bler 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.

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.

The driver program executable does control one signifi-
cant 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.

For example, if the driver for version 2.0 is installed
as ogcc and that for version 2.1 is installed as gcc, then
the command gcc will use version 2.1 by default, while ogcc
will use 2.0 by default. However, you can choose either
version with either command with the `-V' option.

1.10. Specifying Hardware Models and Configurations

Earlier we discussed the standard option `-b' which
chooses among different installed compilers for completely
different target machines, such as Vax vs. 68000 vs. 80386.

In addition, each of these target machine types can
have its own special options, starting with `-m', to choose
among various hardware models or configurations---for exam-
ple, 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.

INTERNALS These options are defined by the macro
TARGET_SWITCHES in the machine description. The default for
the options is also defined by that macro, which enables you
to change the defaults.

1.10.1. M680x0 Options

These are the `-m' options defined for the 68000
series. The default values for these options depends on
which style of 68000 was selected when the compiler was con-
figured; the defaults for the most common choices are given


Generate output for a 68020 (rather than a 68000).

This is the default when the compiler is config-
ured for 68020-based systems.


Generate output for a 68000 (rather than a 68020).
This is the default when the compiler is config-
ured for a 68000-based systems.

Generate output containing 68881 instructions for
floating point. This is the default for most
68020 systems unless `-nfp' was specified when the
compiler was configured.

Generate output containing Sun FPA instructions
for floating point.

Generate output containing library calls for
floating point. Warning: the requisite libraries
are not part of GNU CC. 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.

Consider type int to be 16 bits wide, like short

Do not use the bit-field instructions. `-m68000'
implies `-mnobitfield'.

Do use the bit-field instructions. `-m68020' im-
plies `-mbitfield'. This is the default if you
use the unmodified sources configured for a 68020.

Use a different function-calling convention, in
which functions that take a fixed number of argu-
ments return with the rtd instruction, which pops
their arguments while returning. This saves one
instruction in the caller since there is no need
to pop the arguments there.

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


Also, you must provide function prototypes for all
functions that take variable numbers of arguments
(including printf); otherwise incorrect code will
be generated for calls to those functions.

In addition, seriously incorrect code will result
if you call a function with too many arguments.
(Normally, extra arguments are harmlessly ig-

The rtd instruction is supported by the 68010 and
68020 processors, but not by the 68000.

1.10.2. VAX Options

These `-m' options are defined for the Vax:

Do not output certain jump instructions (aobleq
and so on) that the Unix assembler for the Vax
cannot handle across long ranges.

Do output those jump instructions, on the assump-
tion that you will assemble with the GNU assem-

-mg Output code for g-format floating point numbers
instead of d-format.

1.10.3. SPARC Options

These `-m' switches are supported on the Sparc:

Generate separate return instructions for return
statements. This has both advantages and disad-
vantages; I don't recall what they are.

1.10.4. Convex Options

These `-m' options are defined for the Convex:

Generate output for a C1. This is the default
when the compiler is configured for a C1.

Generate output for a C2. This is the default
when the compiler is configured for a C2.

Generate code which puts an argument count in the
word preceding each argument list. Some nonport-
able Convex and Vax programs need this word. (De-
buggers don't, except for functions with
variable-length argument lists; this info is in
the symbol table.)

Omit the argument count word. This is the default
if you use the unmodified sources.

1.10.5. AMD29K Options

These `-m' options are defined for the AMD Am29000:

Generate code that assumes the DW bit is set,
i.e., that byte and halfword operations are
directly supported by the hardware. This is the

Generate code that assumes the DW bit is not set.

Generate code that assumes the system supports
byte and halfword write operations. This is the

Generate code that assumes the systems does not
support byte and halfword write operations. `-
mnbw' implies `-mnodw'.

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 call instruction to be used
instead of a const, consth, calli sequence.

Do not assume that the call instruction can be
used; this is the default.

Generate code for the Am29050.

Generate code for the Am29000. This is the de-

Generate references to registers gr64-gr95 instead
of gr96-gr127. This option can be used when com-
piling kernel code that wants a set of global re-
gisters disjoint from that used by user-mode code.

Note that when this option is used, register names
in `-f' flags must use the normal, user-mode,

Use the normal set of global registers, gr96-
gr127. This is the default.

Insert a call to __msp_check after each stack ad-
justment. This is often used for kernel code.

1.10.6. M88K Options

These `-m' options are defined for Motorola 88K archi-

Generate code that works well on both the m88100
and the m88110.

Generate code tha Generate code that works best
for the m88100, but that also runs on the m88110.

Generate code that works best for the m88110, and
may not run on the m88100.

Include an ident directive in the assembler output
recording the source file name, compiler name and
version, timestamp, and compilation flags used.

In assembler output, emit symbol names without ad-
ding an underscore character at the beginning of
each name. The default is to use an underscore as
prefix on each name.


Include (or omit) additional debugging information
(about registers used in each stack frame) as
specified in the 88open Object Compatibility Stan-
dard, ``OCS''. This extra information allows de-
bugging of code that has had the frame pointer el-
iminated. The default for DG/UX, SVr4, and Delta
88 SVr3.2 is to include this information; other
88k configurations omit this information by de-

When emitting COFF debugging information for au-
tomatic variables and parameters stored on the
stack, use the offset from the canonical frame ad-
dress, which is the stack pointer (register 31) on
entry to the function. The DG/UX, SVr4, Delta88
SVr3.2, and BCS configurations use `-mocs-frame-
position'; other 88k configurations have the de-
fault `-mno-ocs-frame-position'.

When emitting COFF debugging information for au-
tomatic variables and parameters stored on the
stack, use the offset from the frame pointer re-
gister (register 30). When this option is in ef-
fect, the frame pointer is not eliminated when de-
bugging information is selected by the -g switch.


Control how to store function arguments in stack
frames. `-moptimize-arg-area' saves space, but
was ruled illegal by 88open. `-mno-optimize-arg-
area' conforms to the 88open standards. By de-
fault GNU CC does not optimize the argument area.

Generate smaller data references by making them
relative to r0, which allows loading a value using
a single instruction (rather than the usual two).
You control which data references are affected by
specifying num with this option. For example, if
you specify `-mshort-data-512', then the data
references affected are those involving displace-
ments of less than 512 bytes. `-mshort-data-num'
is not effective for num greater than 64K.


Turn on (`-msvr4') or off (`-msvr3') compiler ex-

tensions related to System V release 4 (SVr4).
This controls the following:

1. Which variant of the assembler syntax to emit
(which you can select independently using `-

2. `-msvr4' makes the C preprocessor recognize
`#pragma weak' that is used on System V
release 4.

3. `-msvr4' makes GNU CC issue additional de-
claration directives used in SVr4.

`-msvr3' is the default for all m88K configura-
tions except the SVr4 configuration.

In the DG/UX configuration, there are two flavors
of SVr4. This option modifies `-msvr4' to select
whether the hybrid-COFF or real-ELF flavor is
used. All other configurations ignore this op-


Early models of the 88K architecture had problems
with division by zero; in particular, many of them
didn't trap. Use these options to avoid including
(or to include explicitly) additional code to
detect division by zero and signal an exception.
All GNU CC configurations for the 88K use `-
mcheck-zero-division' by default.

Do not emit code to check both the divisor and
dividend when doing signed integer division to see
if either is negative, and adjust the signs so the
divide is done using non-negative numbers. In-
stead, rely on the operating system to calculate
the correct value when the div instruction traps.
This results in different behavior when the most
negative number is divided by -1, but is useful
when most or all signed integer divisions are done
with positive numbers.


Include code to detect bit-shifts of more than 31
bits; respectively, trap such shifts or emit code

to handle them properly. By default GNU CC makes
no special provision for large bit shifts.

Warn when a function passes a struct as an argu-
ment or result. Structure-passing conventions
have changed during the evolution of the C
language, and are often the source of portability
problems. By default, GNU CC issues no such warn-

1.10.7. IBM RS/6000 Options

Only one pair of `-m' options is defined for the IBM


Control whether or not floating-point constants go
in the Table of Contents (TOC), a table of all
global variable and function addresses. By de-
fault GNU CC puts floating-point constants there;
if the TOC overflows, `-mno-fp-in-toc' will reduce
the size of the TOC, which may avoid the overflow.

1.10.8. IBM RT Options

These `-m' options are defined for the IBM RT PC:

Use an in-line code sequence for integer multi-
plies. This is the default.

Call lmul$$ for integer multiples.

Generate full-size floating point data blocks, in-
cluding the minimum amount of scratch space recom-
mended by IBM. This is the default.

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.

Use a calling sequence incompatible with the IBM
calling convention in which floating point argu-

ments are passed in floating point registers.
Note that varargs.h and stdargs.h will not work
with floating point operands if this option is

Use the normal calling convention for floating
point arguments. This is the default.

Return structures of more than one word in memory,
rather than in a register. This provides compati-
bility with the MetaWare HighC (hc) compiler. Use
`-fpcc-struct-return' for compatibility with the
Portable C Compiler (pcc).

Return some structures of more than one word in
registers, when convenient. This is the default.
For compatibility with the IBM-supplied compilers,
use either `-fpcc-struct-return' or `-mhc-struct-

1.10.9. MIPS Options

These `-m' options are defined for the MIPS family of

-mcpu=cpu type
Assume the defaults for the machine type cpu type
when scheduling insturctions. The default cpu
type is `default', which picks the longest cycles
times for any of the machines, in order that the
code run at reasonable rates on all MIPS cpu's.
Other choices for cpu type are `r2000', `r3000',
`r4000', and `r6000'. While picking a specific
cpu type will schedule things appropriately for
that particular chip, the compiler will not gen-
erate any code that does not meet level 1 of the
MIPS ISA (instruction set architecture) without
the `-mips2' or `-mips3' switches being used.

Issue instructions from level 2 of the MIPS ISA
(branch likely, square root instructions). The
`-mcpu=r4000' or `-mcpu=r6000' switch must be used
in conjuction with `-mips2'.

Issue instructions from level 3 of the MIPS ISA
(64 bit instructions). You must use the `-
mcpu=r4000' switch along with `-mips3'.



These options don't work at present.

Generate code for the MIPS assembler, and invoke
`mips-tfile' 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 `-gstabs' or
`-gstabs+' switches are used, the `mips-tfile'
program will encapsulate the stabs within MIPS EC-

Generate code for the GNU assembler. This is the
default on the OSF/1 reference platform, using the
OSF/rose object format.


The `-mrnames' switch says to output code using
the MIPS software names for the registers, instead
of the hardware names (ie, a0 instead of $4). The
GNU assembler does not support the `-mrnames'
switch, and the MIPS assembler will be instructed
to run the MIPS C preprocessor over the source
file. The `-mno-rnames' switch is default.


The `-mgpopt' switch says to write all of the data
declarations before the instructions in the text
section, to all 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.


For each non-inline function processed, the `-
mstats' switch causes the compiler to emit one
line to the standard error file to print statis-
tics about the program (number of registers saved,
stack size, etc.).


The `-mmemcpy' switch makes all block moves call
the appropriate string function (`memcpy' or
`bcopy') instead of possibly generating inline


The `-mno-mips-tfile' switch causes the compiler
not postprocess the object file with the `mips-
tfile' program, after the MIPS assembler has gen-
erated it to add debug support. If `mips-tfile'
is not run, then no local variables will be avail-
able to the debugger. In addition, `stage2' and
`stage3' objects will have the temporary file
names passed to the assembler embedded in the ob-
ject file, which means the objects will not com-
pare the same.

Generate output containing library calls for
floating point. Warning: the requisite libraries
are not part of GNU CC. 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.

Generate output containing floating point instruc-
tions. This is the default if you use the unmodi-
fied sources.

Assume that the FR bit in the status word is on,
and that there are 32 64-bit floating point regis-
ters, instead of 32 32-bit floating point regis-
ters. You must also specify the `-mcpu=r4000' and
`-mips3' switches.

Assume that there are 32 32-bit floating point re-
gisters. This is the default.


Emit the `.abicalls', `.cpload', and `.cprestore'
pseudo operations that some System V.4 ports use
for position independent code.


Put pointers to extern references into the data
section and load them up, rather than put the
references in the text section. These options do
not work at present.

-G num
Put global and static items less than or equal to
num bytes into the small data or bss sections in-
stead of the normal data or bss section. This al-
lows the assembler to emit one word memory refer-
ence instructions based on the global pointer (gp
or $28), instead of the normal two words used. By
default, num is 8 when the MIPS assembler is used,
and 0 when the GNU assembler is used. The `-G
num' switch is also passed to the assembler and
linker. All modules should be compiled with the
same `-G num' value.

INTERNALS These options are defined by the macro
TARGET_SWITCHES in the machine description. The default for
the options is also defined by that macro, which enables you
to change the defaults.

1.11. Options for Code Generation Conventions

These machine-independent options control the interface
conventions used in code generation.

Most of them have both positive and negative forms; the
negative form of `-ffoo' would be `-fno-foo'. 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 `no-' or adding it.

Use the same convention for returning struct and
union values that is used by the usual C compiler
on your system. This convention is less efficient
for small structures, and on many machines it
fails to be reentrant; but it has the advantage of
allowing intercallability between GNU CC-compiled
code and PCC-compiled code.

Allocate to an enum type only as many bytes as it
needs for the declared range of possible values.
Specifically, the enum type will be equivalent to
the smallest integer type which has enough room.

Use the same size for double as for float.

Requests that the data and non-const 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.

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 extern) 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.

Ignore the `#ident' directive.

Don't 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 ``collect'' program
and a non-GNU linker.

Don't output a .size assembler directive, or any-
thing else that would cause trouble if the func-
tion is split in the middle, and the two halves
are placed at locations far apart in memory. This
option is used when compiling `crtstuff.c'; you
should not need to use it for anything else.

Consider all memory references through pointers to
be volatile.

If supported for the target machines, generate
position-independent code, suitable for use in a
shared library. All addresses will be accessed
through a global offset table (GOT). If the GOT
size for the linked executable exceeds a machine-
specific maximum size, you will get an error mes-
sage from the linker indicating that `-fpic' does

not work; recompile with `-fPIC' 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

Position-independent code requires special sup-
port, and therefore works only on certain
machines. Code generated for the IBM RS/6000 is
always position-independent.

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 differ-
ence on the m68k, m88k and the Sparc.

Position-independent code requires special sup-
port, and therefore works only on certain

Treat the register named reg 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).

reg must be the name of a register. The register
names accepted are machine-specific and are de-
fined in the REGISTER_NAMES macro in the machine
description macro file.

This flag does not have a negative form, because
it specifies a three-way choice.

Treat the register named reg as an allocatable re-
gister 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

Use of this flag for a register that has a fixed
pervasive role in the machine's execution model,
such as the stack pointer or frame pointer, will
produce disastrous results.

This flag does not have a negative form, because
it specifies a three-way choice.

Treat the register named reg as an allocatable re-

gister 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 reg if they use it.

Use of this flag for a register that has a fixed
pervasive role in the machine's execution model,
such as the stack pointer or frame pointer, will
produce disastrous results.

A different sort of disaster will result from the
use of this flag for a register in which function
values may be returned.

This flag does not have a negative form, because
it specifies a three-way choice.

1.12. Environment Variables Affecting GNU CC

This section describes several environment variables
that affect how GNU CC operates. They work by specifying
directories or prefixes to use when searching for various
kinds of files.

INTERNALS Note that you can also specify places to
search using options such as `-B', `-I' and `-L' (see sec-
tion Directory Options). These take precedence over places
specified using environment variables, which in turn take
precedence over those specified by the configuration of GNU
INTERNALS Note that you can also specify places to search
using options such as `-B', `-I' and `-L' (see section
Directory Options). These take precedence over places
specified using environment variables, which in turn take
precedence over those specified by the configuration of GNU
CC. See section Driver.

If TMPDIR is set, it specifies the directory to
use for temporary files. GNU CC uses temporary
files to hold the output of one stage of compila-
tion which is to be used as input to the next
stage: for example, the output of the preproces-
sor, which is the input to the compiler proper.

If GCC_EXEC_PREFIX 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

If GNU CC cannot find the subprogram using the
specified prefix, it tries looking in the usual
places for the subprogram.

Other prefixes specified with `-B' take precedence
over this prefix.

This prefix is also used for finding files such as
`crt0.o' that are used for linking.

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 `/usr/local/lib/gcc'
(more precisely, with the value of
GCC_INCLUDE_DIR), GNU CC tries replacing that be-
ginning with the specified prefix to produce an
alternate directory name. Thus, with `-Bfoo/',
GNU CC will search `foo/bar' where it would nor-
mally search `/usr/local/lib/bar'. These alter-
nate directories are searched first; the standard
directories come next.

The value of COMPILER_PATH is a colon-separated
list of directories, much like PATH. GNU CC tries
the directories thus specified when searching for
subprograms, if it can't find the subprograms us-

The value of LIBRARY_PATH is a colon-separated
list of directories, much like PATH. GNU CC tries
the directories thus specified when searching for
special linker files, if it can't find them using
GCC_EXEC_PREFIX. Linking using GNU CC also uses
these directories when searching for ordinary li-
braries for the `-l' option (but directories
specified with `-L' come first).



variable's value is a colon-separated list of
directories, much like PATH. When GNU CC searches
for header files, it tries the directories listed
in the variable for the language you are using,
after the directories specified with `-I' but be-
fore the standard header file directories.

If this variable is set, its value specifies how
to output dependencies for Make based on the
header files processed by the compiler. This out-
put looks much like the output from the `-M' op-
tion (see section Preprocessor Options), but it
goes to a separate file, and is in addition to the
usual results of compilation.

The value of DEPENDENCIES_OUTPUT can be just a
file name, in which case the Make rules are writ-
ten to that file, guessing the target name from
the source file name. Or the value can have the
form `file target', in which case the rules are
written to file file using target as the target

 December 31, 2017  Add comments

Leave a Reply