This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Re: __builtin_expect in gettext
- To: Bruno Haible <haible at ilog dot fr>
- Subject: Re: __builtin_expect in gettext
- From: Andreas Jaeger <aj at suse dot de>
- Date: 02 May 2000 15:57:49 +0200
- Cc: libc-alpha at sourceware dot cygnus dot com
- References: <200005021346.PAA28342@oberkampf.ilog.fr>
>>>>> Bruno Haible writes:
> Here is a patch to add __builtin_expect marks to the intl subdirectory.
> ! if (__builtin_expect (newp != NULL, 1)) { \
We don't need to add checks against NULL. The code in gcc should do
this already (from gcc/predict.c):
/* Try "pointer heuristic."
A comparison ptr == 0 is predicted as false.
Similarly, a comparison ptr1 == ptr2 is predicted as false. */
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.rhein-neckar.de