Subject: Re: CVS commit: src/sys/arch/sgimips
To: None <port-mips@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-mips
Date: 10/08/2003 16:38:17
>> int test2(int *p)
>> 	if (((*p >> 16) & 0xffff) == 123)
>> [...ldsh...and...]
>> Interesting that gcc indeed does access it as a halfword but still
>> wants to apply mask.
> it accessed it as a signed halfword.

Yes, but when it's comparing the result to 123, the difference doesn't
matter; any value that compares equal to 123 as an unsigned halfword
will also compare equal as a signed halfword.

Presumably nobody thought to check for such things in the optimizer.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B