You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling core::simd::u8x4::splat(or any splat with 4 or more elements) with -fsantize=undefined results in invalid loads:
// OKprintln!("u8x1");let v = simd::u8x1::splat(8);black_box(v);println!("u8x2");let v = simd::u8x2::splat(8);black_box(v);// Memory errorprintln!("u8x4");let v = simd::u8x4::splat(8);black_box(v);
u8x1
u8x2
u8x4
/home/michal/rustc_codegen_gcc/build/build_sysroot/sysroot_src/library/core/src/../../portable-simd/crates/core_simd/src/swizzle.rs:90:13: runtime error: load of address 0x7fff8d6fd230 with insufficient space for an object of type 'unsigned char'
0x7fff8d6fd230: note: pointer points here
ff 7f 08 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7c d2 6f 8d
^
/home/michal/rustc_codegen_gcc/build/build_sysroot/sysroot_src/library/core/src/../../portable-simd/crates/core_simd/src/swizzle.rs:90:13: runtime error: load of address 0x7fff8d6fd231 with insufficient space for an object of type 'unsigned char'
0x7fff8d6fd231: note: pointer points here
7f 08 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7c d2 6f 8d ff
^
/home/michal/rustc_codegen_gcc/build/build_sysroot/sysroot_src/library/core/src/../../portable-simd/crates/core_simd/src/swizzle.rs:90:13: runtime error: load of address 0x7fff8d6fd230 with insufficient space for an object of type 'unsigned char'
0x7fff8d6fd230: note: pointer points here
ff 7f 08 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 08 00 00 00 00 00 00 7c d2 6f 8d
^
/home/michal/rustc_codegen_gcc/build/build_sysroot/sysroot_src/library/core/src/../../portable-simd/crates/core_simd/src/swizzle.rs:90:13: runtime error: load of address 0x7fff8d6fd231 with insufficient space for an object of type 'unsigned char'
0x7fff8d6fd231: note: pointer points here
7f 08 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 08 00 00 00 00 00 00 7c d2 6f 8d ff
^
/home/michal/rustc_codegen_gcc/build/build_sysroot/sysroot_src/library/core/src/../../portable-simd/crates/core_simd/src/swizzle.rs:90:13: runtime error: load of address 0x7fff8d6fd230 with insufficient space for an object of type 'unsigned char'
0x7fff8d6fd230: note: pointer points here
ff 7f 08 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 08 00 00 00 00 00 00 08 08 00 00
^
/home/michal/rustc_codegen_gcc/build/build_sysroot/sysroot_src/library/core/src/../../portable-simd/crates/core_simd/src/swizzle.rs:90:13: runtime error: load of address 0x7fff8d6fd231 with insufficient space for an object of type 'unsigned char'
0x7fff8d6fd231: note: pointer points here
7f 08 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 08 00 00 00 00 00 00 08 08 00 00 00
^
/home/michal/rustc_codegen_gcc/build/build_sysroot/sysroot_src/library/core/src/../../portable-simd/crates/core_simd/src/swizzle.rs:90:13: runtime error: load of address 0x7fff8d6fd230 with insufficient space for an object of type 'unsigned char'
0x7fff8d6fd230: note: pointer points here
ff 7f 08 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 08 00 00 00 00 00 00 08 08 00 00
^
/home/michal/rustc_codegen_gcc/build/build_sysroot/sysroot_src/library/core/src/../../portable-simd/crates/core_simd/src/swizzle.rs:90:13: runtime error: load of address 0x7fff8d6fd231 with insufficient space for an object of type 'unsigned char'
0x7fff8d6fd231: note: pointer points here
7f 08 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 08 00 00 00 00 00 00 08 08 00 00 00
^
This issue only occurs for vectors with more than 4 elements - the type of the element does not matter:
u64x4
/home/michal/rustc_codegen_gcc/build/build_sysroot/sysroot_src/library/core/src/../../portable-simd/crates/core_simd/src/swizzle.rs:90:13: runtime error: load of address 0x7ffce42ec4f0 with insufficient space for an object of type 'size_t'
0x7ffce42ec4f0: note: pointer points here
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 81 f4 cb 73 55 00 00 d8 c4 2e e4
^
f32x4
/home/michal/rustc_codegen_gcc/build/build_sysroot/sysroot_src/library/core/src/../../portable-simd/crates/core_simd/src/swizzle.rs:90:13: runtime error: load of address 0x7ffce42ec620 with insufficient space for an object of type '<unknown>'
0x7ffce42ec620: note: pointer points here
00 00 00 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 a0 80 f4 cb 73 55 00 00 00 00 00 41
^
i8x4
/home/michal/rustc_codegen_gcc/build/build_sysroot/sysroot_src/library/core/src/../../portable-simd/crates/core_simd/src/swizzle.rs:90:13: runtime error: load of address 0x7ffce42ec5f0 with insufficient space for an object of type 'signed char'
0x7ffce42ec5f0: note: pointer points here
fc 7f 08 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3c c6 2e e4
This issue(discovered when running the core test suite) does not seem to lead to crashes / incorrect behavaiour.
The text was updated successfully, but these errors were encountered:
#![feature(portable_simd,core_intrinsics,repr_simd)]constCONST:std::simd::u8x1 = {unsafe{std::mem::transmute(0_u8)}// Any byte works here. This does not *have* to be const, but the issue still persists if it is const.};#[no_mangle]fnproblem_simd()->std::simd::u8x4{unsafe{
core::intrinsics::simd::simd_shuffle(CONST,CONST,const{#[repr(simd)]structSimdShuffleIdx([u32;4]);SimdShuffleIdx([0;4])},)}}
Calling
core::simd::u8x4::splat
(or any splat with 4 or more elements) with-fsantize=undefined
results in invalid loads:This issue only occurs for vectors with more than 4 elements - the type of the element does not matter:
This issue(discovered when running the
core
test suite) does not seem to lead to crashes / incorrect behavaiour.The text was updated successfully, but these errors were encountered: