Re: [RFC patch 0/4] TSC calibration improvements
From: Thomas Gleixner
Date: Sat Sep 06 2008 - 17:30:28 EST
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/