Skip to content

Crash with MIPS32 inline assembly with certain clobbers when "-mips16" is enabled #48386

Open
@jdeguire

Description

@jdeguire
Bugzilla Link 49042
Version 11.0
OS Linux
Attachments Example code and compiler output

Extended Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions