Is this a bad pointer bug?

Joe Buck jbuck@synopsys.com
Fri Jul 18 18:21:00 GMT 2003


On Fri, Jul 18, 2003 at 09:46:55AM -0700, Joe Buck wrote:
> So, if the size of the struct is 44, we need to compute (diff/44) mod
> 2**32 on a 32-bit machine.  The first operation is a shift by two, so
> we compute (diff_shift/11) mod 2**32.  We compute the inverse of 11
> at compile time, giving a constant C such that C*11 mod 32 is 1. 

That should be C*11 mod 2**32.  Also in case it isn't obvious, the
mod 2**32 is free, we get it from the wraparound for unsigned multiplication.



More information about the Gcc mailing list