gcc960 Compiler Driver
gcc960 is a driver program that manages invocation of the preprocessor,
compiler proper, assembler and linker. The invocation syntax is:
gcc960
{ - | / } [-option ] ... file
...
Each invocation option must be preceded by a -
character. (On DOS, you can also use a /
character.) Click on option for information
on compiler driver options. All options that take an argument
allow optional white space between the option and the argument.
When conflicting options are given, the last one specified is
used. The compiler driver passes the following linker options
and their arguments to the linker: e,
gcdm, L,
l, r,
s, u,
X, x,
y and z.
The compilation system determines each input file's type by its
filename extension:
- .c
indicates a C source file.
- .i
indicates a preprocessed C source file.
- .s
indicates an assembly language source file.
The compilation system passes any other filename to the linker,
which determines whether the file is an object file, library or
configuration file by its contents.
Other invocation command elements are taken to be either linker
options or object modules, typically produced by an earlier gcc960
invocation, or perhaps libraries of compatible routines. These
modules, together with the result of any compilations specified,
are linked (in the order given) to produce an executable program.
When generating b.out modules, the default output filename is
b.out.
When generating COFF modules, the default output filename is a.out.
When generating ELF/DWARF modules, the default filename is e.out.
Each option requires an option delimiter (-
or /).
When conflicting options are given, the last one specified is
used. For information about an option, click on the option name
(underlined).
A
{ CA | CF
| HA | HD | HT | JA | JD |
JF | KA | KB | RP | SA | SB
}
(Architecture)
Compile code for a particular model of the i960 processor. If
the environment variable G960ARCH
is set and non-empty, its value is the default architecture. Otherwise
the default is KB.
ansi
(ANSI)
Flag non-standard (that is, non-ANSI) constructs. Using ansi
disables inline assembly language statements and can override
the w (No
Warnings) option. This option causes the preprocessor macro __STRICT_ANSI
to be defined.
C
(Keep Comments)
Keep comments in preprocessor output. Works only with E.
c
(Create Object)
Terminate the compilation process after the assembler generates
an object file. If you do not specify the o
(Output) option, the compiler writes the object file to filename.o,
where filename
is the source filename.
clist
arg...
(Listing)
Create a listing file with the suffix .L
for each C source file. arg
is a string containing one or more of the following letters:
- c Add
conditionally noncompiled source text to the primary source text
listing.
- i Add
included source text to the primary source text listing.
- m Add
macro-expanded preprocessor lines to the primary source text listing.
- o Add
assembly language code generated by the compiler to the listing
file.
- s List
the primary source text.
crt
(Startup)
Do not use the standard startup file.
Dsymbol[=value]
(Define)
Define a macro with a given value. If =value
is omitted, symbol
is defined to be 1.
darg
(Definitions)
Control macro processing.
- dD
Tells the preprocessor to pass all macro definitions into the
output, in their proper sequence in the rest of the output.
- dM
Tells the preprocessor to output only a list of the macro definitions
that are in effect at the end of preprocessing.
- dN
Like dD
except that the macro arguments and contents are omitted. Only
#define macro
is included in the output.
E (Preprocess)
After the link phase of the compilation process is complete, produce
an executable file.
Fbout | Fcoff
| Felf (OMF)
Generate b.out, COFF or ELF objects. Fbout
is the default.
fdb
(Program Database)
All modules subject to program-wide optimization must be initially
compiled with the fdb
option. This option causes the insertion of program database information
in the object modules, and it implies a minimum module-local optimization
level of O1
(although higher module-local optimization levels are allowed).
This option does not otherwise change the code or data generated
for the object modules in any way; it simply makes available to
the global decision making and optimization process information
collected during initial compilation of the modules.
Before using the fdb
option, you should read Chapter 4, Program-Wide Analysis and Optimization,
and Chapter 6, gcdm Decision Maker Option, in the i960 Processor
Compiler User's Guide.
If you intend to use execution profiles when optimizing your application,
you should read Chapter 5, Profile Data Merging and Data Format,
in the i960 Processor Compiler User's Guide.
fprof
(Instrument)
This option inserts execution profile instrumentation code into
the module(s) during compilation, so that when the linked program
is executed, a profile can be collected.
It also implies fdb,
which causes the insertion of program database information in
the object modules, and it implies a minimum module-local optimization
level of O1.
When you compile with the fprof
option, a special profiling library required for profile collection
(libqf)
is linked automatically. If your target environment does not support
file I/O, you must explicitly link an alternate profiling library
(libq).
The profiling libraries provided are identified in Chapter 2 of
the i960 Processor Library Supplement.
Note that when the fprof
compiler option is used in this manner (as distinct from the corresponding
+fprof
gcdm960 Decision Maker option) the generated object module contains
code that is unsuitable for linking into programs which are not
supposed to collect profile information. To solve this problem,
and avoid having inappropriate instrumentation in widely used
libraries, for example, use +fprof
with the gcdm,subst
option.
Before using the fprof
option, you should read Chapter 4, Program-Wide Analysis and Optimization,
and Chapter 5, Profile Data Merging and Data Format, in the i960
Processor Compiler User's Guide.
f[no-]arg
(Enable/Disable Optimization)
Enable/disable optimization. arg
is one of:
- asm
- treat asm,
inline,
and typeof
as keywords.
- bbr
- enable basic block rearrangement.
- coalesce
- coalesce adjacent memory references.
- coerce
- enable byte/short optimization.
- cond-mismatch
- allow type mismatch in operands of the ?:
operator.
- condxform
- enable 80960 conditional instructions.
- constprop
- enable constant propagation and folding.
- copyprop
- enable copy propagation.
- cse-follow-jumps
- enable a limited form of global CSE.
- cse-skip-blocks
- enable a limited form of global CSE.
- expensive-optimizations
- enable some minor optimizations.
- float-store
- store floating-point variables in registers, and perform CSE
on floating-point expressions.
- force-addr
- place address constants in registers before use.
- inline-functions
- inline all simple functions into their callers.
- int-alias-ptr
- indicates to the compiler that pointer objects may be referenced
as 32-bit integers and vice versa.
- int-alias-real
- indicates to the compiler that float,
double
and long double
objects (or parts thereof) may be referenced as 32-bit integers
and vice versa.
- int-alias-short
- indicates to the compiler that four-byte integer objects may
be referenced as two-byte objects and vice versa.
- keep-inline-functions
- emit out-of-line code for inlined functions.
- marry_mem
- rejoin multi-word moves split by fsplit_mem.
- rerun-cse-after-loop
- reiterate CSE after loop optimization.
- sblock
- enable superblock formation.
- schedule-insns2
- perform post-register-allocation scheduling.
- shadow-globals
- shadow memory locations in registers.
- shadow-mem
- like shadow-globals,
but more thorough.
- signed-char
- make type char
be signed (or unsigned).
- space-opt
- optimize for memory space.
- split_mem
- split multi-word moves for copy propagation.
- strength-reduce
- enable loop strength reduction.
- thread-jumps
- enable an advanced branch optimization.
- unroll-all-loops
- unroll all loops.
- unroll-loops
- unroll loops where deemed beneficial.
- unsigned-char
- make type char
be unsigned (or signed).
- verbose-asm
- emit explanatory assembly language comments.
- volatile
- treat indirect memory references as volatile.
- volatile-global
- treat all memory references as volatile.
- writable-strings
- place string literals in .data
section.
G
(Big-endian)
Causes compiler to generate big-endian module(s).
g[level]
(Debug)
Put symbolic debug information into the object module. level
is:
- 0 disables
debug information (default).
- 2 normal
debug information.
- 3 verbose
debug information (ELF/DWARF only).
gcdm,arg[,arg]...
(Decision Maker)
Invoke gcdm960 decision maker to perform optimization or related
tasks. Click gcdm option for information
on this option.
h
(Help)
Print a summary of gcc960 driver options and exit without processing
any files.
I
dir
(Searchinclude)
Add the directory dir
to the search list for #include
files.
I
| I. (I-dash, I-dot)
Any directories specified with I
options before the I-
option are searched only for #include
"file";
they are not searched for #include
<file>.
If additional directories are specified with I
options after the I-,
these directories are searched for all #include
directives. (Ordinarily all I
directories are searched this way.)
The I-
option inhibits the use of the current directory as the first
search directory for #include
"file".
The current directory is searched for #include
"file"
only if it is requested explicitly with I.
(I "dot").
It is not searched automatically with I-.
Specifying both I-
and I.
allows you to control precisely which directories are searched
before the current one and which are searched after.
ic960
(iC-960)
Accept iC-960 R3.0 source dialect. For code compatibility, also
use mic3.0-compat.
imacros
filename
(Macros File)
Specify macros file for preinclusion. Process file
as input, discarding the resulting output, before processing the
regular input file. Because the output generated from file
is discarded, 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,
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.
All imacros
options are processed before all include
options.
include
filename
(Preinclude)
Include the specified source file as if a #include
of that file existed at line zero of each primary source 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.
All imacros
options are processed before all include
options.
jnum
(Errata)
Use the j
(Errata) option to cause the compilation system to generate code
with workarounds for specified processor errata. A num
argument of 1 generates code to work around the Cx processors'
DMA errata.
L
directory
(Library Directory)
Specify directory for library search.
llibrary
(Library)
Specify library for linking.
M
| MD
| MM
| MMD
(Make)
Generate make tool information.
- M
- Tells the preprocessor to output a rule suitable for a make
tool describing the dependencies of each source file. For each
source file, the preprocessor outputs one make rule whose target
is the object file name for that source file and whose dependencies
are all the files #included
in it. This rule can be a single line or can be continued with
\newline
if it is long. Using this option stops compilation after preprocessing.
- MD
- Like M
but the dependency information is written 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 compilation the way M
does.
- MM
- Like M,
but the output mentions only the user-header files included with
#include
"file".
System header files included with #include
<file>
are omitted.
- MMD
- Like MD
except mention only user header files, not system header files.
mstring
(Machine)
Enables various machine-specific options.
- mabi
- Generate 80960 ABI-conformant code.
- masm-compat
- Generate special Intel pseudo-operations for long compare-and-branch
operations. gas960 or gas960c do not require these pseudo-ops
in order to generate correct code, but the ASM960 R3.5 or earlier
assembler will generate out-of-range errors for these instructions
if this option is not used. This should not be used if gas960,
gas960c, or gas960e are used, because the split compare-and-branch
instructions are slower and larger than the combined ones.
- mcave
- Generate all functions as CAVE secondary.
- mcmpbr
| mno-cmpbr
- Generate code that uses compare-and-branch instructions whenever
possible, or that has no compare-and-branch instructions.
- mcode-align
| mno-nocode-align
- Generate (do not generate) alignment directives prior to labels
that are not entered from above. mcode-align
is the default if the Cx or Hx architecture is specified.
- mdouble4
- Generate code so that the size and alignment of double
is the same as float.
- mlong-double4
- Generate code so that the size and alignment of long
double is the same as float.
- mi960_align=n
- Aligns struct
data on the byte boundary which is a multiple of n.
- mic-compat
| mic2.0-compat
- Use ic960 R2.0's rules for size and alignment of types. This
option also causes the compiler to use ic960's rules for promotion
of char,
unsigned char,
short,
and unsigned short
types at function call and return.
- mic3.0-compat
- Use ic960 R3.0's rules for size and alignment of types and
other conventions. These are largely the same as gcc960's, but
ic960 R3.0 selects the size of enums
based on their value, and gcc960 emulates this. Additionally,
ic960 R3.0 assumes that type char is signed by default,
whereas gcc960 assumes it is unsigned. The mic3.0-compat
option emulates ic960's behavior.
- mleaf-procedures
| mno-leaf-procedures
- Generate output which contains (does not contain) leaf procedures:
these are procedures that may be entered with the bal instruction
rather than call. The linker automatically promotes
call instructions into bal instructions when appropriate.
This option makes debugging more difficult. mleaf-procedures
is the default at O2
or higher.
- mlong-calls
- Generate all call instructions as calljx
instead of callj.
This is used where the distance between the call site and
the called function exceeds callj's
range. Using this option degrades code execution speed and increases
code size.
- mpic
- Generate position-independent references to any objects in
the text section. Such objects are functions, const
file-scope variables, switch tables, and strings. Position independent
code references are made relative to the current instruction pointer
(IP).
- mpid
- Generate position-independent references to objects in the
bss, common, and data sections. Such objects are non-const
file-scope variables, and strings if the fwritable-strings
option is used. Position independent code references are made
relative to register g12.
Register g12
is not used for any other purpose.
- mpid-safe
- Reserve register g12 as the position independent data bias
register, but do not generate code for position independent data.
- msoft-float
- Generates output containing library calls for architectures
without on-chip floating point support (all except KB, SB). This
is set automatically, based on the architecture option.
- mstrict-align
| mno-strict-align
- This option determines whether or not the compiler will risk
generating memory references which are not provably aligned. If
mstrict-align
is disabled, the compiler will occasionally generate potentially
unaligned references when it seems advantageous to do so. When
mstrict-align
is enabled, sequences of smaller memory references are used instead
of larger ones which might not be correctly aligned. The default
is on for C-series and J-series processors.
- mstrict-ref-def
- Generate code so that an uninitialized file-scope variable
definition causes space to be allocated in the .bss
section instead of as a .comm
symbol. This enforces a single unique definition of a variable.
- mtail-call | mno-tail-call
- Generate output which converts (does not convert) call
instructions immediately followed by ret
instructions to branches to the call target. While generating
faster code, this option makes debugging more difficult. mtail-call
is the default at O2
or higher.
- mwait=n
- Specifies the expected number of wait-states for the memory
being used in the target. This can make a difference in which
optimizations are cost effective and in the instruction scheduling
optimization. n
must be in the range 0..32.
nostdinc
(No Standard Includes)
Excludes standard header (include) files. Only the directories
specified with I
options (and the current directory, if appropriate) are searched.
Using nostdinc
and I-,
you can eliminate all directories from the search path except
those you specify.
nostdlib
(No Standard Libraries)
Excludes standard libraries.
O[level]
(Optimize)
Specify the optimization level to be used. Supported levels
are 0, 1, 2, 3 and 4.
The O[level]
option specifies the level of optimization as described below.
- O0
- Turns optimization off, and additionally disables default
optimizations that may interfere with debugging. This is the default.
- O[1]
- This option turns on basic optimizations, including: advanced
register allocation, common subexpression elimination, loop invariant
code motion, expression simplification and instruction combination,
jump optimization, dead-code elimination, and i960 processor-specific
peephole optimization. O1
is equivalent to O.
This is the default setting when you use the fdb
(Program Database) or fprof
(Instrument) option.
- O2
- This level includes the O[1]
optimizations described above, and the following additional optimizations:
-
- fcopyprop,
fcondxform,
fcse-follow-jumps,
fcse-skip-blocks,
fexpensive-optimizations,
frerun-cse-after-loop,
fschedule-insns,
fschedule-insns2,
fshadow-globals,
fstrength-reduce.
-
- The O2
level enables strength-reduction, combination of more than one
variable value into a single register, copy propagation, and instruction
reordering (scheduling) to make use of the particular i960 processor's
pipeline and superscalar capabilities.
- O3
- This level includes the O2
optimizations described above, and the following additional optimizations:
-
- fcoerce,
fconstprop,
finline-functions,
fshadow-mem,
funroll-loops.
- O4
- This level includes the O3
optimizations described above, and the following additional optimizations:
-
- fcoalesce,
fmarry_mem,
fsplit_mem.
o filename
(Output)
Names the output file, which can be either preprocessing output,
assembly code, an object module, or linker output.
outz
filename
(Listname)
Directs the listing to the named file. This option implies the
clist
(List) option and s
argument.
P
(Preprocessor Output)
Inhibits generation of #-lines with line-number information in
the output of the preprocessor.
pedantic[-errors]
(Pedantic)
Controls ANSI message generation.
pedantic
causes the compilation system to issue all the warnings specified
by ANSI C (such as when text other than a comment follows #else
or #endif)
and to reject programs that use forbidden extensions.
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 traditional
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 _
_ (double underscore).
pedantic-errors
is the same as pedantic,
except that it causes the compilation system to issue errors instead
of warnings.
Q (No
Quiet)
Suppresses passing quiet
to compiler phases.
S (Save
Assembly)
After the link phase of the compilation process, the compiler
produces an executable file. Assembly language output is not saved.
If you do not specify a filename with the o
(Output) option, the compiler writes the assembly language output
to filename.s,
where filename
is the source filename without its extension.
save-temps
(Save Intermediates)
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 produce files foo.i
and foo.s,
as well as foo.o.
Tfile[.gld]
(Target)
Specifies a configuration file, which causes the compilation system
to configure itself for a particular target board.
traditional
(Traditional)
Allow some aspects of traditional C, as summarized below.
- All extern
declarations take effect globally even if they are written inside
of a function definition. This includes implicit declarations
of functions.
- The keywords typeof,
inline,
signed,
const,
and volatile
are not recognized.
- Integer types unsigned
short
and unsigned
char
promote to unsigned
int.
- All automatic variables not declared register
are preserved by longjmp.
Ordinarily, GNU C follows ANSI C: automatic variables not declared
volatile
may be clobbered.
- In the preprocessor, comments convert to nothing at all, rather
than to a space. This allows traditional token concatenation.
- 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 preprocessor always considers a string constant
to end at a newline.
- The predefined macro _
_STDC_
_ is
not defined when you use traditional,
but _ _GNUC_
_ is
(since the GNU extensions which _
_GNUC_
_ indicates
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 C compilers.
See the discussion of traditional
in your compiler manual for a list of the macros defined when
the traditional
or ansi
option is used.
trigraphs
(Trigraphs)
Support ANSI trigraphs. (The ansi
option also enables trigraphs.)
U symbol
(Undefine)
Undefine a preprocessor symbol. By default, no symbols are undefined.
V
(Version)
Display a version message and other information. By default, the
compiler does not display version information.
v960
(Version, terminate)
Display version and terminate.
v (Verbose)
Display the driver's invocation command, and the preprocessor,
compiler, assembler, and linker phase invocations. By default,
the driver does not display individual phase invocations.
W [[no-]arg]
(Warnings)
Enables/disables warnings. With no arg,
this option prints extra warning messages for certain events,
including:
- longjmp()
warnings
- Warn if a nonvolatile automatic variable might be changed
by a call to longjmp().
These warnings are possible only in an optimizing compilation.
-
- 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 actually be called at the place that would cause a problem.
- return
and return(value)
- Warn if a function can return either with or without a value.
(Falling off the end of the function body is considered returning
with a value.)
- null effect
- Warn if an expression-statement contains no side effects.
- no-op comparison
- Warn if an unsigned value is compared against zero with <
or <=.
- between-ness comparison
- Warn if a comparison like x<=y<=z
is used; this is equivalent to {(x<=y
? 1 : 0) <=z}, which is a different interpretation
from that of ordinary mathematical notation.
- obsolete storage class specification
- Warn if storage-class specifiers like static
are not the first things in a declaration. According to the ANSI
C standard, this usage is obsolescent.
- partially bracketed initializer
- Warn if an aggregate has a partly bracketed initializer.
W[no-]arg
can be:
- aggregate-return
- Warn if any functions return structures or unions.
- all
- Enable several useful warnings, as indicated in the list below.
Has no Wno-all
form.
- cast-align
- Warn if a pointer cast may not have required alignment.
- cast-qual
- Warn if a pointer cast removes a type qualifier.
- char-subscripts
- Warn if an array subscript has type char.
Enabled by Wall.
- comment
- Warn whenever /*
occurs within a comment. Enabled by Wall.
- conversion
- Warn if a prototyped parameter causes a different conversion
than if not prototyped.
- error
- Treat all warnings as errors.
- format
- Check types of printf
family arguments at compile time. Enabled by Wall.
- id-clash-n
- Warn if two identifiers match in the first n
characters. Has no [no-]
form.
- implicit
- Warn if a function is used before being declared. Enabled
by Wall.
- missing-braces
- Warn if an aggregate initializer is not fully braced.
- missing-prototypes
- Warn if a function is defined before it is prototyped. Enabled
by Wall.
- nested-externs
- Warn if an extern declaration is seen within a function.
- parentheses
- Warn if parentheses are suggested around an expression. Enabled
by Wall.
- pointer-arith
- Warn if the size of a function type or type void is used.
- redundant-decls
- Warn if an object is declared twice in the same scope.
- return-type
- Warn if any function implicitly returns int,
and if a non-void function does not return a value. Enabled by
Wall.
- shadow
- Warn if a local variable shadows another local variable.
- strict-prototypes
- Warn if a function is declared without a prototype.
- switch
- Warn if a switch statement on an enumeration type does not
have a case for each enumerator. Enabled by Wall.
- traditional
- Warn about constructs that behave differently under traditional
C and ANSI C.
- trigraphs
- Warn if any trigraphs are encountered. Enabled by Wall.
- uninitialized
- Warn if use of an uninitialized local variable is detected.
Enabled by Wall.
- unused
- Warn about objects that are never used. Enabled by Wall.
- write-strings
- Warn if string constants are used in a writable context.
w
(No Warnings)
Inhibits all warning messages.
Zdir
(Specify PDB)
Specifies the name of a program database directory.
e
Defines program entry point.
gcdm
Invoke gcdm960 decision maker.
Ldir
Add the library dir
to the linker's search list.
l lib
Add the library lib
to the linker's list of input libraries.
r
Retain relocation information in output object
file.
s
Strip line-number and symbol-table entries from
linker COFF output file.
u
Introduce unresolved symbol.
X
Remove all symbols from output symbol table.
x
Remove local symbols from output symbol table.
y
Trace a symbol.
z
Suppress COFF time stamp in linker output file.
Go
to the top of this page.
Return
to the gcc960 Interface Index.