mirror of
https://github.com/Noratrieb/rlo-issue-112061.git
synced 2026-01-14 16:35:04 +01:00
more
This commit is contained in:
commit
158ebfb3b4
5 changed files with 117 additions and 0 deletions
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
/good
|
||||||
|
/bad
|
||||||
|
|
||||||
|
# Added by cargo
|
||||||
|
|
||||||
|
/target
|
||||||
7
Cargo.lock
generated
Normal file
7
Cargo.lock
generated
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "min112061"
|
||||||
|
version = "0.1.0"
|
||||||
12
Cargo.toml
Normal file
12
Cargo.toml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
[package]
|
||||||
|
name = "min112061"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "code"
|
||||||
|
path = "./code.rs"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
13
check.sh
Executable file
13
check.sh
Executable file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#/usr/bin/env bash
|
||||||
|
|
||||||
|
rustc code.rs --crate-name bad -Zmir-enable-passes=-ConstProp
|
||||||
|
rustc code.rs --crate-name good -Zmir-enable-passes=+ConstProp
|
||||||
|
|
||||||
|
bad=$(./bad)
|
||||||
|
good=$(./good)
|
||||||
|
|
||||||
|
if [ good != bad ]; then
|
||||||
|
echo "MISCOMPILATION"
|
||||||
|
else
|
||||||
|
echo "no repro"
|
||||||
|
fi
|
||||||
79
code.rs
Normal file
79
code.rs
Normal file
|
|
@ -0,0 +1,79 @@
|
||||||
|
use std::ptr;
|
||||||
|
pub fn print_var(v: u8) {
|
||||||
|
println!("{v}");
|
||||||
|
}
|
||||||
|
pub unsafe fn fn12_rs() -> ([u128; 7], *mut i8, *mut bool) {
|
||||||
|
let mut v2: bool = false;
|
||||||
|
let mut v8: u64 = 0;
|
||||||
|
let mut v9: usize = 0;
|
||||||
|
let mut v12: *mut u8 = ptr::null_mut();
|
||||||
|
let mut v17: *mut bool = ptr::null_mut();
|
||||||
|
let mut v20: [u8; 8] = Default::default();
|
||||||
|
let mut v21: [u8; 8] = Default::default();
|
||||||
|
let mut v31: (bool, u8, usize, f32) = Default::default();
|
||||||
|
let mut v33: ([u128; 7], *mut i8, *mut bool) = ([0; 7], ptr::null_mut(), ptr::null_mut());
|
||||||
|
let mut v39: (usize, [u128; 7], ([u32; 6], usize, *mut [u32; 6]), [u32; 2]) =
|
||||||
|
(0, [0; 7], ([0; 6], 0, ptr::null_mut()), [0; 2]);
|
||||||
|
let mut ret: ([u128; 7], *mut i8, *mut bool) = ([0; 7], ptr::null_mut(), ptr::null_mut());
|
||||||
|
ret.2 = core::ptr::addr_of_mut!(v2);
|
||||||
|
'l0: loop {
|
||||||
|
v20 = [197_u8; 8];
|
||||||
|
let v20_ptr = ptr::addr_of_mut!(v20);
|
||||||
|
v12 = core::ptr::addr_of_mut!((*v20_ptr)[v9]);
|
||||||
|
v9 = 2_usize;
|
||||||
|
'l1: loop {
|
||||||
|
match *v12 {
|
||||||
|
197 => {
|
||||||
|
// Taken
|
||||||
|
v8 = 13978819448286864680_u64;
|
||||||
|
v33.2 = ret.2;
|
||||||
|
match v39.0 {
|
||||||
|
0 => {
|
||||||
|
// Taken
|
||||||
|
'l2: loop {
|
||||||
|
(*v20_ptr) = [11_u8; 8]; // What LLVM with low mir-opt prints
|
||||||
|
(*v12) = 22; // What Miri prints
|
||||||
|
'l3: loop {
|
||||||
|
v21 = *v20_ptr;
|
||||||
|
match v8 {
|
||||||
|
13978819448286864680 => {
|
||||||
|
// Taken
|
||||||
|
v39.2 .0 = [2262110980_u32; 6];
|
||||||
|
v8 = 2;
|
||||||
|
v39.0 = 6;
|
||||||
|
v17 = v33.2;
|
||||||
|
v33.2 = core::ptr::addr_of_mut!(v31.0);
|
||||||
|
v31.1 = *v12;
|
||||||
|
(*v17) = true;
|
||||||
|
(*v20_ptr) = v21;
|
||||||
|
match v39.0 {
|
||||||
|
6 => {
|
||||||
|
// Taken
|
||||||
|
print_var(v31.1);
|
||||||
|
}
|
||||||
|
0 => continue 'l2,
|
||||||
|
_ => return ret,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
2 => return ret,
|
||||||
|
_ => continue 'l0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ => return ret,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
4 => {
|
||||||
|
v12 = core::ptr::addr_of_mut!((*v20_ptr)[v9]);
|
||||||
|
}
|
||||||
|
_ => return ret,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pub fn main() {
|
||||||
|
unsafe {
|
||||||
|
fn12_rs();
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue