This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/17894] New: [miscompile] div/compare folding incorrect
- From: "sabre at nondot dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Oct 2004 18:58:10 -0000
- Subject: [Bug middle-end/17894] New: [miscompile] div/compare folding incorrect
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
It looks like there is a bug in fold_div_compare. It turns the expression in
this function:
int X(int Y) { return (X/-10) < 1; }
int "Y <= 9", which is incorrect for many X's, including X=20.
-Chris
--
Summary: [miscompile] div/compare folding incorrect
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: middle-end
AssignedTo: sayle at gcc dot gnu dot org
ReportedBy: sabre at nondot dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17894