This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: disabling branch probability guessing (patch)



  In message <20010115181006.A8129@redhat.com>you write:
  > hi guys.
  > 
  > Here is a patch that adds an option to disable guessing of branch
  > probabilities (-fno-guess-branch-probability).
  > 
  > One of our clients is trying to use __builtin_expect and is getting
  > unexpected results because estimate_probability() in predict.c is 
  > guessing the branch probability in an undetermined way.  This patch
  > solves the problem by providing an option to disable the probability
  > guessing altogether.
Err. umm.  It seems to me like __builtin_expect ought to just override the
guessed probability for any particular branch.  Is there something about
the implementation of branch prediction and __builtin_expect that makes
this hard?

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]