Skip to content

ICE guard_size * probe_count is too large to fit in a 32-bit immediate #1656

@matthiaskrgr

Description

@matthiaskrgr

might be similar to #1552

snippet:

//@compile-flags: -Zcodegen-backend=cranelift
fn main() {
    assert_eq!(&mut [0; 536870787_usize][..], &mut []);
}

Version information

rustc 1.98.0-nightly (8c1d72083 2026-05-28)
binary: rustc
commit-hash: 8c1d72083bb2b7b9df8cbbf06a57d240a007bd85
commit-date: 2026-05-28
host: x86_64-unknown-linux-gnu
release: 1.98.0-nightly
LLVM version: 22.1.6

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Zcodegen-backend=cranelift

Program output


thread '<unnamed>' (3650454) panicked at /rust/deps/cranelift-codegen-0.131.0/src/isa/x64/inst/emit.rs:373:18:
`guard_size * probe_count` is too large to fit in a 32-bit immediate: TryFromIntError(PosOverflow)
stack backtrace:
   0:     0x7fa36dcb8189 - <<std[d49b81100c593501]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[307308a59b42f609]::fmt::Display>::fmt
   1:     0x7fa36e420988 - core[307308a59b42f609]::fmt::write
   2:     0x7fa36dccee76 - <std[d49b81100c593501]::sys::stdio::unix::Stderr as std[d49b81100c593501]::io::Write>::write_fmt
   3:     0x7fa36dc8e3ae - std[d49b81100c593501]::panicking::default_hook::{closure#0}
   4:     0x7fa36dcabac3 - std[d49b81100c593501]::panicking::default_hook
   5:     0x7fa36caa7ff1 - std[d49b81100c593501]::panicking::update_hook::<alloc[41b0df45fb608239]::boxed::Box<rustc_driver_impl[98011a5ec9f8d80f]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7fa36dcabda2 - std[d49b81100c593501]::panicking::panic_with_hook
   7:     0x7fa36dc8e472 - std[d49b81100c593501]::panicking::panic_handler::{closure#0}
   8:     0x7fa36dc85179 - std[d49b81100c593501]::sys::backtrace::__rust_end_short_backtrace::<std[d49b81100c593501]::panicking::panic_handler::{closure#0}, !>
   9:     0x7fa36dc8fedd - __rustc[2f0bfc8ff0e38b1b]::rust_begin_unwind
  10:     0x7fa36a8c600c - core[307308a59b42f609]::panicking::panic_fmt
  11:     0x7fa36a146432 - core[307308a59b42f609]::result::unwrap_failed
  12:     0x7fa35b8f858c - cranelift_codegen[39a7ea38a4c937d3]::isa::x64::inst::emit::emit
  13:     0x7fa35b7c85fc - <cranelift_codegen[39a7ea38a4c937d3]::machinst::vcode::VCode<cranelift_codegen[39a7ea38a4c937d3]::isa::x64::lower::isle::generated_code::MInst>>::emit::{closure#0}
  14:     0x7fa35b844dea - <cranelift_codegen[39a7ea38a4c937d3]::machinst::vcode::VCode<cranelift_codegen[39a7ea38a4c937d3]::isa::x64::lower::isle::generated_code::MInst>>::emit
  15:     0x7fa35b9fcd84 - <cranelift_codegen[39a7ea38a4c937d3]::isa::x64::X64Backend as cranelift_codegen[39a7ea38a4c937d3]::isa::TargetIsa>::compile_function
  16:     0x7fa35b7cfb82 - <cranelift_codegen[39a7ea38a4c937d3]::context::Context>::compile_stencil
  17:     0x7fa35b7d2ebc - <cranelift_codegen[39a7ea38a4c937d3]::context::Context>::compile
  18:     0x7fa35b50acbd - <cranelift_object[887794265853d69c]::backend::ObjectModule as cranelift_module[910bb730e5e13cb2]::module::Module>::define_function_with_control_plane
  19:     0x7fa35b4814d7 - rustc_codegen_cranelift[67e25b9fd755daac]::driver::aot::module_codegen::{closure#0}
  20:     0x7fa35b470869 - https://github.com/rust-lang/rustc_codegen_cranelift/issues/1552std[d49b81100c593501]::sys::backtrace::__rust_begin_short_backtrace::<rustc_codegen_cranelift[67e25b9fd755daac]::driver::aot::module_codegen::{closure#0}, core[307308a59b42f609]::result::Result<rustc_codegen_cranelift[67e25b9fd755daac]::driver::aot::ModuleCodegenResult, alloc[41b0df45fb608239]::string::String>>
  21:     0x7fa35b4869ea - <std[d49b81100c593501]::thread::lifecycle::spawn_unchecked<rustc_codegen_cranelift[67e25b9fd755daac]::driver::aot::module_codegen::{closure#0}, core[307308a59b42f609]::result::Result<rustc_codegen_cranelift[67e25b9fd755daac]::driver::aot::ModuleCodegenResult, alloc[41b0df45fb608239]::string::String>>::{closure#1} as core[307308a59b42f609]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  22:     0x7fa36f5b5a2c - <std[d49b81100c593501]::sys::thread::unix::Thread>::new::thread_start
  23:     0x7fa368a981b9 - <unknown>
  24:     0x7fa368b1d21c - <unknown>
  25:                0x0 - <unknown>

error: the compiler unexpectedly panicked. This is a bug

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.98.0-nightly (8c1d72083 2026-05-28) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z codegen-backend=cranelift -Z dump-mir-dir=dir

query stack during panic:
end of query stack

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions