This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Is this a bad pointer bug?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]