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

            Bug ID: 89263
           Summary: Simplify bool expression to OR
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: david.bolvansky at gmail dot com
  Target Milestone: ---

bool foo(bool a, bool b)
{
    if (a)
        return true;
    return b;   
}

Current:
foo(bool, bool):
        test    dil, dil
        mov     eax, esi
        cmovne  eax, edi
        ret

Better:
foo(bool, bool):
  mov eax, edi
  or eax, esi
  ret

Reply via email to