This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/22072] bizarre code for int*int/2
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jun 2005 01:08:16 -0000
- Subject: [Bug middle-end/22072] bizarre code for int*int/2
- References: <20050615060438.22072.felix-gcc@fefe.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-17 01:08 -------
(In reply to comment #8)
> did i miss something in my math?
Yes in C, % (remainder and not mod) is negative iff one of the operands is negative.
so it is -2*2 + -1 = -5. , integer divide in C is truncated.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22072