This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/23096] Wrong folding for FLOOR_MOD_EXPR
- 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: 27 Jul 2005 16:38:56 -0000
- Subject: [Bug middle-end/23096] Wrong folding for FLOOR_MOD_EXPR
- References: <20050727163608.23096.pinskia@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-27 16:38 -------
>From comment #7 of PR 22348:
extract_muldiv(51 - 7, 3, FLOOR_MOD_EXPR) returns incorrectly 0.
The reason is that 51 - 7 is replaced with 51 + ~6, and both 51 and ~6 are
divisible by 3, so the result obviously is 0 :-) Someone forgot about overflows.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23096