<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - [NewGVN/PredicateInfo] Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed."
   href="https://bugs.llvm.org/show_bug.cgi?id=34052">34052</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[NewGVN/PredicateInfo] Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
          </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>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Scalar Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>davide@freebsd.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dberlin@dberlin.org, joerg@NetBSD.org, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Joerg ran a full package run on NetBSD (with NewGVN) and that resulted in a
series of crashes. This one is the first, in the objective-c runtime.

I reduced it to the following:

$ ./opt -newgvn tinky.ll
opt: ../include/llvm/Support/Casting.h:255: typename llvm::cast_retty<X,
Y*>::ret_type llvm::cast(Y*) [with X = llvm::Function; Y = llvm::Constant;
typename llvm::cast_retty<X, Y*>::ret_type = llvm::Function*]: Assertion
`isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

$ cat tinky.ll
%0 = type opaque
%2 = type opaque

define void @patatino() {
entry:
  %call10 = call %0* bitcast (i8* (i8*, ...)* @objc_msgSend to %0* (i8*)*)(i8*
null)
  %cmp11 = icmp eq %0* %call10, null
  br i1 %cmp11, label %if.end14, label %if.end14.thread

if.end14.thread:
  %tmp = bitcast %0* %call10 to i8*
  ret void

if.end14:
  ret void
}

declare i8* @objc_msgSend(i8*, ...)
declare %2* @llvm.ssa.copy.p0s_s(%2* returned)</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>