<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 --- - Assertion failed: (Bits != 0 && "Cannot print this instruction.") for patchable functions"
   href="https://llvm.org/bugs/show_bug.cgi?id=28524">28524</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failed: (Bits != 0 && "Cannot print this instruction.") for patchable functions
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Common Code Generator Code
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>igor@azulsystems.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>Created <span class=""><a href="attachment.cgi?id=16731" name="attach_16731" title="test case">attachment 16731</a> <a href="attachment.cgi?id=16731&action=edit" title="test case">[details]</a></span>
test case

$ llvm/buildDA/bin/llc -O3 test.ll
Assertion failed: (Bits != 0 && "Cannot print this instruction."), function
printInstruction, file llvm/buildDA/lib/Target/X86/X86GenAsmWriter.inc, line
46606.
Stack dump:
0.    Program arguments: llvm/buildDA/bin/llc -O3 tmp.ll
1.    Running pass 'Function Pass Manager' on module 'tmp.ll'.
2.    Running pass 'X86 Assembly / Object Emitter' on function '@test'


Problem happens when we are trying to print "PATCHABLE_OP 2, KILL, <ops...>"
"X86AsmPrinter::LowerPATCHABLE_OP" can't handle target independent opcodes.

Problematic instruction is generated from PatchableFunction.cpp. It looks for
the first instruction which in this case turns out to be KILL. I suspect that
<a href="http://reviews.llvm.org/rL274952">http://reviews.llvm.org/rL274952</a> is indirectly responsible for such behaviour.</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>