-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
bugIncorrect behavior in the current implementation that needs fixingIncorrect behavior in the current implementation that needs fixingcraneliftIssues related to the Cranelift code generatorIssues related to the Cranelift code generator
Description
.clif
Test Case
set opt_level=speed
target x86_64
function u0:11(i8) -> i8 system_v {
block0(v0: i8):
v1 = uextend.i64 v0
v2 = imul_imm v1, 256
v3 = ireduce.i8 v2
return v3
}
Steps to Reproduce
- Compile reproducing test case with
opt_level=speed
.
Expected Results
The function unconditionally returns 0.
Actual Results
The function gets optimized to returning the argument:
function u0:11(i8) -> i8 system_v {
block0(v0: i8):
return v0
}
Versions and Environment
Cranelift version or commit: 0.105 and 36fb62c
Operating system: N/A
Architecture: x86_64
Extra Info
Found by @cbeuw in rust-lang/rustc_codegen_cranelift#1460. Replacing i8
with i32
returns the correct result.
Metadata
Metadata
Assignees
Labels
bugIncorrect behavior in the current implementation that needs fixingIncorrect behavior in the current implementation that needs fixingcraneliftIssues related to the Cranelift code generatorIssues related to the Cranelift code generator