[ICE]: Unexpected indirect value for \Simd` during codegen`

Đang mở
#166,089 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
compilers

Hướng nghiên cứu

Start with the supplied reproducer and run it using the shown flags: -C opt-level=2 --edition 2024. Read compiler/rustc_codegen_ssa/src/mir/constant.rs at the reported panic location and trace the codegen path shown in the backtrace. Done when the reproducer compiles without an ICE and a regression test covers the case.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

C-bug I-ICE needs-triage T-compiler
Code
//@compile-flags: -C opt-level=2 --edition 2024
#![feature(portable_simd)]
use core::simd::Simd;

type BASE=u64;
fn test(
    value: [Simd<BASE, 1>; 2]
) -> Simd<BASE, 1> {
    rotate_right(Simd::splat(1) ^ value[0], 8)
}

fn rotate_right(v: Simd<BASE, 1>, count: BASE) -> Simd<BASE, 1> {
    (v >> count) | (v << (64-count))
}

fn main() {
    let v = [unsafe { core::mem::MaybeUninit::<Simd<u64, 1>>::uninit().assume_init() }; 2];
    assert_eq!(test(v), Simd::splat(1));
}
Meta

rustc --version --verbose:

rustc 1.102.0-nightly (5df8c02af 2026-11-16)
binary: rustc
commit-hash: 5df8c02afdf6b882bc301442cea70f026e3d3974
commit-date: 2026-11-16
host: x86_64-unknown-linux-gnu
release: 1.102.0-nightly
LLVM version: 23.1.5
Error output
error: internal compiler error: /rustc-dev/5df8c02afdf6b882bc301442cea70f026e3d3974/compiler/rustc_codegen_ssa/src/mir/constant.rs:59:22: Val(
                                    Indirect {
                                        alloc_id: a6,
                                        offset: Size(0 bytes),
                                    },
                                    std::simd::Simd<u64, 1_usize>,
                                )

Backtrace

