]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Stop staying that -fno-guess-branch-probability produces random code changes.
authorJames E Wilson <wilson@specifixinc.com>
Fri, 5 Nov 2004 21:38:33 +0000 (21:38 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Fri, 5 Nov 2004 21:38:33 +0000 (13:38 -0800)
* invoke.texi (-fno-guess-branch-probability): Rewrite.

From-SVN: r90144

gcc/ChangeLog
gcc/doc/invoke.texi

index bc62235227b59e71195dc4bb66719d7ab8760647..a1a60e7d22ca88a25efc4e91b589213a73d68279 100644 (file)
@@ -1,5 +1,7 @@
 2004-11-05  James E Wilson  <wilson@specifixinc.com>
 
+       * invoke.texi (-fno-guess-branch-probability): Rewrite.
+
        * config/ia64/ia64.c (rtx_needs_barrier, case UNSPEC_GR_SPILL): Change
        1 to UNSPEC_GR_SPILL.
 
index eac209e233ae29c42ce7a7f908258dd078a1737c..d6391dda24dddfc7ffde3dc255021dfd152b8572 100644 (file)
@@ -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}.