⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 invoke.texi

📁 早期freebsd实现
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
@item -g@var{level}@itemx -ggdb@var{level}@itemx -gstabs@var{level}@itemx -gcoff@var{level}@itemx -gxcoff@var{level}@itemx -gdwarf@var{level}Request debugging information and also use @var{level} to specify howmuch information.  The default level is 2.Level 1 produces minimal information, enough for making backtraces inparts of the program that you don't plan to debug.  This includesdescriptions of functions and external variables, but no informationabout local variables and no line numbers.Level 3 includes extra information, such as all the macro definitionspresent in the program.  Some debuggers support macro expansion whenyou use @samp{-g3}.@cindex @code{prof}@item -pGenerate extra code to write profile information suitable for theanalysis program @code{prof}.@cindex @code{gprof}@item -pgGenerate extra code to write profile information suitable for theanalysis program @code{gprof}.@cindex @code{tcov}@item -aGenerate 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 @code{tcov}.  Note,however, that the format of the data is not what @code{tcov} expects.Eventually GNU @code{gprof} should be extended to process this data.@item -d@var{letters}Says to make debugging dumps during compilation at times specified by@var{letters}.  This is used for debugging the compiler.  The file namesfor most of the dumps are made by appending a word to the source filename (e.g.  @file{foo.c.rtl} or @file{foo.c.jump}).  Here are thepossible letters for use in @var{letters}, and their meanings:@table @samp@item MDump all macro definitions, at the end of preprocessing, and write nooutput.@item NDump all macro names, at the end of preprocessing.@item DDump all macro definitions, at the end of preprocessing, in addition tonormal output.@item yDump debugging information during parsing, to standard error.@item rDump after RTL generation, to @file{@var{file}.rtl}.@item xJust generate RTL for a function instead of compiling it.  Usually usedwith @samp{r}.@item jDump after first jump optimization, to @file{@var{file}.jump}.@item sDump after CSE (including the jump optimization that sometimesfollows CSE), to @file{@var{file}.cse}.@item LDump after loop optimization, to @file{@var{file}.loop}.@item tDump after the second CSE pass (including the jump optimization thatsometimes follows CSE), to @file{@var{file}.cse2}.@item fDump after flow analysis, to @file{@var{file}.flow}.@item cDump after instruction combination, to @file{@var{file}.combine}.@item SDump after the first instruction scheduling pass, to@file{@var{file}.sched}.@item lDump after local register allocation, to@*@file{@var{file}.lreg}.@item gDump after global register allocation, to@*@file{@var{file}.greg}.@item RDump after the second instruction scheduling pass, to@file{@var{file}.sched2}.@item JDump after last jump optimization, to @file{@var{file}.jump2}.@item dDump after delayed branch scheduling, to @file{@var{file}.dbr}.@item kDump after conversion from registers to stack, to @file{@var{file}.stack}.@item aProduce all the dumps listed above.@item mPrint statistics on memory usage, at the end of the run, tostandard error.@item pAnnotate the assembler output with a comment indicating whichpattern and alternative was used.@end table@item -fpretend-floatWhen running a cross-compiler, pretend that the target machine uses thesame floating point format as the host machine.  This causes incorrectoutput of the actual floating constants, but the actual instructionsequence will probably be the same as GNU CC would make when running onthe target machine.@item -save-tempsStore the usual ``temporary'' intermediate files permanently; place themin the current directory and name them based on the source file.  Thus,compiling @file{foo.c} with @samp{-c -save-temps} would produce files@file{foo.i} and @file{foo.s}, as well as @file{foo.o}.@end table@node Optimize Options@section Options That Control Optimization@cindex optimize options@cindex options, optimizationThese options control various sorts of optimizations:@table @code@item -O@itemx -O1Optimize.  Optimizing compilation takes somewhat more time, and a lotmore memory for a large function.Without @samp{-O}, the compiler's goal is to reduce the cost ofcompilation and to make debugging produce the expected results.Statements are independent: if you stop the program with a breakpointbetween statements, you can then assign a new value to any variable orchange the program counter to any other statement in the function andget exactly the results you would expect from the source code.Without @samp{-O}, only variables declared @code{register} areallocated in registers.  The resulting compiled code is a little worsethan produced by PCC without @samp{-O}.With @samp{-O}, the compiler tries to reduce code size and executiontime.When @samp{-O} is specified, @samp{-fthread-jumps} and@samp{-fdelayed-branch} are turned on.  On some machines otherflags may also be turned on.@item -O2Optimize even more.  Nearly all supported optimizations that do notinvolve a space-speed tradeoff are performed.  As compared to @samp{-O},this option increases both compilation time and the performance of thegenerated code.@samp{-O2} turns on all @samp{-f@var{flag}} options that enable moreoptimization, except for @samp{-funroll-loops},@samp{-funroll-all-loops} and @samp{-fomit-frame-pointer}.@item -O0Do not optimize.If you use multiple @samp{-O} options, with or without level numbers,the last such option is the one that is effective.@end tableOptions of the form @samp{-f@var{flag}} specify machine-independentflags.  Most flags have both positive and negative forms; the negativeform of @samp{-ffoo} would be @samp{-fno-foo}.  In the table below,only one of the forms is listed---the one which is not the default.You can figure out the other form by either removing @samp{no-} oradding it.@table @code@item -ffloat-storeDo not store floating point variables in registers, and inhibit otheroptions that might change whether a floating point value is taken from aregister or memory.This option prevents undesirable excess precision on machines such asthe 68000 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 few programs rely on theprecise definition of IEEE floating point.  Use @samp{-ffloat-store} forsuch programs.@item -fno-defer-popAlways pop the arguments to each function call as soon as that functionreturns.  For machines which must pop arguments after a function call,the compiler normally lets arguments accumulate on the stack for severalfunction calls and pops them all at once.@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 onsome machines.}@ifset INTERNALSOn some machines, such as the Vax, this flag has no effect, becausethe standard calling sequence automatically handles the frame pointerand nothing is saved by pretending it doesn't exist.  Themachine-description macro @code{FRAME_POINTER_REQUIRED} controlswhether a target machine supports this flag.  @xref{Registers}.@refill@end ifset@ifclear INTERNALSOn some machines, such as the Vax, this flag has no effect, becausethe standard calling sequence automatically handles the frame pointerand nothing is saved by pretending it doesn't exist.  Themachine-description macro @code{FRAME_POINTER_REQUIRED} controlswhether a target machine supports this flag.  @xref{Registers,,RegisterUsage, gcc.info, Using and Porting GCC}.@refill@end ifclear@item -fno-inlineDon't pay attention to the @code{inline} keyword.  Normally this optionis used to keep the compiler from expanding any functions inline.Note that if you are not optimizing, no functions can be expanded inline.@item -finline-functionsIntegrate all simple functions into their callers.  The compilerheuristically decides which functions are simple enough to be worthintegrating in this way.If all calls to a given function are integrated, and the function isdeclared @code{static}, then the function is normally not output asassembler code in its own right.@item -fkeep-inline-functionsEven if all calls to a given function are integrated, and the functionis declared @code{static}, nevertheless output a separate run-timecallable version of the function.@item -fno-default-inlineDon't make member functions inline by default merely because they aredefined inside the class scope (C++ only).@item -fno-function-cseDo not put function addresses in registers; make each instruction thatcalls a constant function contain the function's address explicitly.This option results in less efficient code, but some strange hacksthat alter the assembler output may be confused by the optimizationsperformed when this option is not used.@item -ffast-mathThis option allows GCC to violate some ANSI or IEEE rules/specificationsin the interest of optimizing code for speed.  For example, it allowsthe compiler to assume arguments to the @code{sqrt} function are non-negative numbers.  This option should never be turned on by any @samp{-O} option since it can result in incorrect output for programs which depend on an exact implementation of IEEE or ANSI rules/specifications formath functions.@item -felide-constructorsElide constructors when this seems plausible (C++ only).  With thisoption, GNU C++ initializes @code{y} directly from the call to @code{foo}without going through a temporary in the following code:@exampleA foo ();A y = foo ();@end exampleWithout this option, GNU C++ first initializes @code{y} by calling theappropriate constructor for type @code{A}; then assigns the result of@code{foo} to a temporary; and, finally, replaces the initial value of@code{y} with the temporary.The default behavior (@samp{-fno-elide-constructors}) is specified bythe draft ANSI C++ standard.  If your program's constructors have sideeffects, @samp{-felide-constructors} can change your program's behavior,since some constructor calls may be omitted.@item -fmemoize-lookups@itemx -fsave-memoizedUse heuristics to compile faster (C++ only).  These heuristics are notenabled by default, since they are only effective for certain inputfiles.  Other input files compile more slowly.The first time the compiler must build a call to a member function (orreference to a data member), it must (1) determine whether the classimplements member functions of that name; (2) resolve which memberfunction to call (which involves figuring out what sorts of typeconversions need to be made); and (3) check the visibility of the memberfunction to the caller.  All of this adds up to slower compilation.Normally, the second time a call is made to that member function (orreference to that data member), it must go through the same lengthyprocess again.  This means that code like this@examplecout << "This " << p << " has " << n << " legs.\n";@end example@noindentmakes six passes through all three steps.  By using a software cache, a``hit'' significantly reduces this cost.  Unfortunately, using the cacheintroduces another layer of mechanisms which must be implemented, and soincurs its own overhead.  `-fmemoize-lookups' enables the softwarecache.Because access privileges (visibility) to members and member functionsmay differ from one function context to the next, G++ may need to flushthe cache.  With the @samp{-fmemoize-lookups} flag, the cache is flushedafter every function that is compiled.  The @samp{-fsave-memoized} flagenables the same software cache, but when the compiler determines thatthe context of the last function compiled would yield the same accessprivileges of the next function to compile, it preserves the cache.This is most helpful when defining many member functions for the sameclass: with the exception of member functions which are friends of otherclasses, each member function has exactly the same access privileges asevery other, and the cache need not be flushed.@end tableThe following options control specific optimizations.  The @samp{-O2}option turns on all of these optimizations except @samp{-funroll-loops}and @samp{-funroll-all-loops}.  The @samp{-O} option usually turns onthe @samp{-fthread-jumps} and @samp{-fdelayed-branch} options, butspecific 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.@table @code@item -fstrength-reducePerform the optimizations of loop strength reduction andelimination of iteration variables.@item -fthread-jumpsPerform optimizations where we check to see if a jump branches to alocation where another comparison subsumed by the first is found.  Ifso, the first branch is redirected to either the destination of the

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -