s390x: Move the value out of the casloop_val_reg with mov_preg (#5430)
The casloop_emit function in the s390x backend was using the fixed non-allocatable register %r0 directly with move instructions, which produced a panic in the regalloc2 checker (#5425). This PR changes the casloop_result function to use mov_preg instead of copy_reg to fetch the result, as it's not viewed by regalloc2 as a move. Fixes #5425
This commit is contained in:
16
cranelift/filetests/filetests/isa/s390x/issue-5425.clif
Normal file
16
cranelift/filetests/filetests/isa/s390x/issue-5425.clif
Normal file
@@ -0,0 +1,16 @@
|
||||
test compile
|
||||
set regalloc_checker=1
|
||||
target s390x
|
||||
|
||||
function %a() system_v {
|
||||
fn0 = %callee_f64(i64) -> i32
|
||||
|
||||
block0:
|
||||
v1 = iconst.i64 0
|
||||
v2 = call fn0(v1) ; v1 = 0
|
||||
|
||||
v21 = iconst.i64 0
|
||||
v22 = iconst.i32 2
|
||||
v23 = atomic_rmw.i32 xchg v21, v22 ; v21 = 0, v22 = 2
|
||||
trap user0
|
||||
}
|
||||
Reference in New Issue
Block a user