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

            Bug ID: 94898
           Summary: Failure to optimize compare plus sub of same operands
                    into compare
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

bool f(int x, int y)
{
    if (x >= y)
        return x - y;
    return 0;
}

This can be optimized to `x > y`. This transformation is done by LLVM, but not
by GCC

Reply via email to