Re: [BUG FIX] Make x86_32 uni-processor Atomic ops, Atomic
From: H. Peter Anvin
Date: Mon May 25 2009 - 20:07:33 EST
Michael S. Zick wrote:
>
> Load Effective Address does two's complement arithmetic?
> I'll take your word for it.
>
LEA, and all other address calculations use 2's-complement arithmetic:
leal -1(%ebx),%eax
leal 0xffffffff(%ebx),%eax
... is the same instruction.
However, gcc has been known to optimize out range checks when operating
on signed integers; it is allowed to do this by the C standard, but it
can give surprising results if the user expected wraparound.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
--
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/