Re: Linux 2.4.10-pre11 -- __builtin_expect

James Antill
2001-10-08T06:20:35Z

Richard Henderson <rth@twiddle.net> writes:

> On Thu, Sep 27, 2001 at 06:28:08PM +0200, Andreas Schwab wrote:
> > You're right, seems like __builtin_expect is really only defined for pure
> > boolean values.
>
> I think the documentation mentions the current deficiency in that area.
> It is _supposed_ to be defined for all integral and pointer types, but
> that is hard with the current built-in infrastructure in the C front end.

The documentation in the info files doesn't suggest that, in fact it
says...

Since you are limited to integral expressions for EXP, you should
use constructions such as

if (__builtin_expect (ptr != NULL, 1))
error ();

when testing pointer or floating-point values.

--
# James Antill -- james@and.org
:0:
* ^From: .*james@and\.org
/dev/null