[llvm-bugs] [Bug 31902] New: [btver2] Fix a crash in combineOrCmpEqZeroToCtlzSrl under fast math

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 8 07:34:42 PST 2017


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: unassignedbugs at nondot.org
          Reporter: pierregousseau14 at gmail.com
                CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170208/3b77398a/attachment.html>


More information about the llvm-bugs mailing list