This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/56719] New: missed optimization: i > 0xffff || i*4 > 0xffff
- From: "felix-gcc at fefe dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 25 Mar 2013 11:27:43 +0000
- Subject: [Bug rtl-optimization/56719] New: missed optimization: i > 0xffff || i*4 > 0xffff
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56719
Bug #: 56719
Summary: missed optimization: i > 0xffff || i*4 > 0xffff
Classification: Unclassified
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: felix-gcc@fefe.de
This is the test code:
int foo(unsigned int i) {
if (i > 0xffff || i*4 > 0xffff)
baz();
}
gcc -O2 generates a cmp, a shift, and another cmp.
Why does this not generate a single cmp with 0x3fff?