📄 invoke.texi
字号:
second branch or a point immediately following it, depending on whetherthe condition is known to be true or false.@item -fcse-follow-jumpsIn common subexpression elimination, scan through jump instructionswhen the target of the jump is not reached by any other path. Forexample, when CSE encounters an @code{if} statement with an@code{else} clause, CSE will follow the jump when the conditiontested is false.@item -fcse-skip-blocksThis is similar to @samp{-fcse-follow-jumps}, but causes CSE tofollow jumps which conditionally skip over blocks. When CSEencounters a simple @code{if} statement with no else clause,@samp{-fcse-skip-blocks} causes CSE to follow the jump around thebody of the @code{if}.@item -frerun-cse-after-loopRe-run common subexpression elimination after loop optimizations has beenperformed. @item -fexpensive-optimizationsPerform a number of minor optimizations that are relatively expensive.@item -fdelayed-branchIf supported for the target machine, attempt to reorder instructionsto exploit instruction slots available after delayed branchinstructions.@item -fschedule-insnsIf supported for the target machine, attempt to reorder instructions toeliminate execution stalls due to required data being unavailable. Thishelps machines that have slow floating point or memory load instructionsby allowing other instructions to be issued until the result of the loador floating point instruction is required.@item -fschedule-insns2Similar to @samp{-fschedule-insns}, but requests an additional pass ofinstruction scheduling after register allocation has been done. This isespecially useful on machines with a relatively small number ofregisters and where memory load instructions take more than one cycle.@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.@item -funroll-loopsPerform the optimization of loop unrolling. This is only done for loopswhose number of iterations can be determined at compile time or run time.@samp{-funroll-loop} implies @samp{-fstrength-reduce} and@samp{-frerun-cse-after-loop}.@item -funroll-all-loopsPerform the optimization of loop unrolling. This is done for all loopsand usually makes programs run more slowly. @samp{-funroll-all-loops}implies @samp{-fstrength-reduce} and @samp{-frerun-cse-after-loop}.@item -fno-peepholeDisable any machine-specific peephole optimizations.@end table@node Preprocessor Options@section Options Controlling the Preprocessor@cindex preprocessor options@cindex options, preprocessorThese options control the C preprocessor, which is run on each C sourcefile before actual compilation.If you use the @samp{-E} option, nothing is done except preprocessing.Some of these options make sense only together with @samp{-E} becausethey cause the preprocessor output to be unsuitable for actualcompilation.@table @code@item -include @var{file}Process @var{file} as input before processing the regular input file.In effect, the contents of @var{file} are compiled first. Any @samp{-D}and @samp{-U} options on the command line are always processed before@samp{-include @var{file}}, regardless of the order in which they arewritten. All the @samp{-include} and @samp{-imacros} options areprocessed in the order in which they are written.@item -imacros @var{file}Process @var{file} as input, discarding the resulting output, beforeprocessing the regular input file. Because the output generated from@var{file} is discarded, the only effect of @samp{-imacros @var{file}}is to make the macros defined in @var{file} available for use in themain input.Any @samp{-D} and @samp{-U} options on the command line are alwaysprocessed before @samp{-imacros @var{file}}, regardless of the order inwhich they are written. All the @samp{-include} and @samp{-imacros}options are processed in the order in which they are written.@item -nostdincDo not search the standard system directories for header files. Onlythe directories you have specified with @samp{-I} options (and thecurrent directory, if appropriate) are searched. @xref{DirectoryOptions}, for information on @samp{-I}.By using both @samp{-nostdinc} and @samp{-I-}, you can limit the include-filesearch path to only those directories you specify explicitly.@item -nostdinc++Do not search for header files in the C++-specific standard directories,but do still search the other standard directories.(This option is used when building @samp{libg++}.)@item -undefDo not predefine any nonstandard macros. (Including architecture flags).@item -ERun only the C preprocessor. Preprocess all the C source filesspecified and output the results to standard output or to thespecified output file.@item -CTell the preprocessor not to discard comments. Used with the@samp{-E} option.@item -PTell the preprocessor not to generate @samp{#line} commands.Used with the @samp{-E} option.@cindex make@cindex dependencies, make@item -MTell the preprocessor to output a rule suitable for @code{make}describing the dependencies of each object file. For each source file,the preprocessor outputs one @code{make}-rule whose target is the objectfile name for that source file and whose dependencies are all the files@samp{#include}d in it. This rule may be a single line or may becontinued with @samp{\}-newline if it is long. The list of rules isprinted on standard output instead of the preprocessed C program.@samp{-M} implies @samp{-E}.Another way to specify output of a @code{make} rule is by settingthe environment variable @code{DEPENDENCIES_OUTPUT} (@pxref{EnvironmentVariables}).@item -MMLike @samp{-M} but the output mentions only the user header filesincluded with @samp{#include "@var{file}"}. System header filesincluded with @samp{#include <@var{file}>} are omitted.@item -MDLike @samp{-M} but the dependency information is written to files withnames made by replacing @samp{.o} with @samp{.d} at the end of theoutput file names. This is in addition to compiling the input files asspecified---@samp{-MD} does not inhibit ordinary compilation the way@samp{-M} does.The Mach utility @samp{md} can be used to merge the @samp{.d} filesinto a single dependency file suitable for using with the @samp{make}command.@item -MMDLike @samp{-MD} except mention only user header files, not systemheader files.@item -HPrint the name of each header file used, in addition to other normalactivities.@item -A@var{question}(@var{answer})Assert the answer @var{answer} for @var{question}, in case it is testedwith a preprocessor conditional such as @samp{#if#@var{question}(@var{answer})}. @samp{-A-} disables the standardassertions that normally describe the target machine.@item -D@var{macro}Define macro @var{macro} with the string @samp{1} as its definition.@item -D@var{macro}=@var{defn}Define macro @var{macro} as @var{defn}. All instances of @samp{-D} onthe command line are processed before any @samp{-U} options.@item -U@var{macro}Undefine macro @var{macro}. @samp{-U} options are evaluated after all@samp{-D} options, but before any @samp{-include} and @samp{-imacros}options.@item -dMTell the preprocessor to output only a list of the macro definitionsthat are in effect at the end of preprocessing. Used with the @samp{-E}option.@item -dDTell the preprocessing to pass all macro definitions into the output, intheir proper sequence in the rest of the output.@item -dNLike @samp{-dD} except that the macro arguments and contents are omitted.Only @samp{#define @var{name}} is included in the output.@item -trigraphsSupport ANSI C trigraphs. You don't want to know about thisbrain-damage. The @samp{-ansi} option also has this effect.@end table@node Assembler Options@section Passing Options to the Assembler@table @samp@item -Wa,@var{option}Pass @var{option} as an option to the assembler. If @var{option}contains commas, it is split into multiple options at the commas.@end table@node Link Options@section Options for Linking@cindex link options@cindex options, linkingThese options come into play when the compiler links object files intoan executable output file. They are meaningless if the compiler isnot doing a link step.@table @code@cindex file names@item @var{object-file-name}A file name that does not end in a special recognized suffix isconsidered to name an object file or library. (Object files aredistinguished from libraries by the linker according to the filecontents.) If linking is done, these object files are used as inputto the linker.@item -c@itemx -S@itemx -EIf any of these options is used, then the linker is not run, andobject file names should not be used as arguments. @xref{OverallOptions}.@cindex Libraries@item -l@var{library}Search the library named @var{library} when linking.It makes a difference where in the command you write this option; thelinker searches processes libraries and object files in the order theyare specified. Thus, @samp{foo.o -lz bar.o} searches library @samp{z}after file @file{foo.o} but before @file{bar.o}. If @file{bar.o} refersto functions in @samp{z}, those functions may not be loaded.The linker searches a standard list of directories for the library,which is actually a file named @file{lib@var{library}.a}. The linkerthen uses this file as if it had been specified precisely by name.The directories searched include several standard system directoriesplus 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} surrounds @var{library} with @samp{lib} and @samp{.a}and searches several directories.@item -lobjcThis special case of the @samp{-l} option is what you need to do when youlink an Objective C program.@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 -staticOn systems that support dynamic linking, this prevents linking with the sharedlibraries. On other systems, thisoption has no effect.@item -sharedProduce a shared object which can then be linked with other objects toform an executable. Only a few systems support this option.@item -symbolicBind references to global symbols when building a shared object. Warnabout any unresolved references (unless overridden by the link editoroption @samp{-Xlinker -z -Xlinker defs}). Only a few systems supportthis option.@item -Xlinker @var{option}Pass @var{option} as an option to the linker. You can use this tosupply system-specific linker options which GNU CC does not know how torecognize.If you want to pass an option that takes an argument, you must use@samp{-Xlinker} twice, once for the option and once for the argument.For example, to pass @samp{-assert definitions}, you must write@samp{-Xlinker -assert -Xlinker definitions}. It does not work to write@samp{-Xlinker "-assert definitions"}, because this passes the entirestring as a single argument, which is not what the linker expects.@item -Wl,@var{option}Pass @var{option} as an option to the linker. If @var{option} containscommas, it is split into multiple options at the commas.@item -u @var{symbol}Pretend the symbol @var{symbol} is undefined, to force linking oflibrary modules to define it. You can use @samp{-u} multiple times withdifferent symbols to force loading of additional library modules.@end table@node Directory Options@section Options for Directory Search@cindex directory options@cindex options, directory search@cindex search pathThese options specify directories to search for header files, forlibraries and for parts of the compiler:@table @code@item -I@var{dir}Append directory @var{dir} to the list of directories searched forinclude files.@item -I-Any directories you specify with @samp{-I} options before the @samp{-I-}option are searched only for the case of @samp{#include "@var{file}"};they are not searched for @samp{#include <@var{file}>}.If additional directories are specified with @samp{-I} options afterthe @samp{-I-}, these directories are searched for all @samp{#include}directives. (Ordinarily @emph{all} @samp{-I} directories are usedthis way.)In addition, the @samp{-I-} option inhibits the use of the currentdirectory (where the current input file came from) as the first searchdirectory for @samp{#include "@var{file}"}. There is no way tooverride this effect of @samp{-I-}. With @samp{-I.} you can specifysearching the directory which was current when the compiler wasinvoked. That is not exactly the same as what the preprocessor doesby default, but it is often satisfactory.@samp{-I-} does not inhibit
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -