<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [btver2] Fix a crash in combineOrCmpEqZeroToCtlzSrl under fast math"
   href="https://llvm.org/bugs/show_bug.cgi?id=31902">31902</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[btver2] Fix a crash in combineOrCmpEqZeroToCtlzSrl under fast math
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>pierregousseau14@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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) {
      }
    }
  }
}

<span class="quote">> clang -ffast-math -march=btver2 -O2 -S</span >

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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>