<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 with MIPS32 inline assembly with certain clobbers when "-mips16" is enabled"
   href="https://bugs.llvm.org/show_bug.cgi?id=49042">49042</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash with MIPS32 inline assembly with certain clobbers when "-mips16" is enabled
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jesse.a.deguire@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24483" name="attach_24483" title="Example code and compiler output">attachment 24483</a> <a href="attachment.cgi?id=24483&action=edit" title="Example code and compiler output">[details]</a></span>
Example code and compiler output

Hi all,

I built LLVM/Clang 11.0.1 on my local machine with MIPS32 and ARM targets. I
used the "Distribution Example" CMake files in "llvm/clang/cmake/caches" as a
starting point to build what I currently have. This is on Ubuntu 20.04 x64
running via Windows Subsystem for Linux on Windows 10.

I'm trying to modify the Musl C library for MIPS16 support. Normally, this
simply involves fixing errors Clang points out with inline assembly in Musl due
to MIPS16 supporting only a subset of MIPS32 instructions as they show up.
However, I found that Clang/LLVM would crash with a stack trace rather than
showing a useful error message. After playing around for a while, I think I've
managed to come up with a simple example that shows the crash. I also followed
the instructions on the "How to Submit a Bug" document to get output from llc.
I could not use bugpoint because I did not have the foresight to build it
beforehand. I can rebuild my toolchain with bugpoint added if needed.

Attached is a ZIP file containing my CMake files I used to build Clang/LLVM,
the example source file I came up with, the temporary files that the crash
reporter told me to submit, the crash output of clang and llc, and the .bc file
that the "How to Submit a Bug" document had me create.

The source file contains more info on what seems to trigger the crash, but the
short is that it seems to be based on what clobbers are given as a part of an
inline assembly statement.</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>