thread 'rustc' (1785489) panicked at /rustc-dev/5df8c02afdf6b882bc301442cea70f026e3d3974/compiler/rustc_codegen_ssa/src/mir/constant.rs:59:22:
Box<dyn Any>
stack backtrace:
   0:     0x7f3d75818bd6 - <<std[fb80353258e89686]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[d05945f167f7bcf4]::fmt::Display>::fmt
   1:     0x7f3d75e10ba9 - core[d05945f167f7bcf4]::fmt::write
   2:     0x7f3d7582d7cc - <std[fb80353258e89686]::sys::stdio::unix::Stderr as core[d05945f167f7bcf4]::io::write::Write>::write_fmt
   3:     0x7f3d757ea05a - std[fb80353258e89686]::panicking::default_hook::{closure#0}
   4:     0x7f3d7580c5c3 - std[fb80353258e89686]::panicking::default_hook
   5:     0x7f3d7457be71 - std[fb80353258e89686]::panicking::update_hook::<alloc[853481b65ea3acd4]::boxed::Box<rustc_driver_impl[4017350140c73312]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7f3d7580ca62 - std[fb80353258e89686]::panicking::panic_with_hook
   7:     0x7f3d753991d6 - std[fb80353258e89686]::panicking::begin_panic::<rustc_span[3116a6fa6fcaeb24]::macros::ExplicitBug>::{closure#0}
   8:     0x7f3d7539715e - std[fb80353258e89686]::sys::backtrace::__rust_end_short_backtrace::<std[fb80353258e89686]::panicking::begin_panic<rustc_span[3116a6fa6fcaeb24]::macros::ExplicitBug>::{closure#0}, !>
   9:     0x7f3d75397132 - std[fb80353258e89686]::panicking::begin_panic::<rustc_span[3116a6fa6fcaeb24]::macros::ExplicitBug>
  10:     0x7f3d71d12bb1 - rustc_span[3116a6fa6fcaeb24]::macros::bug_impl
  11:     0x7f3d7601f907 - <rustc_codegen_ssa[c0b5b53d2648dd96]::mir::FunctionCx<rustc_codegen_llvm[eeca71451aeafa8d]::builder::GenericBuilder<rustc_codegen_llvm[eeca71451aeafa8d]::context::FullCx>>>::codegen_operand
  12:     0x7f3d7207c7b6 - <rustc_codegen_ssa[c0b5b53d2648dd96]::mir::FunctionCx<rustc_codegen_llvm[eeca71451aeafa8d]::builder::GenericBuilder<rustc_codegen_llvm[eeca71451aeafa8d]::context::FullCx>>>::codegen_call_terminator
  13:     0x7f3d76f4c0d7 - rustc_codegen_ssa[c0b5b53d2648dd96]::mir::codegen_mir::<rustc_codegen_llvm[eeca71451aeafa8d]::builder::GenericBuilder<rustc_codegen_llvm[eeca71451aeafa8d]::context::FullCx>>
  14:     0x7f3d76f116db - rustc_codegen_llvm[eeca71451aeafa8d]::base::compile_codegen_unit::module_codegen::{closure#1}
  15:     0x7f3d77012744 - rustc_codegen_llvm[eeca71451aeafa8d]::base::compile_codegen_unit::{closure#0}
  16:     0x7f3d7738a99e - <rustc_codegen_llvm[eeca71451aeafa8d]::back::llvm_backend::LlvmCodegenBackend as rustc_codegen_ssa[c0b5b53d2648dd96]::traits::backend::ExtraBackendMethods>::compile_codegen_unit
  17:     0x7f3d773884c6 - rustc_codegen_ssa[c0b5b53d2648dd96]::base::codegen_crate::<rustc_codegen_llvm[eeca71451aeafa8d]::back::llvm_backend::LlvmCodegenBackend, rustc_codegen_llvm[eeca71451aeafa8d]::back::llvm_backend::ModuleLlvm>
  18:     0x7f3d773852b9 - <rustc_codegen_llvm[eeca71451aeafa8d]::back::llvm_backend::LlvmCodegenBackend as rustc_codegen_ssa[c0b5b53d2648dd96]::traits::backend::CodegenBackend>::codegen_crate
  19:     0x7f3d773917e2 - <rustc_interface[b7da42965084f0ea]::queries::Linker>::codegen_and_build_linker
  20:     0x7f3d770e95e9 - rustc_interface[b7da42965084f0ea]::interface::run_compiler::<(), rustc_driver_impl[4017350140c73312]::compiler_entrypoint::{closure#0}>::{closure#2}
  21:     0x7f3d773df27a - <rustc_thread_pool[22e63e7495d6baf6]::job::StackJob<rustc_thread_pool[22e63e7495d6baf6]::latch::LatchRef<rustc_thread_pool[22e63e7495d6baf6]::latch::LockLatch>, <rustc_thread_pool[22e63e7495d6baf6]::registry::Registry>::in_worker_cold<<rustc_thread_pool[22e63e7495d6baf6]::thread_pool::ThreadPool>::install<rustc_interface[b7da42965084f0ea]::util::run_in_thread_pool_with_globals<rustc_interface[b7da42965084f0ea]::interface::run_compiler<(), rustc_driver_impl[4017350140c73312]::compiler_entrypoint::{closure#0}>::{closure#2}, ()>::{closure#6}::{closure#0}::{closure#1}::{closure#0}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()> as rustc_thread_pool[22e63e7495d6baf6]::job::Job>::execute
  22:     0x7f3d773debb6 - <rustc_thread_pool[22e63e7495d6baf6]::registry::WorkerThread>::wait_or_steal_until_cold
  23:     0x7f3d773df9e3 - <rustc_thread_pool[22e63e7495d6baf6]::registry::ThreadBuilder>::run
  24:     0x7f3d773df82e - std[fb80353258e89686]::sys::backtrace::__rust_begin_short_backtrace::<<rustc_thread_pool[22e63e7495d6baf6]::ThreadPoolBuilder>::build_scoped<rustc_interface[b7da42965084f0ea]::util::run_in_thread_pool_with_globals<rustc_interface[b7da42965084f0ea]::interface::run_compiler<(), rustc_driver_impl[4017350140c73312]::compiler_entrypoint::{closure#0}>::{closure#2}, ()>::{closure#6}::{closure#0}::{closure#0}, rustc_interface[b7da42965084f0ea]::util::run_in_thread_pool_with_globals<rustc_interface[b7da42965084f0ea]::interface::run_compiler<(), rustc_driver_impl[4017350140c73312]::compiler_entrypoint::{closure#0}>::{closure#2}, ()>::{closure#6}::{closure#0}::{closure#1}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
  25:     0x7f3d773df6d4 - <std[fb80353258e89686]::thread::lifecycle::spawn_unchecked<<rustc_thread_pool[22e63e7495d6baf6]::ThreadPoolBuilder>::build_scoped<rustc_interface[b7da42965084f0ea]::util::run_in_thread_pool_with_globals<rustc_interface[b7da42965084f0ea]::interface::run_compiler<(), rustc_driver_impl[4017350140c73312]::compiler_entrypoint::{closure#0}>::{closure#2}, ()>::{closure#6}::{closure#0}::{closure#0}, rustc_interface[b7da42965084f0ea]::util::run_in_thread_pool_with_globals<rustc_interface[b7da42965084f0ea]::interface::run_compiler<(), rustc_driver_impl[4017350140c73312]::compiler_entrypoint::{closure#0}>::{closure#2}, ()>::{closure#6}::{closure#0}::{closure#1}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>::{closure#1} as core[d05945f167f7bcf4]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  26:     0x7f3d7715f1e3 - <std[fb80353258e89686]::sys::thread::unix::Thread>::new::thread_start
  27:     0x7f3d7028aaa4 - start_thread
                               at ./nptl/pthread_create.c:447:8
  28:     0x7f3d70317c6c - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78:0
  29:                0x0 - <unknown>

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: rustc 1.102.0-nightly (5df8c02af 2026-11-16) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=2

query stack during panic:
end of query stack

Ngôn ngữ chính
Rust
Star
122k
Fork
16.7k
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
515

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rust-lang/rust

Tất cả issue của rust-lang/rust

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.