<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 - opt crashes with "opt -O2 -attributor-enable=cgscc ": Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed."
   href="https://bugs.llvm.org/show_bug.cgi?id=49545">49545</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>opt crashes with "opt -O2 -attributor-enable=cgscc ":  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>Interprocedural Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>zequanwu@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ cat reduced.ll
target datalayout =
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

define hidden void @f1() align 2 {
entry:
  call void @f2()
  ret void
}

define linkonce_odr hidden void @f2() unnamed_addr align 2 {
entry:
  call void @f3()
  ret void
}

define linkonce_odr hidden void @f3() unnamed_addr align 2 {
entry:
  call void @f4()
  ret void
}

define available_externally void @f4() align 2   {
entry:
  br label %if.end

if.end:                                           ; preds = %entry
  br label %if.else

if.else:                                          ; preds = %if.end
  %call7 = call i8* @f5()
  ret void
}

define linkonce_odr hidden i8* @f5() align 2     {
entry:
  %call = call i8* @f6()
  ret i8* %call
}


define linkonce_odr hidden i8* @f6() align 2   {
if.end:
  %call2 = call i8* @f7()
  ret i8* %call2
}

define linkonce_odr hidden i8* @f7()     {
entry:
  br label %if.then

if.then:                                          ; preds = %entry
  call void @llvm.assume(i1 true) [ "align"(i8* undef, i64 undef) ]
  br label %return

return:                                           ; preds = %if.then
  ret i8* undef
}

; Function Attrs: nofree nosync nounwind willreturn
declare void @llvm.assume(i1 noundef) #2

attributes #0 = { argmemonly nofree nosync nounwind willreturn }
attributes #1 = { argmemonly nofree nosync nounwind willreturn writeonly }
attributes #2 = { nofree nosync nounwind willreturn }</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>