This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/33779] New: [4.3 Regression] folds unsigned multiplication == 0 to true
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Oct 2007 13:13:36 -0000
- Subject: [Bug middle-end/33779] New: [4.3 Regression] folds unsigned multiplication == 0 to true
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
int foo(int i)
{
if (((unsigned)(i + 1)) * 4 == 0)
return 1;
return 0;
}
extern void abort(void);
int main()
{
if (foo(0x3fffffff) == 0)
abort ();
return 0;
}
This goes wrong in extract_muldiv and is exposed by folding X * C CMP 0 to
X CMP 0 for undefined overflow.
--
Summary: [4.3 Regression] folds unsigned multiplication == 0 to
true
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33779