<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 MIPS16 multiply"
   href="https://bugs.llvm.org/show_bug.cgi?id=49146">49146</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash with MIPS16 multiply
          </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=24515" name="attach_24515" title="Clang output and crash report files">attachment 24515</a> <a href="attachment.cgi?id=24515&action=edit" title="Clang output and crash report files">[details]</a></span>
Clang output and crash report files

Clang 11.0.1 crashes with a stack trace and message telling me to file a bug
here when I build a module containing the following code in MIPS16 mode:

----------
static unsigned baz(unsigned n, unsigned m)
{
/* NOTE: Using any of these other operators works fine,
         only the multiply causes the crash.
 */
//    return n + m;
//    return n - m;
    return n * m;
//    return n / m;
}

int bar(void)
{
    return 42;
}

void foo(void)
{
    int bleh = bar();
    baz(bleh, 55);
}
----------

This is on a version of Clang I built in Debug mode for x86, MIPS, and ARM
targets on Ubuntu 20.04 on Windows 10 WSL.

Here is the start of the output from Clang, the rest is included in the
attached ZIP file:

----------
fatal error: error in backend: Not supported instr: <MCInst 464 <MCOperand
Reg:345> <MCOperand Reg:345> <MCOperand Reg:346>>
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.
Stack dump:
0.      Program arguments: ./pic32clang/install/bin/clang -c mips16_simple.c -o
mips16_simple.o -target mipsel-linux-gnu-musl -march=mips32r2 -g -O0
-msoft-float -mfloat-abi=soft -mips16 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'mips16_simple.c'.
4.      Running pass 'Mips Assembly Printer' on function '@baz'
----------

Also included in the ZIP file are the two files that the crash report told me
to include. The document "How To Submit an LLVM Bug Report" says to run "llc"
to see if that crashes, but it does not (this is different from my
previously-submitted <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Crash with MIPS32 inline assembly with certain clobbers when "-mips16" is enabled"
   href="show_bug.cgi?id=49042">bug #49042</a>, which does crash llc).</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>