[llvm] [Mips] Fix atomic min/max generate mips4 instructions when compiling for mips2 (PR #149983)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 30 10:51:24 PDT 2025
Sirius902 wrote:
I built this PR from source on macOS and tried compiling the same program shown in https://github.com/llvm/llvm-project/issues/145411 but it seems the compiler ended up crashing.
```
❯ clang -c --target=mips-linux-gnu -mips2 -Oz -o main.o main.c
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: clang -c --target=mips-linux-gnu -mips2 -Oz -o main.o main.c
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'main.c'.
4. Running pass 'Mips Branch Expansion Pass' on function '@min'
#0 0x00000001056704b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/Users/chris/Dev/c/llvm-project/build/bin/clang-21+0x1026f44b8)
#1 0x000000010566e408 llvm::sys::RunSignalHandlers() (/Users/chris/Dev/c/llvm-project/build/bin/clang-21+0x1026f2408)
#2 0x000000010566f9b8 llvm::sys::CleanupOnSignal(unsigned long) (/Users/chris/Dev/c/llvm-project/build/bin/clang-21+0x1026f39b8)
#3 0x00000001055b6de8 CrashRecoverySignalHandler(int) (/Users/chris/Dev/c/llvm-project/build/bin/clang-21+0x10263ade8)
#4 0x000000019d114624 (/usr/lib/system/libsystem_platform.dylib+0x1804ac624)
#5 0x0000000103b4dec4 (anonymous namespace)::MipsBranchExpansion::handlePossibleLongBranch() (/Users/chris/Dev/c/llvm-project/build/bin/clang-21+0x100bd1ec4)
#6 0x0000000103b4dec4 (anonymous namespace)::MipsBranchExpansion::handlePossibleLongBranch() (/Users/chris/Dev/c/llvm-project/build/bin/clang-21+0x100bd1ec4)
clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 21.0.0git (git at github.com:yingopq/llvm-project.git 74af81c71078cdaf647d4435ee4c448edd88e8b8)
Target: mips-unknown-linux-gnu
Thread model: posix
InstalledDir: /Users/chris/Dev/c/llvm-project/build/bin
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/tr/9sy58s854pj87w4pzstgbjcw0000gn/T/main-4881f1.c
clang: note: diagnostic msg: /var/folders/tr/9sy58s854pj87w4pzstgbjcw0000gn/T/main-4881f1.sh
clang: note: diagnostic msg: Crash backtrace is located in
clang: note: diagnostic msg: /Users/chris/Library/Logs/DiagnosticReports/clang-21_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
clang: note: diagnostic msg:
********************
```
https://github.com/llvm/llvm-project/pull/149983
More information about the llvm-commits
mailing list