This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Right-shift bug in egcs-2.91.66
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Re: Right-shift bug in egcs-2.91.66
- From: Timur Tabi <ttabi at interactivesi dot com>
- Date: Fri, 11 May 2001 12:27:14 -0500
- References: <BeNXTC.A.7_E.jQB_6@dinero.interactivesi.com>
** Reply to message from Dale Johannesen <dalej@apple.com> on Fri, 11 May 2001
10:03:06 -0700
> Shifting by the word size is undefined in C/C++ (because the immediate
> shift count field in much popular hardware can only hold 0..31). You
> need to write this as ((test>>31)>>1) or some such.
Ok, everything makes sense now. I had forgotten that x86 only uses the lower 5
bits of the cl register for a 32-bit shift. I apologize for my previous rant.
--
Timur Tabi - ttabi@interactivesi.com
Interactive Silicon - http://www.interactivesi.com