From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754973AbYIFVa0 (ORCPT ); Sat, 6 Sep 2008 17:30:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752492AbYIFVaQ (ORCPT ); Sat, 6 Sep 2008 17:30:16 -0400 Received: from www.tglx.de ([62.245.132.106]:41003 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752269AbYIFVaP (ORCPT ); Sat, 6 Sep 2008 17:30:15 -0400 Date: Sat, 6 Sep 2008 23:30:00 +0200 (CEST) From: Thomas Gleixner To: Linus Torvalds cc: Alok Kataria , Alan Cox , LKML , Arjan van de Veen , "H. Peter Anvin" , Peter Zijlstra , Dan Hecht , Garrett Smith Subject: Re: [RFC patch 0/4] TSC calibration improvements In-Reply-To: Message-ID: References: <20080904160036.GA18382@elte.hu> <20080904190728.59634020@lxorguk.ukuu.org.uk> <20080904204305.GA29065@elte.hu> User-Agent: Alpine 1.10 (LFD 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 6 Sep 2008, Linus Torvalds wrote: > On Sat, 6 Sep 2008, Thomas Gleixner wrote: > > > > One gcc does: > > > > i++; > > if (i >= QUICK_PIT_ITERATIONS) > > goto out; > > expect--; > > > > The other one does: > > > > i++; > > expect--; > > if (i >= QUICK_PIT_ITERATIONS) > > goto out; > > > > Don't ask me which one is correct. It's just reality :( > > Show me. Because I simply don't believe you. > > The first code is simply _wrong_ - except if "expect" isn't even _used_ > afterwards (in which case gcc can optimize away the last unused write). > > And I strongly suspect that that is what you've seen. > > Because quite frankly, if what you describe is real, then your gcc is > incredibly buggy. So buggy that it sounds unlikely to be able to compile > the kernel in many other places. This is very simple and very fundamental > C, not something subtle or even half-way undefined. Just checked, yes you are right. I messed that up in my tiredness to see the obvious bug in Ingo's fixup patch. /me resorts to bed tglx