aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorJames E Wilson <wilson@specifixinc.com>2004-11-05 21:38:33 +0000
committerJim Wilson <wilson@gcc.gnu.org>2004-11-05 13:38:33 -0800
commitddd8e3ca2625ef3a1d15c363b79d02e9395b109a (patch)
treea996ed86e9009ed6efba820c24b382189842e22d /gcc/doc
parentea595d4ff3ce2b7ac10ceb665abd22bead716217 (diff)
downloadgcc-ddd8e3ca2625ef3a1d15c363b79d02e9395b109a.zip
gcc-ddd8e3ca2625ef3a1d15c363b79d02e9395b109a.tar.gz
gcc-ddd8e3ca2625ef3a1d15c363b79d02e9395b109a.tar.bz2
Stop staying that -fno-guess-branch-probability produces random code changes.
* invoke.texi (-fno-guess-branch-probability): Rewrite. From-SVN: r90144
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/invoke.texi24
1 files changed, 11 insertions, 13 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index eac209e..d6391dd 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -4758,19 +4758,17 @@ other, a few use both.
@item -fno-guess-branch-probability
@opindex fno-guess-branch-probability
-Do not guess branch probabilities using a randomized model.
-
-Sometimes GCC will opt to use a randomized model to guess branch
-probabilities, when none are available from either profiling feedback
-(@option{-fprofile-arcs}) or @samp{__builtin_expect}. This means that
-different runs of the compiler on the same program may produce different
-object code.
-
-In a hard real-time system, people don't want different runs of the
-compiler to produce code that has different behavior; minimizing
-non-determinism is of paramount import. This switch allows users to
-reduce non-determinism, possibly at the expense of inferior
-optimization.
+Do not guess branch probabilities using heuristics.
+
+GCC will use heuristics to guess branch probabilities if they are
+not provided by profiling feedback (@option{-fprofile-arcs}). These
+heuristics are based on the control flow graph. If some branch probabilities
+are specified by @samp{__builtin_expect}, then the heuristics will be
+used to guess branch probabilities for the rest of the control flow graph,
+taking the @samp{__builtin_expect} info into account. The interactions
+between the heuristics and @samp{__builtin_expect} can be complex, and in
+some cases, it may be useful to disable the heuristics so that the effects
+of @samp{__builtin_expect} are easier to understand.
The default is @option{-fguess-branch-probability} at levels
@option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.