From ddd8e3ca2625ef3a1d15c363b79d02e9395b109a Mon Sep 17 00:00:00 2001 From: James E Wilson Date: Fri, 5 Nov 2004 21:38:33 +0000 Subject: [PATCH] Stop staying that -fno-guess-branch-probability produces random code changes. * invoke.texi (-fno-guess-branch-probability): Rewrite. From-SVN: r90144 --- gcc/ChangeLog | 2 ++ gcc/doc/invoke.texi | 24 +++++++++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bc62235..a1a60e7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,7 @@ 2004-11-05 James E Wilson + * invoke.texi (-fno-guess-branch-probability): Rewrite. + * config/ia64/ia64.c (rtx_needs_barrier, case UNSPEC_GR_SPILL): Change 1 to UNSPEC_GR_SPILL. 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}. -- 2.7.4