https://llvm.org/bugs/show_bug.cgi?id=31902

            Bug ID: 31902
           Summary: [btver2] Fix a crash in combineOrCmpEqZeroToCtlzSrl
                    under fast math
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedb...@nondot.org
          Reporter: pierregoussea...@gmail.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

Example:

class C {
  void foo(double*) const;
  int h;
  double y;
  double x;
  double z;
};
void C::foo(double *input) const {
  int i;
  double val;
  double val1 = -1;
  double val2 = z;
  while (x >= 0 && i < h) {
    if (!y) {
      if (input[0] != 0 && val1 < val2) {
      } else {
        i++;
        val = val2;
      }
      if (val) {
      }
    }
  }
}

> clang -ffast-math -march=btver2 -O2 -S

This crashes with the following assertion:
Assertion failed: isa<X>(Val) && "cast<Ty>() argument of incompatible type!"

The problem is caused when isSetCCCandidate is operating on a X86ISD::CMP node
where operands are floating points.

I have a fix for this issue which I plan to send for review.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to