Modulus by constant

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Sun Apr 18 12:13:00 GMT 2004


    Consider a / b where b is an odd number, and it is known that b divides a
    (this case occurs in C pointer subtraction).  

Unfortunately, in this case b doesn't divide a because we're doing modulus.

I understand the general principle: I was wondering if anybody knew the
code well because I suspect this is a "corner" case, being unsigned
and having the constant being multiplied by look negative if it were signed.



More information about the Gcc mailing list