<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 - Crash in ARC backend when calling LLVMTargetMachineEmitToFile"
   href="https://bugs.llvm.org/show_bug.cgi?id=50132">50132</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash in ARC backend when calling LLVMTargetMachineEmitToFile
          </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>Linux
          </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>Register Allocator
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>wenyong.huang@intel.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, quentin.colombet@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24804" name="attach_24804" title="The LLVM IR file converted from wasm bytecodes">attachment 24804</a> <a href="attachment.cgi?id=24804&action=edit" title="The LLVM IR file converted from wasm bytecodes">[details]</a></span>
The LLVM IR file converted from wasm bytecodes

Hi,

We are developing WebAssembly runtime which uses LLVM as the JIT/AOT codegen
backend for ARC CPU, and the runtime JIT/AOT compiler converts wasm bytecodes
into LLVM IR, runs optimization passes and finally calls
LLVMTargetMachineEmitToFile API to emit the Assembly file. And when calling
LLVMTargetMachineEmitToFile for some case, if the opt level is larger than
LLVMCodeGenLevelNone, crash occurs and the following error is reported:

LLVM ERROR: Error while trying to spill R4 from class GPR32: Cannot scavenge
register without an emergency spill slot!

For opt level LLVMCodeGenLevelNone, and for other CPU e.g. X86_64 and ARM, it
is OK.

I uploaded the LLVM IR file, could you please help have a check? Thanks.</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>