-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-SIMDArea: SIMD (Single Instruction Multiple Data)Area: SIMD (Single Instruction Multiple Data)C-bugCategory: This is a bug.Category: This is a bug.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
Description
I tried this code:
#![feature(repr_simd)]
use std::mem::transmute;
#[derive(Clone, Debug)]
#[repr(simd)]
struct CustomSimd<T, const LANES: usize>([T; LANES]);
fn main() {
let mut input : CustomSimd<u8, 10> = CustomSimd([0u8; 10]);
input.0[0] = u8::MAX;
let data = unsafe { transmute::<_, CustomSimd<u8, 10>>(input).0 };
assert_eq!(data, [u8::MAX, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
}
I expected to see this happen: I expected this test to succeed since the destination type is the same as the source type.
Instead, this happened: This test fails. When running it with valgrind, I get errors such as:
Conditional jump or move depends on uninitialised value(s)
Meta
I used the playground version:
Nightly channel
Build using the Nightly version: 1.72.0-nightly
(2023-07-06 85bf07972a1041b9e253)
Metadata
Metadata
Assignees
Labels
A-SIMDArea: SIMD (Single Instruction Multiple Data)Area: SIMD (Single Instruction Multiple Data)C-bugCategory: This is a bug.Category: This is a bug.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.