Miscompilation on aarch64-apple-darwin (likely a calling convention bug) #112548
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
C-bug
Category: This is a bug.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
O-AArch64
Armv8-A or later processors in AArch64 mode
O-macos
Operating system: macOS
P-high
High priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Fuzzer generated code:
This should output
15917201677548574216
: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a51ce49127180037639732b4a990ddbe.But on
-Zmir-opt-level=0 -Copt-level>=1
it prints something different.-Zmir-opt-level>=1
masks the bug.This is only reproducible on
aarch64-apple-darwin
, but not onx86_64-apple-darwin
oraarch64-unknown-linux-gnu
. The reproducer is very sensitive to small changes. For instance, changing the length of_23
infn16
to8
prevents the bug. For these reasons I suspect it's an Apple Silicon specific calling convention bug leading to some stack corruption.The text was updated successfully, but these errors were encountered: