http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52345

             Bug #: 52345
           Summary: Missed optimization dealing with bools
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: pins...@gcc.gnu.org


Take the following three functions:
int f(int a, int b)
{
  int c = a != 0;
  int d = (c!=0|b!=0);
  return d;
}

int f1(int a, int b)
{
  int c = a != 0;
  int e = c!=0;
  int h = b!=0;
  int d = e|h;
  return d;
}

int f2(int a, int b)
{
  return (a!=0|b!=0);
}

--- CUT ---
Right now only f2 produces good code while the other two are not so good.

Reply via email to