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

オープン
#166,089 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
compilers

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Rust
スター
122k
フォーク
16.7k
平均マージ
2日 16時間
マージ済み PR(30日)
515

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rust-lang/rust のほかの issue

rust-lang/rust の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。