Re: Runaway cron task on 2.5.63/4 bk?

From: Linus Torvalds (torvalds@transmeta.com)
Date: Tue Mar 11 2003 - 18:46:22 EST


On Tue, 11 Mar 2003, Andrew Morton wrote:
>
> 2.95.3 and 3.2.1 seem to do it right?

Well, they do, but your test case is wrong:

> long a;
> long b;
> long long c;
>
> void foo(void)
> {
> c = a * b;

This is just a 32*32->32 multiply, with a final sign extension to 64 bits.

You need to do

        c = (long long) a * b;

to get a 32*32->64 multiply. And yes, gcc gets that case right.

                Linus

-
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/



This archive was generated by hypermail 2b29 : Sat Mar 15 2003 - 22:00:28 EST