rust-lang / packed_simd

Portable Packed SIMD Vectors for Rust standard library
https://rust-lang.github.io/packed_simd/packed_simd_2/
Apache License 2.0
589 stars 74 forks source link

ICE in `shuffle!` #324

Closed TheIronBorn closed 3 years ago

TheIronBorn commented 3 years ago

I came across an ICE in the shuffle macro. Hopefully someone here can find a more minimal example.

error: internal compiler error: /rustc/b3d11f95cc5dd687fdd185ce91e02ebe40e6f46b\compiler\rustc_middle\src\ty\consts.rs:195:32: expected bits of [u32; 2], got Const {

$ rustc --version --verbose
rustc 1.55.0-nightly (b3d11f95c 2021-07-04)
binary: rustc
commit-hash: b3d11f95cc5dd687fdd185ce91e02ebe40e6f46b
commit-date: 2021-07-04
host: x86_64-pc-windows-msvc
release: 1.55.0-nightly
LLVM version: 12.0.1
use packed_simd::{u8x2, shuffle};

pub fn foo(x: u8x2) -> u8x2 {
    shuffle!(x, [1, 0])
}
click to expand full output of `RUST_BACKTRACE=full cargo build -vv` ``` error: internal compiler error: /rustc/b3d11f95cc5dd687fdd185ce91e02ebe40e6f46b\compiler\rustc_middl e\src\ty\consts.rs:195:32: expected bits of [u32; 2], got Const { ty: [u32; 2], val: Value( ByRef { alloc: Allocation { bytes: [ 1, 0, 0, 0, 0, 0, 0, 0, ], relocations: Relocations( SortedMap { data: [], }, ), init_mask: InitMask { blocks: [ 255, ], len: Size { raw: 8, }, }, align: Align { pow2: 2, }, mutability: Not, extra: (), }, offset: Size { raw: 0, }, }, ), } thread 'rustc' panicked at 'Box', compiler\rustc_errors\src\lib.rs:1006:9 stack backtrace: 0: 0x7ff91e7b73cf - ::fmt::h6ba2a9241bb86732 1: 0x7ff91e7dff7a - core::fmt::write::ha9fdc24e2055a123 2: 0x7ff91e7aa948 - ::fmt::h2f7de836a9fea840 3: 0x7ff91e7bb106 - std::panicking::take_hook::h880a3a97a8692ac2 4: 0x7ff91e7babe9 - std::panicking::take_hook::h880a3a97a8692ac2 5: 0x7ff90bd546d5 - ::flush::hee6b95fd494feb4 c 6: 0x7ff91e7bba00 - std::panicking::rust_panic_with_hook::hf71bb7c83433b29f 7: 0x7ff90ffadbd0 - ::drop::h4f8f15aa7cec4dfd 8: 0x7ff90ffadb79 - ::drop::h4f8f15aa7cec4dfd 9: 0x7ff91026afd1 - rustc_query_system::query::job::report_cycle::h6ad95b2abe0c2755 10: 0x7ff90ffdc6e0 - ::flush::h047ec1cbb3679d84 11: 0x7ff90ffe3025 - rustc_errors::HandlerInner::emit_diagnostic::heb8a31dc5e552518 12: 0x7ff90ffe0b92 - rustc_errors::Handler::bug::hb2ff7ec66402551f 13: 0x7ff90fccd657 - rustc_middle::ty::structural_impls::::fmt::h5869c3d44553f282 14: 0x7ff90fccbca0 - rustc_middle::ty::consts::valtree::ValTree::zst::hb865eec6f9683d1a 15: 0x7ff90fccbc48 - rustc_middle::ty::consts::valtree::ValTree::zst::hb865eec6f9683d1a 16: 0x7ff90fccd589 - rustc_middle::ty::structural_impls::::fmt::h5869c3d44553f282 17: 0x7ff91025e327 - rustc_middle::util::bug::bug_fmt::hf198e31916c1b343 18: 0x7ff90f3afec4 - ::fmt:: h5a59164a64d0c7a5 19: 0x7ff90f3b704a - rustc_codegen_ssa::debuginfo::type_names::push_item_name::he75481756ae840 39 20: 0x7ff90f3b7168 - rustc_codegen_ssa::debuginfo::type_names::push_generic_params::h1d7916d50 aafc08c 21: 0x7ff90c01440c - ::drop::h3f55eba9dc119554 22: 0x7ff90bff897c - rustc_codegen_llvm::debuginfo::::dbg_scope_fn::h7630bb4433b6b0de 23: 0x7ff90bff82e1 - rustc_codegen_llvm::debuginfo::::create_function_debug_context::hd74d 70b70418a925 24: 0x7ff90c06c3e6 - ::msvc_basic_name::h6b1292e95eb170dd 25: 0x7ff90c0030e2 - as rustc_codegen_ llvm::type_of::LayoutLlvmExt>::pointee_info_at::hf141ea5b2b5b9458 26: 0x7ff90c02e60c - ::fmt::h73e 4370ce386cd1a 27: 0x7ff90c03c81f - ::next::he88ed3976c9ce471 28: 0x7ff90bfaa09e - :: drop::h4adaeb3876bff26c 29: 0x7ff90c005313 - as rustc_codegen_ llvm::type_of::LayoutLlvmExt>::pointee_info_at::hf141ea5b2b5b9458 30: 0x7ff90c03c133 - ::next::he88ed3976c9ce471 31: 0x7ff90c017cdd - ::codegen_crate::h2e599f3191e20a15 32: 0x7ff90be99b0d - rustc_interface::queries::Linker::link::he04c478b0566dbcf 33: 0x7ff90be8e786 - rustc_interface::queries::Queries::ongoing_codegen::hdb76edc87db3cf80 34: 0x7ff90bdaa7bf - ::fmt::h1888c009faa2f58 c 35: 0x7ff90bd7234d - rustc_driver::pretty::print_after_hir_lowering::h982e6ec8534626ef 36: 0x7ff90bdac7e9 - ::fmt::h1888c009faa2f58 c 37: 0x7ff90bd7c9ba - ::fmt::h1888c009faa2f58 c 38: 0x7ff90bd72f5f - rustc_driver::pretty::print_after_hir_lowering::h982e6ec8534626ef 39: 0x7ff90bdd0f9d - ::fmt::hac2312e292f84c23 40: 0x7ff91e7c92dc - std::sys::windows::thread::Thread::new::hd7a080f67ca1d43d 41: 0x7ff95df17034 - BaseThreadInitThunk 42: 0x7ff95e582651 - RtlUserThreadStart ```
workingjubilee commented 3 years ago

Appears to be resolved upstream.