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

            Bug ID: 95185
           Summary: Failure to optimize specific kind of sign comparison
                    check
           Product: gcc
           Version: 11.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: ---

int f(int x, int y)
{
    return (x >= 0) == (y <= 0);
}

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94718 was resolved and most of the
patterns are now optimized, but this specific one isn't. It's equivalent to `(x
< 0) ^ (y <= 0)`, which can be done with a single compare instead of two. That
transformation is made by LLVM, but not by GCC.

Reply via email to