Miscompilation from .wrapping_offset(isize::MIN).wrapping_offset(isize::MIN)
#112526
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
A-raw-pointers
Area: raw pointers, MaybeUninit, NonNull
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
P-medium
Medium 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.
Again, fuzzer generated code and minimised to surface Rust. Miri reports no UB under either aliasing model.
The correct output is 1, evaluated from
two >> *_31
where_31
points to 1 after having been roundtripped with two.wrapping_offset(isize::MIN)
.It outputs 2 with
-Copt-level >= 1
.Not sure if rustc is emitting LLVM IR with UB or it's a bug in LLVM.
llvm-reduce
gave me this which callsdump_var(2)
withopt -O1
: https://godbolt.org/z/q6GWPq9qs, but the GEP indices don't look right.cc @RalfJung @nikic
The text was updated successfully, but these errors were encountered: