OSDN Git Service

Stop staying that -fno-guess-branch-probability produces random code changes.
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Nov 2004 21:38:33 +0000 (21:38 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Nov 2004 21:38:33 +0000 (21:38 +0000)
* invoke.texi (-fno-guess-branch-probability): Rewrite.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90144 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/doc/invoke.texi

index bc62235..a1a60e7 100644 (file)
@@ -1,5 +1,7 @@
 2004-11-05  James E Wilson  <wilson@specifixinc.com>
 
 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.
 
        * config/ia64/ia64.c (rtx_needs_barrier, case UNSPEC_GR_SPILL): Change
        1 to UNSPEC_GR_SPILL.
 
index eac209e..d6391dd 100644 (file)
@@ -4758,19 +4758,17 @@ other, a few use both.
 
 @item -fno-guess-branch-probability
 @opindex fno-guess-branch-probability
 
 @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}.
 
 The default is @option{-fguess-branch-probability} at levels
 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.