[Bug c/26366] __builtin_expect needs better documentation
rguenth at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Feb 21 09:57:00 GMT 2006
------- Comment #4 from rguenth at gcc dot gnu dot org 2006-02-21 09:57 -------
Another way instead of
if(__builtin_expect((__builtin_expect(x,1) && __builtin_expect(y,1)), 0))
would be
if(__builtin_expect(!(x && y), 1))
I'm sure this does _not_ result in same behavior as __builtin_expect is
evaluated
quite late during compilation. Some clarification in the docs would be really
nice.
As to standalone __builtin_expect() calls, they should have no effect. There
was talking about a __builtin_assert() or __builtin_assume() that would force
a known value.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-02-21 09:57:21
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26366
More information about the Gcc-bugs
mailing list