akldc opened issue #11133:
.clifTest Caseset enable_multi_ret_implicit_sret=true function u1:0(i64, i64, i8x16) { const0 = 0xfeffffffff0200008d0000000a000402 block0(v0: i64, v1: i64, v2: i8x16): v7 = vconst.i32x4 const0 return } function %main() -> i8x16 tail { sig0 = (i64 , i64, i8x16) tail fn0 = u1:0 sig0 const1 = 0x60d64ffe6aed3a12b00dbe7bffb2bf3d block0(): v0 = iconst.i64 123 v1 = iconst.i64 234 v11 = vconst.i8x16 const1 call fn0(v0, v1, v11) return v11 } ;print:%main()Steps to Reproduce
qemu-riscv64 target/riscv64gc-unknown-linux-gnu/release/clif-util run -v test1.clifResult
Segmentation faultReturn code: -11
Clearly, the expected result should be:
%main() -> 0x60d64ffe6aed3a12b00dbe7bffb2bf3d
akldc added the bug label to Issue #11133.
akldc added the cranelift label to Issue #11133.
bjorn3 commented on issue #11133:
On the caller side
u1:0is defined with the tail calling convention, but the definition of this function uses the default calling convention (system_v). This is UB.
alexcrichton closed issue #11133:
.clifTest Caseset enable_multi_ret_implicit_sret=true function u1:0(i64, i64, i8x16) { const0 = 0xfeffffffff0200008d0000000a000402 block0(v0: i64, v1: i64, v2: i8x16): v7 = vconst.i32x4 const0 return } function %main() -> i8x16 tail { sig0 = (i64 , i64, i8x16) tail fn0 = u1:0 sig0 const1 = 0x60d64ffe6aed3a12b00dbe7bffb2bf3d block0(): v0 = iconst.i64 123 v1 = iconst.i64 234 v11 = vconst.i8x16 const1 call fn0(v0, v1, v11) return v11 } ;print:%main()Steps to Reproduce
qemu-riscv64 target/riscv64gc-unknown-linux-gnu/release/clif-util run -v test1.clifResult
Segmentation faultReturn code: -11
Clearly, the expected result should be:
%main() -> 0x60d64ffe6aed3a12b00dbe7bffb2bf3d
alexcrichton commented on issue #11133:
Agreed yes, the calling conventions need to match up
akldc commented on issue #11133:
@alexcrichton @bjorn3
The case runs correctly on other architectures.[x86 ] Success [x86 ] %main() -> 0x60d64ffe6aed3a12b00dbe7bffb2bf3d return code: 0 [aarch64] Success [aarch64] %main() -> 0x60d64ffe6aed3a12b00dbe7bffb2bf3d return code: 0 [riscv64] Error return code: -11 [s390x ] Success [s390x ] %main() -> 0x60d64ffe6aed3a12b00dbe7bffb2bf3d return code: 0
bjorn3 commented on issue #11133:
It likely just works by accident on those architectures.
Last updated: Dec 06 2025 at 06:05 UTC