miscompilation with incremental + unpacked debug + macos #108216
Labels
A-incr-comp
Area: Incremental compilation
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-macos
Operating system: macOS
P-high
High priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following script illustrates a miscompilation on macOS when using incremental and unpacked debug:
I tried this code:
The first compilation should fail due to the overflow error:
The second compilation should succeed since the overflow has been removed.
Then executing the binary should pass, since there is no overflow.
Instead, this happened:
Sometimes executing the binary will fail, as-if it compiled with the incorrect constant value:
This doesn't happen always, although it usually happens right away (thus the reason for the loop in the script).
Testing on macOS 13.2 aarch64 and macOS 12.6.3 x86_64 with either Xcode 14 or 13.
I couldn't get it to fail on Linux.
Bisection
This appears to be a regression introduced in #87337. Presumably because before that it wouldn't write any
.o
files (or write anything to the incremental db) due to the error. Strangely, I cannot get it to fail with#![allow(arithmetic_overflow)]
, and I don't really have a theory as to why.The text was updated successfully, but these errors were encountered: