The following code
#[derive(Debug)]
struct U32Pair {
a: u32,
b: u32,
}
#[inline(never)]
fn u128_test(p1: U32Pair) {
let x = dbg!(p1.a) as u128 * 10;
dbg!(x);
let y = x + 1;
dbg!(y);
}
fn main() {
u128_test(U32Pair { a: 1, b: 0 });
}
prints (on -C opt-level=z)
[src/main.rs:50] p1.a = 1
[src/main.rs:51] x = 0
[src/main.rs:53] y = 10000000000000000001
The test is reduced from std::thread::sleep which currently gets stuck sleeping forever. It's pretty particular about the details, otherwise it might work correctly or cause panics in the format code.
I've also added this to https://github.com/ollpu/esp-rustc-abi-bug
The following code
prints (on
-C opt-level=z)The test is reduced from
std::thread::sleepwhich currently gets stuck sleeping forever. It's pretty particular about the details, otherwise it might work correctly or cause panics in the format code.I've also added this to https://github.com/ollpu/esp-rustc-abi-bug