This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/26366] __builtin_expect needs better documentation
- From: "acahalan at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Feb 2006 03:14:33 -0000
- Subject: [Bug c/26366] __builtin_expect needs better documentation
- References: <bug-26366-12219@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from acahalan at gmail dot com 2006-02-22 03:14 -------
The code in comment #4 really isn't the same as the original. The original is a
decorated version of this:
if(x && y)
It is meant to express that:
x is likely
y is likely
x&&y is unlikely
Here, the probability of x times the probability of y is less than 0.5 even
though the probability of x and the probability of y are both greater than 0.5.
Nothing says that standalone __builtin_expect() calls should have no effect.
This can be much more readable than using the calls in a test.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26366