This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/31096] New: a*C == b*C where C is a constant is not optimized to a == b
- 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: 9 Mar 2007 09:01:28 -0000
- Subject: [Bug middle-end/31096] New: a*C == b*C where C is a constant is not optimized to a == b
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following two functions should be equzlivant when overflow is undefined:
int f(int a, int b)
{
return a * 10 == b*10;
}
int f1(int a, int b)
{
return a==b;
}
--
Summary: a*C == b*C where C is a constant is not optimized to a
== b
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31096