This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Modulus by constant
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: jbuck at welsh-buck dot org
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 18 Apr 04 06:38:34 EDT
- Subject: Re: Modulus by constant
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.