This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/52345] New: Missed optimization dealing with bools


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: unassigned@gcc.gnu.org
        ReportedBy: pinskia@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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]