Commit 38df970e by Jerry Quinn Committed by Gerald Pfeifer

invoke.texi (Optimization Options): List -O levels for each optimization flag.

	* gcc/doc/invoke.texi (Optimization Options): List -O levels
	for each optimization flag.

From-SVN: r61704
parent dff23a65
2003-01-24 Jerry Quinn <jlquinn@optonline.net>
* gcc/doc/invoke.texi (Optimization Options): List -O levels
for each optimization flag.
2003-01-24 Kazu Hirata <kazu@cs.umass.edu> 2003-01-24 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.md (*andsi3_ashift_n_lower): New. * config/h8300/h8300.md (*andsi3_ashift_n_lower): New.
......
...@@ -3557,13 +3557,17 @@ returns. For machines which must pop arguments after a function call, ...@@ -3557,13 +3557,17 @@ returns. For machines which must pop arguments after a function call,
the compiler normally lets arguments accumulate on the stack for several the compiler normally lets arguments accumulate on the stack for several
function calls and pops them all at once. function calls and pops them all at once.
Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
@item -fforce-mem @item -fforce-mem
@opindex fforce-mem @opindex fforce-mem
Force memory operands to be copied into registers before doing Force memory operands to be copied into registers before doing
arithmetic on them. This produces better code by making all memory arithmetic on them. This produces better code by making all memory
references potential common subexpressions. When they are not common references potential common subexpressions. When they are not common
subexpressions, instruction combination should eliminate the separate subexpressions, instruction combination should eliminate the separate
register-load. The @option{-O2} option turns on this option. register-load.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
@item -fforce-addr @item -fforce-addr
@opindex fforce-addr @opindex fforce-addr
...@@ -3586,10 +3590,14 @@ machine-description macro @code{FRAME_POINTER_REQUIRED} controls ...@@ -3586,10 +3590,14 @@ machine-description macro @code{FRAME_POINTER_REQUIRED} controls
whether a target machine supports this flag. @xref{Registers,,Register whether a target machine supports this flag. @xref{Registers,,Register
Usage, gccint, GNU Compiler Collection (GCC) Internals}. Usage, gccint, GNU Compiler Collection (GCC) Internals}.
Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
@item -foptimize-sibling-calls @item -foptimize-sibling-calls
@opindex foptimize-sibling-calls @opindex foptimize-sibling-calls
Optimize sibling and tail recursive calls. Optimize sibling and tail recursive calls.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
@item -ftrapv @item -ftrapv
@opindex ftrapv @opindex ftrapv
This option generates traps for signed overflow on addition, subtraction, This option generates traps for signed overflow on addition, subtraction,
...@@ -3611,6 +3619,8 @@ If all calls to a given function are integrated, and the function is ...@@ -3611,6 +3619,8 @@ If all calls to a given function are integrated, and the function is
declared @code{static}, then the function is normally not output as declared @code{static}, then the function is normally not output as
assembler code in its own right. assembler code in its own right.
Enabled at level @option{-O3}.
@item -finline-limit=@var{n} @item -finline-limit=@var{n}
@opindex finline-limit @opindex finline-limit
By default, gcc limits the size of functions that can be inlined. This flag By default, gcc limits the size of functions that can be inlined. This flag
...@@ -3654,6 +3664,8 @@ This option is the default for optimized compilation if the assembler and ...@@ -3654,6 +3664,8 @@ This option is the default for optimized compilation if the assembler and
linker support it. Use @option{-fno-merge-constants} to inhibit this linker support it. Use @option{-fno-merge-constants} to inhibit this
behavior. behavior.
Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
@item -fmerge-all-constants @item -fmerge-all-constants
Attempt to merge identical constants and identical variables. Attempt to merge identical constants and identical variables.
...@@ -3678,6 +3690,9 @@ register, compare it against zero, then branch based upon the result. ...@@ -3678,6 +3690,9 @@ register, compare it against zero, then branch based upon the result.
This option is only meaningful on architectures that support such This option is only meaningful on architectures that support such
instructions, which include x86, PowerPC, IA-64 and S/390. instructions, which include x86, PowerPC, IA-64 and S/390.
The default is @option{-fbranch-count-reg}, enabled when
@option{-fstrength-reduce} is enabled.
@item -fno-function-cse @item -fno-function-cse
@opindex fno-function-cse @opindex fno-function-cse
Do not put function addresses in registers; make each instruction that Do not put function addresses in registers; make each instruction that
...@@ -3687,6 +3702,8 @@ This option results in less efficient code, but some strange hacks ...@@ -3687,6 +3702,8 @@ This option results in less efficient code, but some strange hacks
that alter the assembler output may be confused by the optimizations that alter the assembler output may be confused by the optimizations
performed when this option is not used. performed when this option is not used.
The default is @option{-ffunction-cse}
@item -ffast-math @item -ffast-math
@opindex ffast-math @opindex ffast-math
Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @* Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
...@@ -3795,6 +3812,8 @@ this option defaults to true and false respectively. ...@@ -3795,6 +3812,8 @@ this option defaults to true and false respectively.
Perform the optimizations of loop strength reduction and Perform the optimizations of loop strength reduction and
elimination of iteration variables. elimination of iteration variables.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
@item -fthread-jumps @item -fthread-jumps
@opindex fthread-jumps @opindex fthread-jumps
Perform optimizations where we check to see if a jump branches to a Perform optimizations where we check to see if a jump branches to a
...@@ -3803,6 +3822,8 @@ so, the first branch is redirected to either the destination of the ...@@ -3803,6 +3822,8 @@ so, the first branch is redirected to either the destination of the
second branch or a point immediately following it, depending on whether second branch or a point immediately following it, depending on whether
the condition is known to be true or false. the condition is known to be true or false.
Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
@item -fcse-follow-jumps @item -fcse-follow-jumps
@opindex fcse-follow-jumps @opindex fcse-follow-jumps
In common subexpression elimination, scan through jump instructions In common subexpression elimination, scan through jump instructions
...@@ -3811,6 +3832,8 @@ example, when CSE encounters an @code{if} statement with an ...@@ -3811,6 +3832,8 @@ example, when CSE encounters an @code{if} statement with an
@code{else} clause, CSE will follow the jump when the condition @code{else} clause, CSE will follow the jump when the condition
tested is false. tested is false.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
@item -fcse-skip-blocks @item -fcse-skip-blocks
@opindex fcse-skip-blocks @opindex fcse-skip-blocks
This is similar to @option{-fcse-follow-jumps}, but causes CSE to This is similar to @option{-fcse-follow-jumps}, but causes CSE to
...@@ -3819,15 +3842,21 @@ encounters a simple @code{if} statement with no else clause, ...@@ -3819,15 +3842,21 @@ encounters a simple @code{if} statement with no else clause,
@option{-fcse-skip-blocks} causes CSE to follow the jump around the @option{-fcse-skip-blocks} causes CSE to follow the jump around the
body of the @code{if}. body of the @code{if}.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
@item -frerun-cse-after-loop @item -frerun-cse-after-loop
@opindex frerun-cse-after-loop @opindex frerun-cse-after-loop
Re-run common subexpression elimination after loop optimizations has been Re-run common subexpression elimination after loop optimizations has been
performed. performed.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
@item -frerun-loop-opt @item -frerun-loop-opt
@opindex frerun-loop-opt @opindex frerun-loop-opt
Run the loop optimizer twice. Run the loop optimizer twice.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
@item -fgcse @item -fgcse
@opindex fgcse @opindex fgcse
Perform a global common subexpression elimination pass. Perform a global common subexpression elimination pass.
...@@ -3838,6 +3867,8 @@ extension, you may get better runtime performance if you disable ...@@ -3838,6 +3867,8 @@ extension, you may get better runtime performance if you disable
the global common subexpression elimination pass by adding the global common subexpression elimination pass by adding
@option{-fno-gcse} to the command line. @option{-fno-gcse} to the command line.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
@item -fgcse-lm @item -fgcse-lm
@opindex fgcse-lm @opindex fgcse-lm
When @option{-fgcse-lm} is enabled, global common subexpression elimination will When @option{-fgcse-lm} is enabled, global common subexpression elimination will
...@@ -3845,6 +3876,8 @@ attempt to move loads which are only killed by stores into themselves. This ...@@ -3845,6 +3876,8 @@ attempt to move loads which are only killed by stores into themselves. This
allows a loop containing a load/store sequence to be changed to a load outside allows a loop containing a load/store sequence to be changed to a load outside
the loop, and a copy/store within the loop. the loop, and a copy/store within the loop.
Enabled by default when gcse is enabled.
@item -fgcse-sm @item -fgcse-sm
@opindex fgcse-sm @opindex fgcse-sm
When @option{-fgcse-sm} is enabled, A store motion pass is run after global common When @option{-fgcse-sm} is enabled, A store motion pass is run after global common
...@@ -3852,17 +3885,23 @@ subexpression elimination. This pass will attempt to move stores out of loops. ...@@ -3852,17 +3885,23 @@ subexpression elimination. This pass will attempt to move stores out of loops.
When used in conjunction with @option{-fgcse-lm}, loops containing a load/store sequence When used in conjunction with @option{-fgcse-lm}, loops containing a load/store sequence
can be changed to a load before the loop and a store after the loop. can be changed to a load before the loop and a store after the loop.
Enabled by default when gcse is enabled.
@item -floop-optimize @item -floop-optimize
@opindex floop-optimize @opindex floop-optimize
Perform loop optimizations: move constant expressions out of loops, simplify Perform loop optimizations: move constant expressions out of loops, simplify
exit test conditions and optionally do strength-reduction and loop unrolling as exit test conditions and optionally do strength-reduction and loop unrolling as
well. well.
Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
@item -fcrossjumping @item -fcrossjumping
@opindex crossjumping @opindex crossjumping
Perform cross-jumping transformation. This transformation unifies equivalent code and save code size. The Perform cross-jumping transformation. This transformation unifies equivalent code and save code size. The
resulting code may or may not perform better than without cross-jumping. resulting code may or may not perform better than without cross-jumping.
Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
@item -fif-conversion @item -fif-conversion
@opindex if-conversion @opindex if-conversion
Attempt to transform conditional jumps into branch-less equivalents. This Attempt to transform conditional jumps into branch-less equivalents. This
...@@ -3870,11 +3909,15 @@ include use of conditional moves, min, max, set flags and abs instructions, and ...@@ -3870,11 +3909,15 @@ include use of conditional moves, min, max, set flags and abs instructions, and
some tricks doable by standard arithmetics. The use of conditional execution some tricks doable by standard arithmetics. The use of conditional execution
on chips where it is available is controlled by @code{if-conversion2}. on chips where it is available is controlled by @code{if-conversion2}.
Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
@item -fif-conversion2 @item -fif-conversion2
@opindex if-conversion2 @opindex if-conversion2
Use conditional execution (where available) to transform conditional jumps into Use conditional execution (where available) to transform conditional jumps into
branch-less equivalents. branch-less equivalents.
Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
@item -fdelete-null-pointer-checks @item -fdelete-null-pointer-checks
@opindex fdelete-null-pointer-checks @opindex fdelete-null-pointer-checks
Use global dataflow analysis to identify and eliminate useless checks Use global dataflow analysis to identify and eliminate useless checks
...@@ -3887,10 +3930,14 @@ safely dereference null pointers. Use ...@@ -3887,10 +3930,14 @@ safely dereference null pointers. Use
@option{-fno-delete-null-pointer-checks} to disable this optimization @option{-fno-delete-null-pointer-checks} to disable this optimization
for programs which depend on that behavior. for programs which depend on that behavior.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
@item -fexpensive-optimizations @item -fexpensive-optimizations
@opindex fexpensive-optimizations @opindex fexpensive-optimizations
Perform a number of minor optimizations that are relatively expensive. Perform a number of minor optimizations that are relatively expensive.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
@item -foptimize-register-move @item -foptimize-register-move
@itemx -fregmove @itemx -fregmove
@opindex foptimize-register-move @opindex foptimize-register-move
...@@ -3898,18 +3945,21 @@ Perform a number of minor optimizations that are relatively expensive. ...@@ -3898,18 +3945,21 @@ Perform a number of minor optimizations that are relatively expensive.
Attempt to reassign register numbers in move instructions and as Attempt to reassign register numbers in move instructions and as
operands of other simple instructions in order to maximize the amount of operands of other simple instructions in order to maximize the amount of
register tying. This is especially helpful on machines with two-operand register tying. This is especially helpful on machines with two-operand
instructions. GCC enables this optimization by default with @option{-O2} instructions.
or higher.
Note @option{-fregmove} and @option{-foptimize-register-move} are the same Note @option{-fregmove} and @option{-foptimize-register-move} are the same
optimization. optimization.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
@item -fdelayed-branch @item -fdelayed-branch
@opindex fdelayed-branch @opindex fdelayed-branch
If supported for the target machine, attempt to reorder instructions If supported for the target machine, attempt to reorder instructions
to exploit instruction slots available after delayed branch to exploit instruction slots available after delayed branch
instructions. instructions.
Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
@item -fschedule-insns @item -fschedule-insns
@opindex fschedule-insns @opindex fschedule-insns
If supported for the target machine, attempt to reorder instructions to If supported for the target machine, attempt to reorder instructions to
...@@ -3918,6 +3968,8 @@ helps machines that have slow floating point or memory load instructions ...@@ -3918,6 +3968,8 @@ helps machines that have slow floating point or memory load instructions
by allowing other instructions to be issued until the result of the load by allowing other instructions to be issued until the result of the load
or floating point instruction is required. or floating point instruction is required.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
@item -fschedule-insns2 @item -fschedule-insns2
@opindex fschedule-insns2 @opindex fschedule-insns2
Similar to @option{-fschedule-insns}, but requests an additional pass of Similar to @option{-fschedule-insns}, but requests an additional pass of
...@@ -3925,6 +3977,8 @@ instruction scheduling after register allocation has been done. This is ...@@ -3925,6 +3977,8 @@ instruction scheduling after register allocation has been done. This is
especially useful on machines with a relatively small number of especially useful on machines with a relatively small number of
registers and where memory load instructions take more than one cycle. registers and where memory load instructions take more than one cycle.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
@item -fno-sched-interblock @item -fno-sched-interblock
@opindex fno-sched-interblock @opindex fno-sched-interblock
Don't schedule instructions across basic blocks. This is normally Don't schedule instructions across basic blocks. This is normally
...@@ -3981,8 +4035,7 @@ seems to result in better code than would otherwise be produced. ...@@ -3981,8 +4035,7 @@ seems to result in better code than would otherwise be produced.
This option is always enabled by default on certain machines, usually This option is always enabled by default on certain machines, usually
those which have no call-preserved registers to use instead. those which have no call-preserved registers to use instead.
For all machines, optimization level 2 and higher enables this flag by Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
default.
@item -ftracer @item -ftracer
@opindex ftracer @opindex ftracer
...@@ -4009,6 +4062,8 @@ the loop is entered. This usually makes programs run more slowly. ...@@ -4009,6 +4062,8 @@ the loop is entered. This usually makes programs run more slowly.
If supported by the target machine, generate instructions to prefetch If supported by the target machine, generate instructions to prefetch
memory to improve the performance of loops that access large arrays. memory to improve the performance of loops that access large arrays.
Disabled at level @option{-Os}.
@item -fmove-all-movables @item -fmove-all-movables
@opindex fmove-all-movables @opindex fmove-all-movables
Forces all invariant computations in loops to be moved Forces all invariant computations in loops to be moved
...@@ -4045,6 +4100,9 @@ between @option{-fno-peephole} and @option{-fno-peephole2} is in how they ...@@ -4045,6 +4100,9 @@ between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
are implemented in the compiler; some targets use one, some use the are implemented in the compiler; some targets use one, some use the
other, a few use both. other, a few use both.
@option{-fpeephole} is enabled by default.
@option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
@item -fbranch-probabilities @item -fbranch-probabilities
@opindex fbranch-probabilities @opindex fbranch-probabilities
After running a program compiled with @option{-fprofile-arcs} After running a program compiled with @option{-fprofile-arcs}
...@@ -4082,11 +4140,16 @@ non-determinism is of paramount import. This switch allows users to ...@@ -4082,11 +4140,16 @@ non-determinism is of paramount import. This switch allows users to
reduce non-determinism, possibly at the expense of inferior reduce non-determinism, possibly at the expense of inferior
optimization. optimization.
The default is @option{-fguess-branch-probability} at levels
@option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
@item -freorder-blocks @item -freorder-blocks
@opindex freorder-blocks @opindex freorder-blocks
Reorder basic blocks in the compiled function in order to reduce number of Reorder basic blocks in the compiled function in order to reduce number of
taken branches and improve code locality. taken branches and improve code locality.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
@item -freorder-functions @item -freorder-functions
@opindex freorder-functions @opindex freorder-functions
Reorder basic blocks in the compiled function in order to reduce number of Reorder basic blocks in the compiled function in order to reduce number of
...@@ -4099,6 +4162,8 @@ place them in a reasonable way. ...@@ -4099,6 +4162,8 @@ place them in a reasonable way.
Also profile feedback must be available in to make this option effective. See Also profile feedback must be available in to make this option effective. See
@option{-fprofile-arcs} for details. @option{-fprofile-arcs} for details.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
@item -fstrict-aliasing @item -fstrict-aliasing
@opindex fstrict-aliasing @opindex fstrict-aliasing
Allows the compiler to assume the strictest aliasing rules applicable to Allows the compiler to assume the strictest aliasing rules applicable to
...@@ -4144,8 +4209,7 @@ node, an alias set for the node. Nodes in different alias sets are not ...@@ -4144,8 +4209,7 @@ node, an alias set for the node. Nodes in different alias sets are not
allowed to alias. For an example, see the C front-end function allowed to alias. For an example, see the C front-end function
@code{c_get_alias_set}. @code{c_get_alias_set}.
For all machines, optimization level 2 and higher enables this flag by Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
default.
@item -falign-functions @item -falign-functions
@itemx -falign-functions=@var{n} @itemx -falign-functions=@var{n}
...@@ -4164,6 +4228,8 @@ in that case, it is rounded up. ...@@ -4164,6 +4228,8 @@ in that case, it is rounded up.
If @var{n} is not specified, use a machine-dependent default. If @var{n} is not specified, use a machine-dependent default.
Enabled at levels @option{-O2}, @option{-O3}.
@item -falign-labels @item -falign-labels
@itemx -falign-labels=@var{n} @itemx -falign-labels=@var{n}
@opindex falign-labels @opindex falign-labels
...@@ -4178,6 +4244,8 @@ are greater than this value, then their values are used instead. ...@@ -4178,6 +4244,8 @@ are greater than this value, then their values are used instead.
If @var{n} is not specified, use a machine-dependent default which is If @var{n} is not specified, use a machine-dependent default which is
very likely to be @samp{1}, meaning no alignment. very likely to be @samp{1}, meaning no alignment.
Enabled at levels @option{-O2}, @option{-O3}.
@item -falign-loops @item -falign-loops
@itemx -falign-loops=@var{n} @itemx -falign-loops=@var{n}
@opindex falign-loops @opindex falign-loops
...@@ -4188,6 +4256,8 @@ operations. ...@@ -4188,6 +4256,8 @@ operations.
If @var{n} is not specified, use a machine-dependent default. If @var{n} is not specified, use a machine-dependent default.
Enabled at levels @option{-O2}, @option{-O3}.
@item -falign-jumps @item -falign-jumps
@itemx -falign-jumps=@var{n} @itemx -falign-jumps=@var{n}
@opindex falign-jumps @opindex falign-jumps
...@@ -4198,6 +4268,8 @@ need be executed. ...@@ -4198,6 +4268,8 @@ need be executed.
If @var{n} is not specified, use a machine-dependent default. If @var{n} is not specified, use a machine-dependent default.
Enabled at levels @option{-O2}, @option{-O3}.
@item -fssa @item -fssa
@opindex fssa @opindex fssa
Perform optimizations in static single assignment form. Each function's Perform optimizations in static single assignment form. Each function's
...@@ -4228,12 +4300,16 @@ will most benefit processors with lots of registers. It can, however, ...@@ -4228,12 +4300,16 @@ will most benefit processors with lots of registers. It can, however,
make debugging impossible, since variables will no longer stay in make debugging impossible, since variables will no longer stay in
a ``home register''. a ``home register''.
Enabled at levels @option{-O3}.
@item -fno-cprop-registers @item -fno-cprop-registers
@opindex fno-cprop-registers @opindex fno-cprop-registers
After register allocation and post-register allocation instruction splitting, After register allocation and post-register allocation instruction splitting,
we perform a copy-propagation pass to try to reduce scheduling dependencies we perform a copy-propagation pass to try to reduce scheduling dependencies
and occasionally eliminate the copy. and occasionally eliminate the copy.
Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
@item --param @var{name}=@var{value} @item --param @var{name}=@var{value}
@opindex param @opindex param
In some places, GCC uses various constants to control the amount of In some places, GCC uses various constants to control the amount of
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment