Skip to content

ICE with statics containing #[simd] types with length not a power-of-two #17170

Closed
@huonw

Description

@huonw
#![feature(simd)]

#[simd]
struct T(f64, f64, f64);

static X: T = T(0.0, 0.0, 0.0);

fn main() {
    let _ = X;
}
{ double, double, double } zeroinitializer
<3 x double> undef
error: internal compiler error: const expr(19: T(0.0, 0.0, 0.0)) of type T has size 24 instead of 32
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/ast_util.rs:776

Similarly 5 fields fails with has size 40 instead of 64.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions