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

📄 optimize-options.html

📁 自己收集的linux入门到学懂高级编程书集 包括linux程序设计第三版
💻 HTML
📖 第 1 页 / 共 5 页
字号:
     <br><dt><code>-fprofile-generate</code>     <dd>     <p>Enable options usually used for instrumenting application to produceprofile useful for later recompilation with profile feedback basedoptimization.  You must use <code>-fprofile-generate</code> both whencompiling and when linking your program.     <p>The following options are enabled: <code>-fprofile-arcs</code>, <code>-fprofile-values</code>, <code>-fvpt</code>.     <br><dt><code>-fprofile-use</code>     <dd>Enable profile feedback directed optimizations, and optimizationsgenerally profitable only with profile feedback available.     <p>The following options are enabled: <code>-fbranch-probabilities</code>,<code>-fvpt</code>, <code>-funroll-loops</code>, <code>-fpeel-loops</code>, <code>-ftracer</code>.   </dl>   <p>The following options control compiler behavior regarding floatingpoint arithmetic.  These options trade off between speed andcorrectness.  All must be specifically enabled.     <dl><dt><code>-ffloat-store</code>     <dd>Do not store floating point variables in registers, and inhibit otheroptions that might change whether a floating point value is taken from aregister or memory.     <p>This option prevents undesirable excess precision on machines such asthe 68000 where the floating registers (of the 68881) keep moreprecision than a <code>double</code> is supposed to have.  Similarly for thex86 architecture.  For most programs, the excess precision does onlygood, but a few programs rely on the precise definition of IEEE floatingpoint.  Use <code>-ffloat-store</code> for such programs, after modifyingthem to store all pertinent intermediate computations into variables.     <br><dt><code>-ffast-math</code>     <dd>Sets <code>-fno-math-errno</code>, <code>-funsafe-math-optimizations</code>, <br><code>-fno-trapping-math</code>, <code>-ffinite-math-only</code>,<code>-fno-rounding-math</code> and <code>-fno-signaling-nans</code>.     <p>This option causes the preprocessor macro <code>__FAST_MATH__</code> to be defined.     <p>This option should never be turned on by any <code>-O</code> option sinceit can result in incorrect output for programs which depend onan exact implementation of IEEE or ISO rules/specifications formath functions.     <br><dt><code>-fno-math-errno</code>     <dd>Do not set ERRNO after calling math functions that are executedwith a single instruction, e.g., sqrt.  A program that relies onIEEE exceptions for math error handling may want to use this flagfor speed while maintaining IEEE arithmetic compatibility.     <p>This option should never be turned on by any <code>-O</code> option sinceit can result in incorrect output for programs which depend onan exact implementation of IEEE or ISO rules/specifications formath functions.     <p>The default is <code>-fmath-errno</code>.     <br><dt><code>-funsafe-math-optimizations</code>     <dd>Allow optimizations for floating-point arithmetic that (a) assumethat arguments and results are valid and (b) may violate IEEE orANSI standards.  When used at link-time, it may include librariesor startup files that change the default FPU control word or othersimilar optimizations.     <p>This option should never be turned on by any <code>-O</code> option sinceit can result in incorrect output for programs which depend onan exact implementation of IEEE or ISO rules/specifications formath functions.     <p>The default is <code>-fno-unsafe-math-optimizations</code>.     <br><dt><code>-ffinite-math-only</code>     <dd>Allow optimizations for floating-point arithmetic that assumethat arguments and results are not NaNs or +-Infs.     <p>This option should never be turned on by any <code>-O</code> option sinceit can result in incorrect output for programs which depend onan exact implementation of IEEE or ISO rules/specifications.     <p>The default is <code>-fno-finite-math-only</code>.     <br><dt><code>-fno-trapping-math</code>     <dd>Compile code assuming that floating-point operations cannot generateuser-visible traps.  These traps include division by zero, overflow,underflow, inexact result and invalid operation.  This option implies<code>-fno-signaling-nans</code>.  Setting this option may allow fastercode if one relies on "non-stop" IEEE arithmetic, for example.     <p>This option should never be turned on by any <code>-O</code> option sinceit can result in incorrect output for programs which depend onan exact implementation of IEEE or ISO rules/specifications formath functions.     <p>The default is <code>-ftrapping-math</code>.     <br><dt><code>-frounding-math</code>     <dd>Disable transformations and optimizations that assume default floatingpoint rounding behavior.  This is round-to-zero for all floating pointto integer conversions, and round-to-nearest for all other arithmetictruncations.  This option should be specified for programs that changethe FP rounding mode dynamically, or that may be executed with anon-default rounding mode.  This option disables constant folding offloating point expressions at compile-time (which may be affected byrounding mode) and arithmetic transformations that are unsafe in thepresence of sign-dependent rounding modes.     <p>The default is <code>-fno-rounding-math</code>.     <p>This option is experimental and does not currently guarantee todisable all GCC optimizations that are affected by rounding mode. Future versions of GCC may provide finer control of this settingusing C99's <code>FENV_ACCESS</code> pragma.  This command line optionwill be used to specify the default state for <code>FENV_ACCESS</code>.     <br><dt><code>-fsignaling-nans</code>     <dd>Compile code assuming that IEEE signaling NaNs may generate user-visibletraps during floating-point operations.  Setting this option disablesoptimizations that may change the number of exceptions visible withsignaling NaNs.  This option implies <code>-ftrapping-math</code>.     <p>This option causes the preprocessor macro <code>__SUPPORT_SNAN__</code> tobe defined.     <p>The default is <code>-fno-signaling-nans</code>.     <p>This option is experimental and does not currently guarantee todisable all GCC optimizations that affect signaling NaN behavior.     <br><dt><code>-fsingle-precision-constant</code>     <dd>Treat floating point constant as single precision constant instead ofimplicitly converting it to double precision constant.   </dl>   <p>The following options control optimizations that may improveperformance, but are not enabled by any <code>-O</code> options.  Thissection includes experimental options that may produce broken code.     <dl><dt><code>-fbranch-probabilities</code>     <dd>After running a program compiled with <code>-fprofile-arcs</code>(see <a href="Debugging-Options.html#Debugging%20Options">Options for Debugging Your Program or <code>gcc</code></a>), you can compile it a second time using<code>-fbranch-probabilities</code>, to improve optimizations based onthe number of times each branch was taken.  When the programcompiled with <code>-fprofile-arcs</code> exits it saves arc executioncounts to a file called <code></code><var>sourcename</var><code>.gcda</code> for each sourcefile  The information in this data file is very dependent on thestructure of the generated code, so you must use the same source codeand the same optimization options for both compilations.     <p>With <code>-fbranch-probabilities</code>, GCC puts a<code>REG_BR_PROB</code> note on each <code>JUMP_INSN</code> and <code>CALL_INSN</code>. These can be used to improve optimization.  Currently, they are onlyused in one place: in <code>reorg.c</code>, instead of guessing which path abranch is mostly to take, the <code>REG_BR_PROB</code> values are used toexactly determine which path is taken more often.     <br><dt><code>-fprofile-values</code>     <dd>If combined with <code>-fprofile-arcs</code>, it adds code so that somedata about values of expressions in the program is gathered.     <p>With <code>-fbranch-probabilities</code>, it reads back the data gatheredfrom profiling values of expressions and adds <code>REG_VALUE_PROFILE</code>notes to instructions for their later usage in optimizations.     <p>Enabled with <code>-fprofile-generate</code> and <code>-fprofile-use</code>.     <br><dt><code>-fvpt</code>     <dd>If combined with <code>-fprofile-arcs</code>, it instructs the compiler to adda code to gather information about values of expressions.     <p>With <code>-fbranch-probabilities</code>, it reads back the data gatheredand actually performs the optimizations based on them. Currently the optimizations include specialization of division operationusing the knowledge about the value of the denominator.     <p>Enabled with <code>-fprofile-generate</code> and <code>-fprofile-use</code>.     <br><dt><code>-frename-registers</code>     <dd>Attempt to avoid false dependencies in scheduled code by making useof registers left over after register allocation.  This optimizationwill most benefit processors with lots of registers.  Depending on thedebug information format adopted by the target, however, it canmake debugging impossible, since variables will no longer stay ina "home register".     <p>Not enabled by default at any level because it has known bugs.     <br><dt><code>-fnew-ra</code>     <dd>Use a graph coloring register allocator.  Currently this option is meantfor testing, so we are interested to hear about miscompilations with<code>-fnew-ra</code>.     <br><dt><code>-ftracer</code>     <dd>Perform tail duplication to enlarge superblock size. This transformationsimplifies the control flow of the function allowing other optimizations to dobetter job.     <p>Enabled with <code>-fprofile-use</code>.     <br><dt><code>-funroll-loops</code>     <dd>Unroll loops whose number of iterations can be determined at compile time orupon entry to the loop.  <code>-funroll-loops</code> implies<code>-frerun-cse-after-loop</code>.  It also turns on complete loop peeling(i.e. complete removal of loops with small constant number of iterations). This option makes code larger, and may or may not make it run faster.     <p>Enabled with <code>-fprofile-use</code>.     <br><dt><code>-funroll-all-loops</code>     <dd>Unroll all loops, even if their number of iterations is uncertain whenthe loop is entered.  This usually makes programs run more slowly. <code>-funroll-all-loops</code> implies the same options as<code>-funroll-loops</code>.     <br><dt><code>-fpeel-loops</code>     <dd>Peels the loops for that there is enough information that they do notroll much (from profile feedback).  It also turns on complete loop peeling(i.e. complete removal of loops with small constant number of iterations).     <p>Enabled with <code>-fprofile-use</code>.     <br><dt><code>-funswitch-loops</code>     <dd>Move branches with loop invariant conditions out of the loop, with duplicatesof the loop on both branches (modified according to result of the condition).     <br><dt><code>-fold-unroll-loops</code>     <dd>Unroll loops whose number of iterations can be determined at compiletime or upon entry to the loop, using the old loop unroller whose looprecognition is based on notes from frontend.  <code>-fold-unroll-loops</code> impliesboth <code>-fstrength-reduce</code> and <code>-frerun-cse-after-loop</code>.  Thisoption makes code larger, and may or may not make it run faster.     <br><dt><code>-fold-unroll-all-loops</code>     <dd>Unroll all loops, even if their number of iterations is uncertain whenthe loop is entered. This is done using the old loop unroller whose looprecognition is based on notes from frontend.  This usually makes programs run more slowly. <code>-fold-unroll-all-loops</code> implies the same options as<code>-fold-unroll-loops</code>.     <br><dt><code>-fprefetch-loop-arrays</code>     <dd>If supported by the target machine, generate instructions to prefetchmemory to improve the performance of loops that access large arrays.     <p>Disabled at level <code>-Os</code>.     <br><dt><code>-ffunction-sections</code>     <dd><dt><code>-fdata-sections</code>     <dd>Place each function or data item into its own section in the outputfile if the target supports arbitrary sections.  The name of thefunction or the name of the data item determines the section's namein the output file.     <p>Use these options on systems where the linker can perform optimizationsto improve locality of reference in the instruction space.  Most systemsusing the ELF object format and SPARC processors running Solaris 2 havelinkers with such optimizations.  AIX may have these optimizations inthe future.     <p>Only use these options when there are significant benefits from doing

⌨️ 快捷键说明

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