On Thu, May 16, 2002 at 02:42:34AM +0900, Akinori MUSHA wrote:
> I observed gcc 2.95.4 and gcc 3.1 interpret (or maybe optimize) the
> following code differently (CFLAGS=-O):
>
> int main(void)
> {
> unsigned char i = 127;
> printf("%d\n", ((char)(i << 1)) / 2);
> return 0;
> }
I think GCC 3.1 does a logical right shift by one to
optimize the division by two instead of an arithmetic
right shift.
ciao,
-robert
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message