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: unassig...@gcc.gnu.org

        ReportedBy: felix-...@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?

Reply via email to