<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 - __builtin___clear_cache crashes the WebAssembly backend"
   href="https://bugs.llvm.org/show_bug.cgi?id=42356">42356</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>__builtin___clear_cache crashes the WebAssembly backend
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>release blocker
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Backend: WebAssembly
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>gabravier@gmail.com
          </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=22129" name="attach_22129" title="7z archive containing the attachments">attachment 22129</a> <a href="attachment.cgi?id=22129&action=edit" title="7z archive containing the attachments">[details]</a></span>
7z archive containing the attachments

This code crashes the WebAssembly backend with a SIGSEGV :

void f(char *begin, char *end)
{
    return __builtin___clear_cache((char *)begin, (char *)end);
}

Attached is a 7z file containing : 
- The source file that crashed clang
- the associated .bc file that clang emits with -emit-llvm
- the different stack traces for the following three invocations of llc :
$ llc crash.bc
$ llc crash.bc -relocation-model=pic
$ llc crash.bc -relocation-model=static
- the error message I got when using the recommended invocation of bugpoint
from <a href="https://llvm.org/docs/HowToSubmitABug.html#code-generator-bugs">https://llvm.org/docs/HowToSubmitABug.html#code-generator-bugs</a>

I could not use bugpoint to pinpoint the crash more accurately, though I am
pretty sure that is directly related to __builtin___clear_cache. The stack
trace seems to implicate the assembly printer.</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>