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

            Bug ID: 126535
           Summary: [14/15/16/17 Regression] Wrong code with ranger and
                    islessgreater
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ktkachov at gcc dot gnu.org
  Target Milestone: ---

__attribute__((noipa)) int
g (double x, int i)
{
  double a = (double) ((i & 3) - 1);
  double y = __builtin_sqrt (a);

  if (__builtin_islessgreater (x, y))   /* x LTGT y; the false edge is UNEQ */
    return 3;
  if (x > 100.0)
    return 1;
  return 2;
}

int
main (void)
{
  if (g (1e9, 0) != 1)
    __builtin_abort ();
  return 0;
}

aborts on aarch64 at -O2 -lm and passes with -O0

Reply via email to