Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757361AbYBQJpe (ORCPT ); Sun, 17 Feb 2008 04:45:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754112AbYBQJp0 (ORCPT ); Sun, 17 Feb 2008 04:45:26 -0500 Received: from rv-out-0910.google.com ([209.85.198.187]:17539 "EHLO rv-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752764AbYBQJpY (ORCPT ); Sun, 17 Feb 2008 04:45:24 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=BCBN30SUXXkQgBS0LqZpUWosWdIXk20Dtruga8iq4jW9GjXFn9K3tr1IyhcTF4BLQgfhu1XBiqtwJk1EdDMfQdNB7PkAwCWGQQ8an7ay7WCkJu4HPBjTRsXt7L2qD072ENp/oF/tYERbjnUuoz3N289fFdEkvaDM792wqhqZzzg= Message-ID: Date: Sun, 17 Feb 2008 01:45:23 -0800 From: "Andrew Pinski" To: "Willy Tarreau" Subject: Re: [Cbe-oss-dev] [PATCH 1/3] Fix Unlikely(x) == y Cc: "Arjan van de Ven" , linuxppc-dev@ozlabs.org, "Roel Kluin" <12o3l@tiscali.nl>, cbe-oss-dev@ozlabs.org, lkml In-Reply-To: <20080216175849.GA25636@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <47B70A61.9030306@tiscali.nl> <20080216092552.325e5726@laptopd505.fenrus.org> <20080216173315.GU8953@1wt.eu> <20080216094226.1e8eede1@laptopd505.fenrus.org> <20080216175849.GA25636@1wt.eu> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 855 Lines: 24 On Feb 16, 2008 9:58 AM, Willy Tarreau 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/