foo (a)
{
if (a > 0)
return a;
}
Spurious warnings can occur because GNU CC does not realize that certain functions (including abort and longjmp) will never return.
*
An expression-statement or the left-hand side of a comma expression contains no side effects. To suppress the warning, cast the unused expression to void. For example, an expression such as `x[i,j]' will cause a warning, but `x[(void)i,j]' will not.
*
An unsigned value is compared against zero with `>' or `<='.
-Wimplicit-int
Warn whenever a declaration does not specify a type.
-Wimplicit-function-declaration
Warn whenever a function is used before being declared.
-Wimplicit
Same as -Wimplicit-int and -Wimplicit-function-declaration.
-Wmain
Warn if the main function is declared or defined with a suspicious type. Typically, it is a function with external linkage, returning int, and taking zero or two arguments.
-Wreturn-type
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 void.
-Wunused
Warn whenever a local variable is unused aside from its declaration, whenever a function is declared static but never defined, and whenever a statement computes a result that is explicitly not used.
-Wswitch
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.
-Wcomment
Warn whenever a comment-start sequence `/*' appears in a comment.
-Wtrigraphs
Warn if any trigraphs are encountered (assuming they are enabled).
-Wformat
Check calls to printf and scanf, etc., to make sure that the arguments supplied have types appropriate to the format string specified.
-Wchar-subs cripts
Warn if an array subs cript has type char. This is a common cause of error, as programmers often forget that this type is signed on some machines.
-Wuninitialized
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 optimizing. 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 structures, unions or arrays, even when they are in registers.
Note that there may be no warning about a variable that is used only to compute a value that itself is never used, because such computations may be deleted by data flow analysis before the warnings are printed.
These warnings are made optional because GNU CC is not smart enough to see all the reasons why the code might be correct despite appearing to have an error. Here is one example of how this can happen:
{
int x;
switch (y)
{
case 1: x = 1;
break;
case 2: x = 4;
break;
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.
-Wparentheses
Warn if parentheses are omitted in certain contexts.
-Wtemplate-debugging
When using templates in a C++ program, warn if debugging is not yet fully available (C++ only).
-Wall
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 macros.
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.
-Wtraditional
Warn about certain constructs that behave differently in traditional and ANSI C.
*
Macro arguments occurring within string constants in the macro body. These would substitute the argument in traditional C, but are part of the constant in ANSI C.
*
A function declared external in one block and then used after the end of the block.
*
A switch statement has an operand of type long.
-Wshadow
Warn whenever a local variable shadows another local variable.
-Wid-clash-len
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.
-Wpointer-arith
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 calculations with void * pointers and pointers to functions.
-Wcast-qual
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 *.
-Wcast-align
Warn whenever a pointer is cast such that the required 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.
-Wwrite-strings
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.
-Wconversion
Warn if a prototype causes a type conversion that is different from what would happen to the same argument in the absence of a prototype. This includes conversions of fixed point to floating and vice versa, and conversions changing the width or signedness of a fixed point argument except when the same as the default promotion.
-Waggregate-return
Warn if any functions that return structures or unions are defined or called. (In languages where you can return an array, this also elicits a warning.)
-Wstrict-prototypes
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.)
-Wmissing-prototypes
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.
-Wmissing-declarations
Warn if a global function is defined without a previous declaration. Do so even if the definition itself provides a prototype. Use this option to detect global functions that are not declared in header files.
-Wredundant-decls
Warn if anything is declared more than once in the same scope, even in cases where multiple declaration is valid and changes nothing.
-Wnested-externs
Warn if an extern declaration is encountered within an function.
-Wenum-clash
Warn about conversion between different enumeration types (C++ only).
-Wlong-long
Warn if long long type is used. This is default. To inhibit the warning messages, use flag `-Wno-long-long'. Flags `-W-long-long' and `-Wno-long-long' are taken into account only when flag `-pedantic' is used.
-Woverloaded-virtual
(C++ only.) In a derived class, the definitions of virtual functions must match the type signature of a virtual function declared in the base class. Use this option to request warnings when a derived class declares a function that may be an erroneous attempt to define a virtual function: that is, warn when a function with the same name as a virtual function in the base class, but with a type signature that doesn't match any virtual functions from the base class.
-Winline
Warn if a function can not be inlined, and either it was declared as inline, or else the -finline-functions option was given.
-Werror
Treat warnings as errors; abort compilation after any warning.
DEBUGGING OPTIONS
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, COFF, XCOFF, or DWARF). GDB can work with this debugging information.
On most systems that use stabs format, `-g' enables use of extra debugging information that only GDB can use; this extra information makes debugging work better in GDB but will probably make other debuggers crash or refuse to read the program. If you want to control for certain whether to generate the extra information, use `-gstabs+', `-gstabs', `-gxcoff+', `-gxcoff', `-gdwarf+', or `-gdwarf' (see below).
Unlike most other C compilers, GNU CC allows you to use `-g' with `-O'. The shortcuts taken by optimized code may occasionally produce surprising results: some variables you declared may not exist at all; flow of control may briefly move where you did not expect it; some statements may not be executed because they compute constant results or their values were already at hand; some statements may execute in different places because they were moved out of loops.
Nevertheless it proves possible to debug optimized output. This makes it reasonable to use the optimizer 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.
-ggdb
Produce debuggi
ng information in the native format (if that is supported), including GDB extensions if at all possible.
-gstabs
Produce debugging information in stabs format (if that is supported), without GDB extensions. This is the format used by DBX on most BSD systems.
-gstabs+
Produce debugging information in stabs format (if that is supported), using GNU extensions understood only by the GNU debugger (GDB). The use of these extensions is likely to make other debuggers crash or refuse to read the program.
-gcoff
Produce debugging information in COFF format (if that is supported). This is the format used by SDB on most System V systems prior to System V Release 4.
-gxcoff
Produce debugging information in XCOFF format (if that is supported). This is the format used by the DBX debugger on IBM RS/6000 systems.
-gxcoff+
Produce debugging information in XCOFF format (if that is supported), using GNU extensions understood only by the GNU debugger (GDB). The use of these extensions is likely to make other debuggers crash or refuse to read the program.
-gdwarf
Produce debugging information in DWARF format (if that is supported). This is the format used by SDB on most System V Release 4 systems.
-gdwarf+
Produce debugging information in DWARF format (if that is supported), using GNU extensions understood only by the GNU debugger (GDB). The use of these extensions is likely to make other debuggers crash or refuse to read the program.
-glevel
-ggdblevel
-gstabslevel
-gcofflevel -gxcofflevel
-gdwarflevel
Request debugging information and also use level to specify how much information. The default level 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 des criptions of functions and external variables, but no information 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 extended to process this data.
-ax
Generate extra code to read basic block profiling parameters from file `bb.in' and write profiling results to file `bb.out'. `bb.in' contains a list of functions. Whenever a function on the list is entered, profiling is turned on. When the outmost function is left, profiling is turned off. If a function name is prefixed with `-' the function is excluded from profiling. If a function name is not unique it can be disambiguated by writing `/path/filename.d:functionname'. `bb.out' will list some available filenames. Four function names have a special meaning: `__bb_jumps__' will cause jump frequencies to be written to `bb.out'. `__bb_trace__' will cause the sequence of basic blocks to be piped into `gzip' and written to file `bbtrace.gz'. `__bb_hidecall__' will cause call instructions to be excluded from the trace. `__bb_showret__' will cause return instructions to be included in the trace.
-dletters
Says to make debugging dumps during compilation at times specified by letters. This is used for debugging the compiler. The file names for most of the dumps are made by appending a word to the source file name (e.g. `foo.c.rtl' or `foo.c.jump').
-dM
Dump all macro definitions, at the end of preprocessing, and write no output.
-dN
Dump all macro names, at the end of preprocessing.
-dD
Dump all macro definitions, at the end of preprocessing, in addition to normal output.
-dy
Dump debugging information during parsing, to standard error.
-dr
Dump after RTL generation, to `file.rtl'.
-dx
Just generate RTL for a function instead of compiling it. Usually used with `r'.
-dj
Dump after first jump optimization, to `file.jump'.
-ds
Dump after CSE (including the jump optimization that sometimes follows CSE), to `file.cse'.
-dL
Dump after loop optimization, to `file.loop'.
-dt
Dump after the second CSE pass (including the jump optimization that sometimes follows CSE), to `file.cse2'.
-df
Dump after flow analysis, to `file.flow'.
-dc
Dump after instruction combination, to `file.combine'.
-dS
Dump after the first instruction scheduling pass, to `file.sched'.
-dl
Dump after local register allocation, to `file.lreg'.
-dg
Dump after global register allocation, to `file.greg'.
-dR
Dump after the second instruction scheduling pass, to `file.sched2'.
-dJ
Dump after last jump optimization, to `file.jump2'.
-dd
Dump af
ter delayed branch scheduling, to `file.dbr'.
-dk
Dump after conversion from registers to stack, to `file.stack'.
-da
Produce all the dumps listed above.
-dm
Print statistics on memory usage, at the end of the run, to standard error.
-dp
Annotate the assembler output with a comment indicating which pattern and alternative was used.
-fpretend-float
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 machine.
-save-temps
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.cpp' and `foo.s', as well as `foo.o'.
-print-file-name=library
Print the full absolute name of the library file library that would be used when linking---and do not do anything else. With this option, GNU CC does not compile or link anything; it just prints the file name.
-print-libgcc-file-name
Same as `-print-file-name=libgcc.a'.
-print-prog-name=program
Like `-print-file-name', but searches for a program such as `cpp'.
OPTIMIZATION OPTIONS
These options control various sorts of optimizations:
-O
-O1
Optimize. Optimizing compilation takes somewhat more time, and a lot more memory for a large function.
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 other 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 you specify `-O', the two options `-fthread-jumps' and `-fdefer-pop' are turned on. On machines that have delay slots, the `-fdelayed-branch' option is turned on. For those machines that can support debugging even without a frame pointer, the `-fomit-frame-pointer' option is turned on. On some machines other flags may also be turned on.
-O2
Optimize even more. Nearly all supported optimizations that do not involve a space-speed tradeoff are performed. Loop unrolling and function inlining are not done, for example. As compared to -O, this option increases both compilation time and the performance of the generated code.
-O3
Optimize yet more. This turns on everything -O2 does, along with also turning on -finline-functions.
-O0
Do not optimize.
If you use multiple -O options, with or without level numbers, the last such option is the one that is effective.
Options of the form `-fflag' specify machine-independent flags. Most flags have both positive and negative forms; the negative form of `-ffoo' would be `-fno-foo'. The following list shows only one form---the one which is not the default. You can figure out the other form by either removing `no-' or adding it.
-ffloat-store
Do not store floating point variables in registers. 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 definition of IEEE floating point. Use `-ffloat-store' for such programs.
-fmemoize-lookups
-fsave-memoized
Use heuristics to compile faster (C++ only). These heuristics are not enabled by default, since they are only effective for certain input files. Other input files compile more slowly.
The first time the compiler must build a call to a member function (or reference to a data member), it must (1) determine whether the class implements member functions of that name; (2) resolve which member function to call (which involves figuring out what sorts of type conversions need to be made); and (3) check the visibility of the member function to the caller. All of this adds up to slower compilation. Normally, the second time a call is made to that member function (or reference to that data member), it must go through the same lengthy process again. This means that code like this
cout << "This " << p << " has " << n << " legs.n";
makes six passes through all three steps. By using a software cache, a ``hit'' significantly reduces this cost. Unfortunately, using the cache introduces another layer of mechanisms which must be implemented, and so incurs its own overhead. `-fmemoize-lookups' enables the software cache.
Because access privileges (visibility) to member
s and member functions may differ from one function context to the next, g++ may need to flush the cache. With the `-fmemoize-lookups' flag, the cache is flushed after every function that is compiled. The `-fsave-memoized' flag enables the same software cache, but when the compiler determines that the context of the last function compiled would yield the same access privileges of the next function to compile, it preserves the cache. This is most helpful when defining many member functions for the same class: with the exception of member functions which are friends of other classes, each member function has exactly the same access privileges as every other, and the cache need not be flushed.
-fno-default-inline
Don't make member functions inline by default merely because they are defined inside the class scope (C++ only).
-fno-defer-pop
Always pop the arguments to each function call as soon as that function returns. For machines which must pop arguments after a function call, the compiler normally lets arguments accumulate on the stack for several function calls and pops them all at once.
-fforce-mem
Force memory operands to be copied into registers before doing arithmetic on them. This may produce better code by making all memory references potential 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 makes.
-fforce-addr
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.
-fomit-frame-pointer
Don't keep the frame pointer in a register for functions that don't need one. This avoids the instructions to save, set up and restore frame pointers; it also makes an extra register available in many functions. It also makes debugging impossible on most machines.
On some machines, such as the Vax, this flag has no effect, because the standard calling sequence automatically handles the frame pointer and nothing is saved by pretending it doesn't exist. The machine-des cription macro FRAME_POINTER_REQUIRED controls whether a target machine supports this flag.
-finline-functions
Integrate all simple functions into their callers. The compiler heuristically decides which functions are simple enough to be worth integrating in this way.
If all calls to a given function are integrated, and the function is declared static, then GCC normally does not output the function as assembler code in its own right.
-fcaller-saves
Enable values to be allocated in registers that will be clobbered by function calls, by emitting extra instructions to save and restore the registers around such calls. Such allocation is done only when it seems to result in better code than would otherwise be produced.
This option is enabled by default on certain machines, usually those which have no call-preserved registers to use instead.
-fkeep-inline-functions
Even if all calls to a given function are integrated, and the function is declared static, nevertheless output a separate run-time callable version of the function.
-fno-function-cse
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.
-fno-peephole
Disable any machine-specific peephole optimizations.
-ffast-math
This option allows GCC to violate some ANSI or IEEE rules/specifications in the interest of optimizing code for speed. For example, it allows the compiler to assume arguments to the sqrt function are non-negative numbers.
This option should never be turned on by any `-O' option since it can result in incorrect output for programs which depend on an exact implementation of IEEE or ANSI rules/specifications for math functions.
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 optimizations.
You can use the following flags in the rare cases when ``fine-tuning'' of optimizations to be performed is desired.
-fstrength-reduce
Perform the optimizations of loop strength reduction and elimination of iteration variables.
-fthread-jumps
Perform optimizations where we check to see if a jump branches to a location where another comparison subsumed by the first is found. If so, the first branch is redirected to either the destination of the second branch or a point immediately following it, depending on whether the condition is known to be tru
e or false.
-funroll-loops
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-all-loops
Perform the optimization of loop unrolling. This is done for all loops. This usually makes programs run more slowly.
-fcse-follow-jumps
In common subexpression elimination, scan through jump instructions when the target of the jump is not reached by any other path. For example, when CSE encounters an if statement with an else clause, CSE will follow the jump when the condition tested is false.
-fcse-skip-blocks
This is similar to `-fcse-follow-jumps', but causes CSE to follow jumps which conditionally skip over blocks. When CSE encounters a simple if statement with no else clause, `-fcse-skip-blocks' causes CSE to follow the jump around the body of the if.
-frerun-cse-after-loop
Re-run common subexpression elimination after loop optimizations has been performed.
-felide-constructors
Elide constructors when this seems plausible (C++ only). With this flag, GNU C++ initializes y directly from the call to foo without going through a temporary in the following code:
A foo (); A y = foo ();
Without this option, GNU C++ first initializes y by calling the appropriate constructor for type A; then assigns the result of foo to a temporary; and, finally, replaces the initial value of `y' with the temporary.
The default behavior (`-fno-elide-constructors') is specified by the draft ANSI C++ standard. If your program's constructors have side effects, using `-felide-constructors' can make your program act differently, since some constructor calls may be omitted.
-fexpensive-optimizations
Perform a number of minor optimizations that are relatively expensive.
-fdelayed-branch
If supported for the target machine, attempt to reorder instructions to exploit instruction slots available after delayed branch instructions.
-fschedule-insns
If supported for the target machine, attempt to reorder instructions to eliminate execution stalls due to required data being unavailable. This helps machines that have slow floating point or memory load instructions by allowing other instructions to be issued until the result of the load or floating point instruction is required.
-fschedule-insns2
Similar to `-fschedule-insns', but requests an additional pass of instruction scheduling after register allocation has been done. This is especially useful on machines with a relatively small number of registers and where memory load instructions take more than one cycle.
TARGET OPTIONS
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 another.
-b machine
The argument machine specifies the target machine for compilation. This is useful when you have installed 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 using.
-V version
The argument version specifies which version of GNU CC to run. This is useful when multiple versions 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.
MACHINE DEPENDENT OPTIONS
Each of the target machine types can have its own special options, starting with `-m', to choose among various hardware models or configurations---for example, 68010 vs 68020, floating coprocessor or none. A single installed version of the compiler can compile for any model or configuration, according to the options specified.
Some configurations of the compiler also support additional special options, usually for command-line compatibility with other compilers on the same platform.
These are the `-m' options defined for the 68000 series:
-m68000
-mc68000
Generate output for a 68000. This is the default when the compiler is configured for 68000-based systems.
-m68020
-mc68020
Generate output for a 68020 (rather than a 68000). This is the default when the compiler is configured for 68020-based systems.
-m68881
Generate out
put containing 68881 instructions for floating point. This is the default for most 68020-based systems unless -nfp was specified when the compiler was configured.
-m68030
Generate output for a 68030. This is the default when the compiler is configured for 68030-based systems.
-m68040
Generate output for a 68040. This is the default when the compiler is configured for 68040-based systems.
-m68020-40
Generate output for a 68040, without using any of the new instructions. This results in code which can run relatively efficiently on either a 68020/68881 or a 68030 or a 68040.
-mfpa
Generate output containing Sun FPA instructions for floating point.
-msoft-float
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.
-mshort
Consider type int to be 16 bits wide, like short int.
-mnobitfield
Do not use the bit-field instructions. `-m68000' implies `-mnobitfield'.
-mbitfield
Do use the bit-field instructions. `-m68020' implies `-mbitfield'. This is the default if you use the unmodified sources.
-mrtd
Use a different function-calling convention, in which functions that take a fixed number of arguments 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 compiler.
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 ignored.)
The rtd instruction is supported by the 68010 and 68020 processors, but not by the 68000.
These `-m' options are defined for the Vax:
-munix
Do not output certain jump instructions (aobleq and so on) that the Unix assembler for the Vax cannot handle across long ranges.
-mgnu
Do output those jump instructions, on the assumption that you will assemble with the GNU assembler.
-mg
Output code for g-format floating point numbers instead of d-format.
These `-m' switches are supported on the SPARC:
-mfpu
-mhard-float
Generate output containing floating point instructions. This is the default.
-mno-fpu
-msoft-float
Generate output containing library calls for floating point. Warning: there is no GNU floating-point library for SPARC. Normally the facilities of the machine's usual C compiler are used, but this cannot be done directly in cross-compilation. You must make your own arrangements to provide suitable library functions for cross-compilation.
-msoft-float changes the calling convention in the output file; therefore, it is only useful if you compile all of a program with this option.
-mno-epilogue
-mepilogue
With -mepilogue (the default), the compiler always emits code for function exit at the end of each function. Any function exit in the middle of the function (such as a return statement in C) will generate a jump to the exit code at the end of the function.
With -mno-epilogue, the compiler tries to emit exit code inline at every function exit.
-mno-v8
-mv8
-msparclite
These three options select variations on the SPARC architecture.
By default (unless specifically configured for the Fujitsu SPARClite), GCC generates code for the v7 variant of the SPARC architecture.
-mv8 will give you SPARC v8 code. The only difference from v7 code is that the compiler emits the integer multiply and integer divide instructions which exist in SPARC v8 but not in SPARC v7.
-msparclite will give you SPARClite code. This adds the integer multiply, integer divide step and scan (ffs) instructions which exist in SPARClite but not in SPARC v7.
-mcypress
-msupersparc
These two options select the processor for which the code is optimised.
With -mcypress (the default), the compiler optimises code for the Cypress CY7C602 chip, as used in the SparcStation/SparcServer 3xx series. This is also appropriate for the older SparcStation 1, 2, IPX etc.
With -
视频教程列表
文章教程搜索
C语言程序设计推荐教程
C语言程序设计热门教程
|