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

            Bug ID: 93131
           Summary: ((a&8) == 8) && ((a&2) == 2) is not optimized to
                    (a&(8|2)) == *
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

int f(int a)
{
  char b = (a&8) == 8;
  char c = (a&2) == 2;
  char d = (a&4) == 4;
  return b&c&d;
}

int f1(int a)
{
  return (a&(8|2|4)) == (8|2|4);
}

Reply via email to