Skip to content

Miscompilation of portable-simd with nightly-2025-02-12 on arm64 Linux #1560

Closed
@bjorn3

Description

@bjorn3

I've so far reduced it to

#![feature(portable_simd)]

use core_simd::simd::prelude::*;
use test_helpers::*;

#[test]
fn lanes_3() {
    test_1(&|x: [usize; 3]| {
        let result_1: [u8; 3] = Simd::<usize, 3>::cast::<u8>(x.into()).into();
        let result_2: [u8; 3] =
            x.iter().copied().map(|x| x as u8).collect::<Vec<_>>().try_into().unwrap();
        proptest::prop_assert_eq!(&result_1, &result_2);
        Ok(())
    });
}
dist/cargo-clif build --manifest-path build/portable-simd/crates/core_simd/Cargo.toml --test cast && __RUST_TEST_INVOKE=lanes_3 build/portable-simd/target/debug/deps/cast-13b6f2e0b7cfecc1
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.02s
Segmentation fault (core dumped)

This crash is not consistent and seems to depend on the ASLR seed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions