lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <de8d50360802170145u4bd60f76x9662b66c63bdf41d@mail.gmail.com>
Date:	Sun, 17 Feb 2008 01:45:23 -0800
From:	"Andrew Pinski" <pinskia@...il.com>
To:	"Willy Tarreau" <w@....eu>
Cc:	"Arjan van de Ven" <arjan@...radead.org>, linuxppc-dev@...abs.org,
	"Roel Kluin" <12o3l@...cali.nl>, cbe-oss-dev@...abs.org,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [Cbe-oss-dev] [PATCH 1/3] Fix Unlikely(x) == y

On Feb 16, 2008 9:58 AM, Willy Tarreau <w@....eu> wrote:
> Last but not least, gcc 4 tends to emit stupid checks, to the point that I
> have replaced unlikely(x) with (x) in my code when gcc >= 4 is detected. What
> I observe is that the following code :
>
>     if (unlikely(p == NULL)) ...
>
> often gets coded like this :
>
>     reg1 = (p == NULL)
>     if (reg1 != 0) ...
>
> ... which clobbers reg1 for nothing and performs a double test.

This really only can happen in GCC 4.0.x and 4.1.x and cannot happen
for 4.2 or 4.3 really because of the way __builtin_expect is handled
for those two.

-- Pinski
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