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

            Bug ID: 67975
           Summary: Failure to optimise equality between two call
                    sequences
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rsandifo at gcc dot gnu.org
  Target Milestone: ---

We don't simplify the following test to "return 1", even with fast
math enabled:

int
f1 (double x, double y)
{
  double z1 = __builtin_cos(y<10 ? x : __builtin_tan(x<20 ? x : y));
  double z2 = __builtin_cos(y<10 ? x : __builtin_tan(x<20 ? x : y));
  return z1 == z2;
}

whereas we do for:

int
f1 (double x, double y)
{
  return (__builtin_cos(y<10 ? x : __builtin_tan(x<20 ? x : y))
          == __builtin_cos(y<10 ? x : __builtin_tan(x<20 ? x : y)));
}

Reply via email to