📄 gcc.texinfo
字号:
plus any that you specify with @samp{-L}.Normally the files found this way are library files---archive fileswhose members are object files. The linker handles an archive file byscanning through it for members which define symbols that have so farbeen referenced but not defined. But if the file that is found is anordinary object file, it is linked in the usual fashion. The onlydifference between using an @samp{-l} option and specifying a file nameis that @samp{-l} searches several directories.@item -L@var{dir}Add directory @var{dir} to the list of directories to be searchedfor @samp{-l}.@item -nostdlibDon't use the standard system libraries and startup files when linking.Only the files you specify will be passed to the linker.@item -m@var{machinespec}Machine-dependent option specifying something about the type of targetmachine. These options are defined by the macro@code{TARGET_SWITCHES} in the machine description. The default forthe options is also defined by that macro, which enables you to changethe defaults.@refillThese are the @samp{-m} options defined in the 68000 machinedescription:@table @samp@item -m68020@itemx -mc68020Generate output for a 68020 (rather than a 68000). This is thedefault if you use the unmodified sources.@item -m68000@item -mc68000Generate output for a 68000 (rather than a 68020).@item -m68881Generate output containing 68881 instructions for floating point.This is the default if you use the unmodified sources.@item -mfpaGenerate output containing Sun FPA instructions for floating point.@item -msoft-floatGenerate output containing library calls for floating point.@item -mshortConsider type @code{int} to be 16 bits wide, like @code{short int}.@item -mnobitfieldDo not use the bit-field instructions. @samp{-m68000} implies@samp{-mnobitfield}.@item -mbitfieldDo use the bit-field instructions. @samp{-m68020} implies@samp{-mbitfield}. This is the default if you use the unmodifiedsources.@item -mrtdUse a different function-calling convention, in which functionsthat take a fixed number of arguments return with the @code{rtd}instruction, which pops their arguments while returning. Thissaves one instruction in the caller since there is no need to popthe arguments there.This calling convention is incompatible with the one normallyused on Unix, so you cannot use it if you need to call librariescompiled with the Unix compiler.Also, you must provide function prototypes for all functions thattake variable numbers of arguments (including @code{printf});otherwise incorrect code will be generated for calls to thosefunctions.In addition, seriously incorrect code will result if you call afunction with too many arguments. (Normally, extra arguments areharmlessly ignored.)The @code{rtd} instruction is supported by the 68010 and 68020processors, but not by the 68000.@end tableThese @samp{-m} options are defined in the Vax machine description:@table @samp@item -munixDo not output certain jump instructions (@code{aobleq} and so on)that the Unix assembler for the Vax cannot handle across longranges.@item -mgnuDo output those jump instructions, on the assumption that youwill assemble with the GNU assembler.@item -mgOutput code for g-format floating point numbers instead of d-format.@end tableThese @samp{-m} switches are supported on the Sparc:@table @samp@item -mfpuGenerate output containing floating point instructions. This is thedefault if you use the unmodified sources.@ignore@item -msoft-floatGenerate output containing library calls for floating point.@end ignore@item -mno-epilogueGenerate separate return instructions for @code{return} statements.This has both advantages and disadvantages; I don't recall what theyare.@end tableThese @samp{-m} options are defined in the Convex machine description:@table @samp@item -mc1Generate output for a C1. This is the default when the compiler isconfigured for a C1.@item -mc2Generate output for a C2. This is the default when the compiler isconfigured for a C2.@item -margcountGenerate code which puts an argument count in the word preceding eachargument list. Some nonportable Convex and Vax programs need thisword. (Debuggers don't; this info is in the symbol table.)@item -mnoargcountOmit the argument count word. This is the default if you use theunmodified sources.@end table@item -f@var{flag}Specify machine-independent flags. Most flags have both positive andnegative forms; the negative form of @samp{-ffoo} would be@samp{-fno-foo}. In the table below, only one of the forms islisted---the one which is not the default. You can figure out theother form by either removing @samp{no-} or adding it.@table @samp@item -fpcc-struct-returnUse the same convention for returning @code{struct} and @code{union}values that is used by the usual C compiler on your system. Thisconvention is less efficient for small structures, and on manymachines it fails to be reentrant; but it has the advantage ofallowing intercallability between GCC-compiled code and PCC-compiledcode.@item -ffloat-storeDo not store floating-point variables in registers. Thisprevents undesirable excess precision on machines such as the68000 where the floating registers (of the 68881) keep moreprecision than a @code{double} is supposed to have.For most programs, the excess precision does only good, but a fewprograms rely on the precise definition of IEEE floating point.Use @samp{-ffloat-store} for such programs.@item -fno-asmDo not recognize @code{asm}, @code{inline} or @code{typeof} as akeyword. These words may then be used as identifiers. You canuse @code{__asm__}, @code{__inline__} and @code{__typeof__} instead.@item -fno-defer-popAlways pop the arguments to each function call as soon as thatfunction returns. Normally the compiler (when optimizing) letsarguments accumulate on the stack for several function calls andpops them all at once.@item -fstrength-reducePerform the optimizations of loop strength reduction andelimination of iteration variables.@item -fcombine-regsAllow the combine pass to combine an instruction that copies oneregister into another. This might or might not produce bettercode when used in addition to @samp{-O}. I am interested inhearing about the difference this makes.@item -fforce-memForce memory operands to be copied into registers before doingarithmetic on them. This may produce better code by making allmemory references potential common subexpressions. When they arenot common subexpressions, instruction combination shouldeliminate the separate register-load. I am interested in hearingabout the difference this makes.@item -fforce-addrForce memory address constants to be copied into registers beforedoing arithmetic on them. This may produce better code just as@samp{-fforce-mem} may. I am interested in hearing about thedifference this makes.@item -fomit-frame-pointerDon't keep the frame pointer in a register for functions thatdon't need one. This avoids the instructions to save, set up andrestore frame pointers; it also makes an extra register availablein many functions. @strong{It also makes debugging impossible.}On some machines, such as the Vax, this flag has no effect,because the standard calling sequence automatically handles theframe pointer and nothing is saved by pretending it doesn'texist. The machine-description macro@code{FRAME_POINTER_REQUIRED} controls whether a target machinesupports this flag. @xref{Registers}.@refill@item -finline-functionsIntegrate all simple functions into their callers. The compilerheuristically decides which functions are simple enough to beworth integrating in this way.If all calls to a given function are integrated, and the functionis declared @code{static}, then the function is normally notoutput as assembler code in its own right.@item -fcaller-savesEnable values to be allocated in registers that will be clobbered byfunction calls, by emitting extra instructions to save and restore theregisters around such calls. Such allocation is done only when itseems to result in better code than would otherwise be produced.This option is enabled by default on certain machines, usually thosewhich have no call-preserved registers to use instead.Don't use @samp{-fcaller-saves} together with@samp{-fomit-frame-pointer}. This combination does not work.@item -fkeep-inline-functionsEven if all calls to a given function are integrated, and thefunction is declared @code{static}, nevertheless output aseparate run-time callable version of the function.@item -fwritable-stringsStore string constants in the writable data segment and don't uniquizethem. This is for compatibility with old programs which assume they canwrite into string constants. @samp{-traditional} also has this effect.Writing into string constants is a very bad idea; ``constants'' shouldbe constant.@item -fcond-mismatchAllow conditional expressions with mismatched types in the second andthird arguments. The value of such an expression is void.@item -fno-function-cseDo not put function addresses in registers; make each instructionthat calls a constant function contain the function's addressexplicitly.This option results in less efficient code, but some strangehacks that alter the assembler output may be confused by theoptimizations performed when this option is not used.@item -fvolatileConsider all memory references through pointers to be volatile.@item -fshared-dataRequests that the data and non-@code{const} variables of thiscompilation be shared data rather than private data. The distinctionmakes sense only on certain operating systems, where shared data isshared between processes running the same program, while private dataexists in one copy per process.@item -funsigned-charLet the type @code{char} be the unsigned, like @code{unsigned char}.Each kind of machine has a default for what @code{char} shouldbe. It is either like @code{unsigned char} by default or like@code{signed char} by default. (Actually, at present, thedefault is always signed.)The type @code{char} is always a distinct type from either@code{signed char} or @code{unsigned char}, even though itsbehavior is always just like one of those two.Note that this is equivalent to @samp{-fno-signed-char}, which is thenegative form of @samp{-fsigned-char}.@item -fsigned-charLet the type @code{char} be signed, like @code{signed char}.Note that this is equivalent to @samp{-fno-unsigned-char}, which isthe negative form of @samp{-funsigned-char}.@item -fdelayed-branchIf supported for the target machine, attempt to reorder instructionsto exploit instruction slots available after delayed branchinstructions.@item -ffixed-@var{reg}Treat the register named @var{reg} as a fixed register; generatedcode should never refer to it (except perhaps as a stack pointer,frame pointer or in some other fixed role).@var{reg} must be the name of a register. The register namesaccepted are machine-specific and are defined in the@code{REGISTER_NAMES} macro in the machine description macrofile.This flag does not have a negative form, because it specifies athree-way choice.@item -fcall-used-@var{reg}Treat the register named @var{reg} as an allocatable registerthat is clobbered by function calls. It may be allocated fortemporaries or variables that do not live across a call.Functions compiled this way will not save and restore theregister @var{reg}.Use of this flag for a register that has a fixed pervasive rolein the machine's execution model, such as the stack pointer orframe pointer, will produce disastrous results.This flag does not have a negative form, because it specifies athree-way choice.@item -fcall-saved-@var{reg}Treat the register named @var{reg} as an allocatable registersaved by functions. It may be allocated even for temporaries orvariables that live across a call. Functions compiled this waywill save and restore the register @var{reg} if they use it.Use of this flag for a register that has a fixed pervasive rolein the machine's execution model, such as the stack pointer orframe pointer, will produce disastrous results.A different sort of disaster will result from the use of thisflag for a register in which function values may be returned.This flag does not have a negative form, because it specifies athree-way choice.@end table@item -d@var{letters}Says to make debugging dumps at times specified by @var{letters}.Here are the possible letters:@table @samp@item rDump after RTL generation.@item j
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -