Open shao-hua-li opened 1 week ago
pub static mut G: i32 = 0; fn myfunc() -> i32 { let var: *mut i32 = &raw mut G; if !var.is_null() { return 0; } return 0; } pub fn main() { myfunc(); }
Reproduce command:
% rustc -Zmir-opt-level=3 test.rs
rustc 1.83.0-nightly (9ff5fc4ff 2024-10-03) binary: rustc commit-hash: 9ff5fc4ffbbe1e911527aa054e789b05ae55ffcc commit-date: 2024-10-03 host: x86_64-unknown-linux-gnu release: 1.83.0-nightly LLVM version: 19.1.0
No response
Slightly more reduced:
static mut G: () = (); fn myfunc() -> i32 { let var = &raw mut G; if var.is_null() { return 0; } 0 } fn main() { myfunc(); }
Reproduce command:
Affected release channels
Rust Version
rustc 1.83.0-nightly (9ff5fc4ff 2024-10-03) binary: rustc commit-hash: 9ff5fc4ffbbe1e911527aa054e789b05ae55ffcc commit-date: 2024-10-03 host: x86_64-unknown-linux-gnu release: 1.83.0-nightly LLVM version: 19.1.0
Current error output
No response
Backtrace