https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113227

            Bug ID: 113227
           Summary: Maybe optimization (a>0) && (b>0) with or&<0
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: syq at gcc dot gnu.org
  Target Milestone: ---

_Bool f (int a, int b) {
        return a > 0 && b > 0;
}


_Bool f (int a, int b)
{
  _Bool _1;
  _Bool _6;
  _Bool _7;

  <bb 2> [local count: 1073741824]:
  _6 = b_3(D) > 0;
  _7 = a_2(D) > 0;
  _1 = _6 & _7;
  return _1;

}


maybe we can do it like this?

_Bool f (int a, int b)
{
   int _1 = (a | b);
   return ((_1) > 0);
}

Reply via email to