[doc,committed] document probability associated with __builtin_expect

Message ID 2ffab1fb-f52a-531c-b791-9accaf1dde43@codesourcery.com
State New
Headers show
  • [doc,committed] document probability associated with __builtin_expect
Related show

Commit Message

Sandra Loosemore Nov. 11, 2018, 6:41 p.m.
I've checked in this patch to fix PR26366, another small but ancient 
documentation bug.



Index: gcc/doc/extend.texi
--- gcc/doc/extend.texi	(revision 266016)
+++ gcc/doc/extend.texi	(working copy)
@@ -12121,6 +12121,12 @@  if (__builtin_expect (ptr != NULL, 1))
 when testing pointer or floating-point values.
+For the purposes of branch prediction optimizations, the probability that
+a @code{__builtin_expect} expression is true is controlled by GCC's
+@code{builtin-expect-probability} parameter, which defaults to 90%.  
+You can also use @code{__builtin_expect_with_probability} to explicitly 
+assign a probability value to individual expressions.
 @end deftypefn
 @deftypefn {Built-in Function} long __builtin_expect_with_probability