123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592 |
- .\ " =====================
- .\ " This version is 1.20.
- .\ " =====================
- .TH GCC 1 "19 April 1988" "Printed 04/20/88"
- .\ ".UC 4
- .SH NAME
- gcc \- GNU project C Compiler
- .SH SYNOPSIS
- .B gcc
- [ option ] ... file ...
- .SH DESCRIPTION
- The
- .I GNU\ C\ compiler
- uses a command syntax much like the Unix C compiler. The
- .I gcc
- program accepts options and file names as operands. Multiple
- single-letter options may
- .I not
- be grouped: `\fB\-dr\fR'
- is very different from `\fB\-d\ \-r\fR'.
- When you invoke
- .I GNU\ CC
- \, it normally does preprocessing, compilation,
- assembly and linking. File names with `\fB.c\fR'
- are taken as C
- source to be preprocessed and compiled; compiler output files plus any
- input files with names ending in `\fB.s\fR'
- are assembled; then the
- resulting object files, plus any other input files, are linked together to
- produce an executable.
- .br
- Command options allow you to stop this process at an intermediate stage.
- For example, the `\fB\-c\fR'
- option says not to run the linker.
- Then the output consists of object files output by the assembler.
- .br
- Other command options are passed on to one stage.
- Some options control the preprocessor and others the compiler itself.
- .br
- Here are the options to control the overall compilation process,
- including those that say whether to link, whether to assemble, and so on.
- .TP
- .BI \-o "\ \ file"
- Place linker output in file \fIfile\fR.
- This applies regardless to whatever sort of output is being produced,
- whether it be an executable file, an object file, an assembler file or
- preprocessed C code.
- If `\fB\-o\fR'
- is not specified, the default is to put an executable file
- in `a.out', the object file `\fIsource\fR.o', and preprocessed C
- on standard output.
- .TP
- .B \-c
- Compile or assemble the source files, but do not link.
- Produce object files with names made by replacing `\fB\.c\fR'
- or `\fB\.s\fR'
- with `\fB\.o\fR'
- at the end of the input file names.
- Do nothing at all for object files specified as input.
- .TP
- .B \-S
- Compile into assembler code but do not assemble.
- The assembler output file name is made by replacing `\fB\.c\fR'
- with `\fB\.s\fR'
- at the end of the input file name.
- Do nothing at all for assembler source files or object files specified
- as input.
- .TP
- .B \-E
- Run only the C preprocessor.
- Preprocess all the C source files specified
- and output the results to standard output.
- .TP
- .B \-v
- Compiler driver program prints the commands it executes as it runs
- the preprocessor, compiler proper, assembler and linker.
- Some of these are directed to print their own version numbers.
- .TP
- .BI \-B "prefix"
- Compiler driver program tries \fIprefix\fR as a prefix for each program
- it tries to run. These programs are `\fBcpp\fR', `\fBcc1\fR',
- `\fBas\fR' and `\fBld\fR'.
- For each subprogram to be run, the compiler driver first tries
- the `\fB\-B\fR' prefix, if any.
- If that name is not found, or if `\fB\-B\fR' was not specified,
- the driver tries two standard prefixes,
- which are `\fB/usr/lib/gcc-\fR' and `\fB/usr/local/lib/gcc-\fR'.
- 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 `\fBPATH\fR' environment variable.
- The run-time support file `\fBgnulib\fR' is also searched for using
- the `\fB\-B\fR' prefix, if needed.
- If it is not found there, the two standard prefixes above are tried,
- and that is all.
- The file is left out of the link if it is not found by those means.
- Most of the time, on most machines, you can do without it.
- .PP
- These options control the C preprocessor,
- which is run on each C source file before actual compilation.
- If you use the `\fB\-E\fR' option, nothing is done except C preprocessing.
- Some of these options make sense only together with `\fB\-E\fR'
- because they request preprocessor output that is not suitable
- for actual compilation.
- .TP
- .B \-C
- Tell the preprocessor not to discard comments. Used with the `\fB\-E\fR'
- option.
- .TP
- .BI \-I "dir"
- Search directory
- .I dir
- for include files.
- .TP
- .B \-M
- Tell the preprocessor to output a rule suitable for \fBmake\fR
- describing the dependencies of each source file.
- For each source file, the preprocessor outputs one \fBmake\fR-rule
- whose target is the object file name for that source file and
- whose dependencies are all the files `\fB#include\fR'd in it.
- This rule may be a single line or may be continued with `\fB\\\fR'-newline
- if it is long. `\fB\-M\fR' implies `\fB\-E\fR'.
- .TP
- .B \-MM
- Like `\fB\-M\fR' but the output mentions only the user-header files included
- with `\fB#include "file"\fR'.
- System header files included with `\fB#include <\fIfile\fB>\fR'
- are omitted.`\fB\-MM\fR' implies `\fB\-E\fR'.
- .TP
- .BI \-D "macro"
- Define macro \fImacro\fR
- with the empty string as its definition.
- .TP
- .B \-D\fImacro=defn\fR
- Define macro \fImacro\fR as \fIdefn\fR.
- .TP
- .BI \-U "macro"
- Undefine macro \fImacro\fR.
- .TP
- .B \-T
- Support ANSI C trigraphs.
- You don't want to know about this brain-damage.
- The `\fB\-ansi\fR' option also has this effect.
- .PP
- These options control the details of C compilation itself.
- .TP
- .B \-ansi
- Support all ANSI standard C programs.
- This turns off certain features of GNU C that are incompatible with
- ANSI C, such as the \fBasm\fR, \fBinline\fR and \fBtypeof\fR keywords, and
- predefined macros such as \fBunix\fR and \fBvax\fR that identify
- the type of system you are using.
- It also enables the undesirable and rarely used ANSI tragraph feature.
- The `\fB\-ansi\fR' option does not cause non-ANSI programs to be rejected
- gratuitously.
- For that object that, `\fB\-pedantic\fR' is required
- in addition to `\fB\-ansi\fR'.
- The macro \fB__STRICT_ANSI__\fR
- is predefined when the `-ansi' option is used.
- Some header files may notice this macro and refrain from declaring
- certain functions or defining certain macros that the ANSI standard
- doesn't call for; this is to avoid interfering with any programs
- that might use these names for other things.
- .TP
- .B \-traditional
- Attempt to support some aspects of traditional C compilers.
- Specifically:
- .br
- \(** All \fBextern\fR declarations take effect globally even if
- they are written inside of a function definition.
- This includes implicit declarations of functions.
- .br
- \(** The keywords \fBtypeof\fR, \fBinline\fR, \fBsigned\fR, \fBconst\fR
- and \fBvolatile\fR are not recognized.
- .br
- \(** Comparisons between pointers and integers are always allowed.
- .br
- \(** Integer types \fBunsigned short\fR and \fBunsigned char\fR
- promote to \fBunsigned int\fR.
- .TP
- .B \-pedantic
- Issue all the warnings demanded by strict ANSI standard C;
- reject all programs that use forbidden extensions.
- Valid ANSI standard C programs should compile properly with or
- without this option (though a rare few will require `\fB\-ansi\fR'.
- However, without this option, certain GNU extensions and
- traditional C features are supported as well.
- With this option, they are rejected.
- There is no reason to \fIuse\fR
- this option; it exists only to satisfy pedants.
- .TP
- .B \-O
- Optimize. Optimizing compilation takes somewhat more time, and a lot
- more memory for a large function.
- Without `\fB\-O\fR', 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 `\fB\-O\fR', only variables declared \fBregister\fR
- are allocated in registers.
- The resulting compiled code is
- a little worse than produced by PCC without `\fB\-O\fR'.
- With `\fB\-O\fR', the compiler tries to reduce code size and execution time.
- Some of the `\fB\-f\fR' options described below turn specific
- kinds of optimization on or off.
- .TP
- .B \-g
- Produce debugging information in DBX format.
- Unlike most other C compilers,
- GNU CC allows you to use `\fB\-g\fR' with `\fB\-O\fR'.
- 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.
- .TP
- .B \-gg
- Produce debugging information in GDB(GNU Debugger)'s own format.
- This requires the GNU assembler and linker
- in order to work.
- .TP
- .B \-w
- Inhibit all warning messages.
- .TP
- .B \-W
- Print extra warning messages for these events:
- .br
- \(** 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.
- They occur only for variables that are candidates for register
- allocation. Therefore, they do not occur for a variable that is
- declared
- .B 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 the flow analysis pass 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.
- .br
- \(** A nonvolantile automatic variable might be changed
- by a call to \flongjmp\fR.
- These warnings as well are possible only in optimizing compilation.
- The compiler only the calls to \fBsetjmp\fR.
- It cannot know where \fBlongjmp\fR
- will be called; in fact, a signal handler could cal it at any point
- in the code. As a result, you may get a warning even when there is
- in fact no problem because \fBlongjmp\fR
- cannot in fact be called at the place which would cause a problem.
- .br
- \(** A function can return either with or without a value.
- (Falling off the end of the function body is considered returning
- without a value.)
- Spurious warning can occur because GNU CC does not realize that
- certain functions (including \fBabort\fR
- and \fBlongjmp\fR) will never return.
- .TP
- .B \-Wimplicit
- Warn whenever a function is implicitly declared.
- .TP
- .B \-Wreturn-type
- Warn whenever a function is defined with a return-type that
- defaults to \fBint\fR. Also warn about any \fBreturn\fR
- statement with no return-value in a function whose return-type
- is not \fBvoid\fR.
- .TP
- .B \-p
- Generate extra code to write profile information suitable for the
- analysis program \fBprof\fR.
- .TP
- .B \-pg
- Generate extra code to write profile information suitable for the
- analysis program \fBgprof\fR.
- .TP
- .BI \-m "machinespec"
- Machine-dependent option specifying something about the type of target machine.
- These options are defined by the macro \fBTARGET_SWITCHES\fR
- in the machine description. The default for the options is also
- defined by that macro, which enables you to change the defaults.
- .IP
- These are the `\fB\-m\fR' options defined in the 68000 machine description:
- .TP 10
- .B \ \ \ \ \ \ \ \ \-m68020
- Generate output for a 68020 (rather than a 68000).
- This is the default if you use the unmodified sources.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-m68000
- Generate output for a 68000 (rather than a 68020).
- .TP 10
- .B \ \ \ \ \ \ \ \ \-m68881
- Generate output containing 68881 instructions for floating point.
- This is the default if you use the unmodified sources.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-msoft-float
- Generate output containing library calls for floating point.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-mshort
- Consider type \fBint\fR to be 16 bits wide, like \fBshort int\fR.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-mnobitfield
- Do not use the bit-field instructions.
- .B '\-m68000'
- implies
- .B '\-mnobitfield'.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-mbitfield
- Do use the bit-field instructions.
- .B '\-m68020'
- implies
- .B '\-mbitfield'.
- This is the default if you use the unmodified sources.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-mrtd
- Use a different function-calling convention, in which functions that
- take a fixed number of arguments return with the \fBrtd\fR
- 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 \fBprintf\fR); 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 \fBrtd\fR
- instruction is supported by the 68010 and 68020
- processors, but not by the 68000.
- .IP
- These are the `\fB\-m\fR' options defined in the VAX machine description:
- .TP 10
- .B \ \ \ \ \ \ \ \ \-munix
- Do not output certain jump instructions (
- .B aobleq
- and so on) that the Unix assembler
- for the VAX cannot handle across long ranges.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-mgnu
- Do output those jump instructions; on the assumption
- that you will assemble with the GNU assembler.
- .TP 5
- .BI \-f "flag"
- Specify machine-independent flags. These are the flags:
- .TP 10
- .B \ \ \ \ \ \ \ \ \-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 \fIdouble\fR 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 `
- .B \-ffloat-store'
- for such programs.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-frno-asm
- Do not recognize \fBasm\fR, \fBinline\fR or \fBtypeof\fR
- as a keyword. These words may then be used as identifiers.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-fno-defer-pop
- Always pop the arguments to each function call as soon as that
- function returns.
- Normally the compiler (when optimizing) lets arguments accumulate on the
- stack for several function calls and pops them all at once.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-fcombine-regs
- Allow the combine pass to combine an instruction that copies one
- register into another.
- This might or might not produce better code when used in addition to `
- .B \-O'.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-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.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-fforce-addr
- Force memory address constants to be copied into registers before
- doing arithmetic on them.
- This may produce better code just as `
- .B \-fforce-mem'
- may.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-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. \fBIt\ also\ makes\ debugging\ impossible.\fR
- On some machines, such as the VAX, this flag has no effect. This
- is because the standard calling sequence automatically handles
- the frame pointer and nothing is saved by pretending it doesn't exist.
- The machine-description macro \fBFRAME_POINTER_REQUIRED\fR
- controls whether a target machine supports this flag.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-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 \fBstatic\fR,
- then the function is normally not output as assembler code in its
- own right.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-fkeep-inline-functions
- Even if all calls to a given function are integrated, and the
- function is declared \fBstatic\fR,
- nevertheless output a separate run-time callable version of
- the function.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-fwritable-strings
- Store string constants in the writable data segment and don't uniquize them.
- This is for compatibility with old programs which assume
- they can write into string constants. Writing into string constants
- is a very bad idea; ``constants'' should be constant.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-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.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-fnostdinc
- Don't search the standard directories for include files.
- Only the directories you specify explicitly with the `\fB\-I\fR'
- option will be searched.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-fnostdlib
- Don't use the standard system libraries and startup files
- when linking.
- Only the files you specify (plus `\fBgnulib\fR') will be passed to the linker.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-fvolatile
- Consider all memory references through pointers to be volatile.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-funsigned-char
- Let the type \fBchar\f be the unsigned, like \fBunsigned char\fR.
- Each kind of machine has a default for what \fBchar\fR
- should be. It is either like \fBunsigned char\fR
- by default of like \fBsigned char\fR
- by default. (Actually, at present, the default is always signed.)
- The type \fBchar\fR
- is always a distinct type from either \fBsigned char\fR
- or \fBunsigned char\fR,
- even though its behavior is always just like one of those two.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-fsigned-char
- Let the type \fBchar\fR be the same as \fBsigned char\fR.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-ffixed-\fIreg\fR
- Treat the register named \fIreg\fR 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). \fIreg\fR
- must be the name of a register.
- The register names accepted are machine-specific and are defined in
- the \fBREGISTER_NAMES\fR
- macro in the machine description macro file.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-fcall-used-\fIreg\fR
- Treat the register named \fIreg\fR
- as an allocatable register that is clobberred 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 \fIreg\fR.
- 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.
- .TP 10
- .B \ \ \ \ \ \ \ \ \-fcall-saved-\fIreg\fR
- Treat the register named \fIreg\fR
- as an allocatable register saved by functions.
- It may be allocated even for temporaries or
- variables that live across a call. Functions compiled this way
- will save and restore the register \fIreg\fR 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 are may be returned.
- .TP
- .BI \-d "letters"
- Says to make debugging dumps at times specified by \fIletters\fR.
- Here are the possible letters:
- .TP 10
- .B \ \ \ \ \ \ \ \ r
- Dump after RTL generation.
- .TP 10
- .B \ \ \ \ \ \ \ \ j
- Dump after first jump optimization.
- .TP 10
- .B \ \ \ \ \ \ \ \ J
- Dump after last jump optimization.
- .TP 10
- .B \ \ \ \ \ \ \ \ s
- Dump after CSE (including the jump optimization that sometimes
- follows CSE).
- .TP 10
- .B \ \ \ \ \ \ \ \ L
- Dump after loop optimization.
- .TP 10
- .B \ \ \ \ \ \ \ \ f
- Dump after flow analysis.
- .TP 10
- .B \ \ \ \ \ \ \ \ c
- Dump after instruction combination.
- .TP 10
- .B \ \ \ \ \ \ \ \ l
- Dump after local register allocation.
- .TP 10
- .B \ \ \ \ \ \ \ \ g
- Dump after global register allocation.
- .TP 10
- .B \ \ \ \ \ \ \ \ m
- Print statistics on memory usage, at the end of the run.
- .SH FILES
- .ta \w'/usr/local/lib/gcc-gnulib 'u
- file.c input file
- .br
- file.o object file
- .br
- a.out loaded output
- .br
- /tmp/cc? temporary
- .br
- /usr/local/lib/gcc-cpp preprocessor
- .br
- /usr/local/lib/gcc-cc1 compiler
- .br
- /usr/local/lib/gcc-gnulib library need by GCC on some machines
- .br
- /lib/crt0.o runtime startoff
- .br
- /lib/libc.a standard library, see
- .IR intro (3)
- .br
- /usr/include standard directory for `#include' files
- .br
- .SH "SEE ALSO"
- B. W. Kernighan and D. M. Ritchie,
- .I The C Programming Language,
- Prentice-Hall,
- 1978
- .br
- B. W. Kernighan,
- .I
- Programming in C
- .br
- D. M. Ritchie,
- .I
- C Reference Manual
- .br
- adb(1), ld(1), dbx(1), as(1)
- .SH BUGS
- Bugs should be reported to bug-gcc@prep.ai.mit.edu. Bugs tend actually to be
- fixed if they can be isolated, so it is in your interest to report them
- in such a way that they can be easily reproduced according to get newer version.
- .SH COPYING
- Copyright (C) 1988 Richard M. Stallman.
- .br
- Permission is granted to make and distribute verbatim copies of
- this manual provided the copyright notice and this permission notice
- are preserved on all copies.
- .br
- Permission is granted to copy and distribute modified versions of this
- manual under the conditions for verbatim copying, provided also that the
- section entitled "GNU CC General Public License" is included exactly as
- in the original, and provided that the entire resulting derived work is
- distributed under the terms of a permission notice identical to this one.
- .br
- Permission is granted to copy and distribute translations of this manual
- into another language, under the above conditions for modified versions,
- except that the section entitled "GNU CC General Public License" may be
- included in a translation approved by the author instead of in the original
- English.
|