[llvm-bugs] [Bug 49042] New: Crash with MIPS32 inline assembly with certain clobbers when "-mips16" is enabled

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Feb 4 12:11:34 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=49042

            Bug ID: 49042
           Summary: Crash with MIPS32 inline assembly with certain
                    clobbers when "-mips16" is enabled
           Product: new-bugs
           Version: 11.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: jesse.a.deguire at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 24483
  --> https://bugs.llvm.org/attachment.cgi?id=24483&action=edit
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210204/4207689e/attachment.html>


More information about the llvm-bugs mailing list