This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/33512] New: Simple bitwise simplification missed
- 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: 20 Sep 2007 22:32:08 -0000
- Subject: [Bug rtl-optimization/33512] New: Simple bitwise simplification missed
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
These two functions should produce the same code:
int f(int y, int x)
{
return x & ((~x) | y);
}
int g(int y, int x)
{
return y & x;
}
x & ((~x) | y) is the same as (x & ~x) | (x & y) using distribution and that
becomes (x & y) because (x & ~x) is always 0 and 0 | x is x.
This should be done at both the tree level and the RTL level.
--
Summary: Simple bitwise simplification missed
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: rtl-optimization
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=33512