<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 - Any code involving __builtin_wasm_throw cannot compile"
   href="https://bugs.llvm.org/show_bug.cgi?id=39352">39352</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Any code involving __builtin_wasm_throw cannot compile
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </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>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>chen.pang.he@jdh8.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21017" name="attach_21017" title="Compiler invocation">attachment 21017</a> <a href="attachment.cgi?id=21017&action=edit" title="Compiler invocation">[details]</a></span>
Compiler invocation

__builtin_wasm_throw is supposed to transform to @llvm.wasm.throw,
but it always chokes compilation.

Minimal example:

int main(void)
{
    __builtin_wasm_throw(0, (void*)0);
}

Terminal output:

fatal error: error in backend: Cannot select: intrinsic %llvm.wasm.throw
clang-7: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 8.0.0 (<a href="https://github.com/llvm-mirror/clang.git">https://github.com/llvm-mirror/clang.git</a>
ab7073b16c4929d51075045579d4dada65a5d7f2)
(<a href="https://github.com/llvm-mirror/llvm.git">https://github.com/llvm-mirror/llvm.git</a>
5eae65a2bb3c2d8c86a7c911d1bd433ccd14ddd3)
Target: wasm32-unknown-unknown-wasm
Thread model: single
InstalledDir: /home/jdh8/build/llvm/bin
clang-7: note: diagnostic msg: PLEASE submit a bug report to
<a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash backtrace, preprocessed source,
and associated run script.
clang-7: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-7: note: diagnostic msg: /tmp/throw-9d7cde.c
clang-7: note: diagnostic msg: /tmp/throw-9d7cde.sh
clang-7: note: diagnostic msg: 

********************</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>