Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustc 1.72 beta ICE error: internal compiler error: /rustc/598a0a3cb36343e08bc682670a728837fda6674a/compiler/rustc_codegen_ssa/src/mir/constant.rs:70:22 when compiling Firefox #114844

Closed
glandium opened this issue Aug 15, 2023 · 5 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@glandium
Copy link
Contributor

STR (thankfully smaller than Firefox, with rustc 1.72.0-beta.8 (598a0a3 2023-08-12)):

The ICE itself:

error: internal compiler error: /rustc/598a0a3cb36343e08bc682670a728837fda6674a/compiler/rustc_codegen_ssa/src/mir/constant.rs:70:22: Ty(
                                    Const { ty: [u32; 16], kind: IDX/#0 },
                                )
  --> /home/glandium/.cargo/registry/src/index.crates.io-6f17d22bba15001f/packed_simd-0.3.9/src/codegen/llvm.rs:49:24
   |
49 |     simd_shuffle(x, y, IDX)
   |                        ^^^

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/598a0a3cb36343e08bc682670a728837fda6674a/compiler/rustc_errors/src/lib.rs:995:33
stack backtrace:
   0:     0x7f26e2d63a71 - std::backtrace_rs::backtrace::libunwind::trace::he907b86be5a074bf
                               at /rustc/598a0a3cb36343e08bc682670a728837fda6674a/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f26e2d63a71 - std::backtrace_rs::backtrace::trace_unsynchronized::hc8f1b6f22b44dbbd
                               at /rustc/598a0a3cb36343e08bc682670a728837fda6674a/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f26e2d63a71 - std::sys_common::backtrace::_print_fmt::he9399e283a09e4ac
                               at /rustc/598a0a3cb36343e08bc682670a728837fda6674a/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f26e2d63a71 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h74cbbdd6e9a12194
                               at /rustc/598a0a3cb36343e08bc682670a728837fda6674a/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f26e2dc9d7f - core::fmt::rt::Argument::fmt::h9dcd348df0a515ce
                               at /rustc/598a0a3cb36343e08bc682670a728837fda6674a/library/core/src/fmt/rt.rs:138:9
   5:     0x7f26e2dc9d7f - core::fmt::write::h797f9b5fcce66ce2
                               at /rustc/598a0a3cb36343e08bc682670a728837fda6674a/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f26e2d564b7 - std::io::Write::write_fmt::h2cc54209b64f9257
                               at /rustc/598a0a3cb36343e08bc682670a728837fda6674a/library/std/src/io/mod.rs:1714:15
   7:     0x7f26e2d63885 - std::sys_common::backtrace::_print::h5c1bded59b35d737
                               at /rustc/598a0a3cb36343e08bc682670a728837fda6674a/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f26e2d63885 - std::sys_common::backtrace::print::hdf39404b70de8847
                               at /rustc/598a0a3cb36343e08bc682670a728837fda6674a/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f26e2d66663 - std::panicking::default_hook::{{closure}}::h8cc61acc3160d9ec
                               at /rustc/598a0a3cb36343e08bc682670a728837fda6674a/library/std/src/panicking.rs:269:22
  10:     0x7f26e2d663f4 - std::panicking::default_hook::h4ed550b1720b61df
                               at /rustc/598a0a3cb36343e08bc682670a728837fda6674a/library/std/src/panicking.rs:288:9
  11:     0x7f26e60479db - rustc_driver_impl[4f58748155a7808f]::install_ice_hook::{closure#0}
  12:     0x7f26e2d66e8e - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hcd80eb87bf035864
                               at /rustc/598a0a3cb36343e08bc682670a728837fda6674a/library/alloc/src/boxed.rs:2007:9
  13:     0x7f26e2d66e8e - std::panicking::rust_panic_with_hook::h8d85a8792b2e9142
                               at /rustc/598a0a3cb36343e08bc682670a728837fda6674a/library/std/src/panicking.rs:709:13
  14:     0x7f26e5ee1031 - std[480f6991fdf244e4]::panicking::begin_panic::<rustc_errors[12366acd2388f881]::ExplicitBug>::{closure#0}
  15:     0x7f26e5ee0ca6 - std[480f6991fdf244e4]::sys_common::backtrace::__rust_end_short_backtrace::<std[480f6991fdf244e4]::panicking::begin_panic<rustc_errors[12366acd2388f881]::ExplicitBug>::{closure#0}, !>
  16:     0x7f26e5ea4456 - std[480f6991fdf244e4]::panicking::begin_panic::<rustc_errors[12366acd2388f881]::ExplicitBug>
  17:     0x7f26e5ec0b02 - <rustc_errors[12366acd2388f881]::HandlerInner>::span_bug::<rustc_span[1c21d65e766a0dc0]::span_encoding::Span, alloc[e4f0635e60ac80e6]::string::String>
  18:     0x7f26e5ec0926 - <rustc_errors[12366acd2388f881]::Handler>::span_bug::<rustc_span[1c21d65e766a0dc0]::span_encoding::Span, alloc[e4f0635e60ac80e6]::string::String>
  19:     0x7f26e5ed4e9d - rustc_middle[35cdf0e183cfd1ac]::util::bug::opt_span_bug_fmt::<rustc_span[1c21d65e766a0dc0]::span_encoding::Span>::{closure#0}
  20:     0x7f26e5ed4eca - rustc_middle[35cdf0e183cfd1ac]::ty::context::tls::with_opt::<rustc_middle[35cdf0e183cfd1ac]::util::bug::opt_span_bug_fmt<rustc_span[1c21d65e766a0dc0]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f26e5ed354a - rustc_middle[35cdf0e183cfd1ac]::ty::context::tls::with_context_opt::<rustc_middle[35cdf0e183cfd1ac]::ty::context::tls::with_opt<rustc_middle[35cdf0e183cfd1ac]::util::bug::opt_span_bug_fmt<rustc_span[1c21d65e766a0dc0]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f26e48ee844 - rustc_middle[35cdf0e183cfd1ac]::util::bug::span_bug_fmt::<rustc_span[1c21d65e766a0dc0]::span_encoding::Span>
  23:     0x7f26e49512cd - <rustc_codegen_ssa[e090b1107a25c2c0]::mir::FunctionCx<rustc_codegen_llvm[62c8b4d51ba9e411]::builder::Builder>>::simd_shuffle_indices
  24:     0x7f26e4925163 - <core[ab88971f7bd07419]::iter::adapters::map::Map<core[ab88971f7bd07419]::iter::adapters::enumerate::Enumerate<core[ab88971f7bd07419]::slice::iter::Iter<rustc_middle[35cdf0e183cfd1ac]::mir::syntax::Operand>>, <rustc_codegen_ssa[e090b1107a25c2c0]::mir::FunctionCx<rustc_codegen_llvm[62c8b4d51ba9e411]::builder::Builder>>::codegen_call_terminator::{closure#2}> as core[ab88971f7bd07419]::iter::traits::iterator::Iterator>::fold::<(), core[ab88971f7bd07419]::iter::traits::iterator::Iterator::for_each::call<rustc_codegen_ssa[e090b1107a25c2c0]::mir::operand::OperandRef<&rustc_codegen_llvm[62c8b4d51ba9e411]::llvm_::ffi::Value>, <alloc[e4f0635e60ac80e6]::vec::Vec<rustc_codegen_ssa[e090b1107a25c2c0]::mir::operand::OperandRef<&rustc_codegen_llvm[62c8b4d51ba9e411]::llvm_::ffi::Value>>>::extend_trusted<core[ab88971f7bd07419]::iter::adapters::map::Map<core[ab88971f7bd07419]::iter::adapters::enumerate::Enumerate<core[ab88971f7bd07419]::slice::iter::Iter<rustc_middle[35cdf0e183cfd1ac]::mir::syntax::Operand>>, <rustc_codegen_ssa[e090b1107a25c2c0]::mir::FunctionCx<rustc_codegen_llvm[62c8b4d51ba9e411]::builder::Builder>>::codegen_call_terminator::{closure#2}>>::{closure#0}>::{closure#0}>
  25:     0x7f26e4924f63 - <alloc[e4f0635e60ac80e6]::vec::Vec<rustc_codegen_ssa[e090b1107a25c2c0]::mir::operand::OperandRef<&rustc_codegen_llvm[62c8b4d51ba9e411]::llvm_::ffi::Value>> as alloc[e4f0635e60ac80e6]::vec::spec_from_iter::SpecFromIter<rustc_codegen_ssa[e090b1107a25c2c0]::mir::operand::OperandRef<&rustc_codegen_llvm[62c8b4d51ba9e411]::llvm_::ffi::Value>, core[ab88971f7bd07419]::iter::adapters::map::Map<core[ab88971f7bd07419]::iter::adapters::enumerate::Enumerate<core[ab88971f7bd07419]::slice::iter::Iter<rustc_middle[35cdf0e183cfd1ac]::mir::syntax::Operand>>, <rustc_codegen_ssa[e090b1107a25c2c0]::mir::FunctionCx<rustc_codegen_llvm[62c8b4d51ba9e411]::builder::Builder>>::codegen_call_terminator::{closure#2}>>>::from_iter
  26:     0x7f26e48da3ef - rustc_codegen_ssa[e090b1107a25c2c0]::mir::codegen_mir::<rustc_codegen_llvm[62c8b4d51ba9e411]::builder::Builder>
  27:     0x7f26e560bcea - rustc_codegen_llvm[62c8b4d51ba9e411]::base::compile_codegen_unit::module_codegen
  28:     0x7f26e560b8b5 - <rustc_middle[35cdf0e183cfd1ac]::dep_graph::dep_node::DepKind as rustc_query_system[7ec998921a9428be]::dep_graph::DepKind>::with_deps::<<rustc_query_system[7ec998921a9428be]::dep_graph::graph::DepGraphData<rustc_middle[35cdf0e183cfd1ac]::dep_graph::dep_node::DepKind>>::with_task<rustc_middle[35cdf0e183cfd1ac]::ty::context::TyCtxt, rustc_span[1c21d65e766a0dc0]::symbol::Symbol, rustc_codegen_ssa[e090b1107a25c2c0]::ModuleCodegen<rustc_codegen_llvm[62c8b4d51ba9e411]::ModuleLlvm>>::{closure#0}::{closure#0}, rustc_codegen_ssa[e090b1107a25c2c0]::ModuleCodegen<rustc_codegen_llvm[62c8b4d51ba9e411]::ModuleLlvm>>
  29:     0x7f26e560b0bf - rustc_codegen_llvm[62c8b4d51ba9e411]::base::compile_codegen_unit
  30:     0x7f26e55f43af - rustc_codegen_ssa[e090b1107a25c2c0]::base::codegen_crate::<rustc_codegen_llvm[62c8b4d51ba9e411]::LlvmCodegenBackend>
  31:     0x7f26e55f3cb6 - <rustc_codegen_llvm[62c8b4d51ba9e411]::LlvmCodegenBackend as rustc_codegen_ssa[e090b1107a25c2c0]::traits::backend::CodegenBackend>::codegen_crate
  32:     0x7f26e523c8f2 - <rustc_session[98a8227d0036e49e]::session::Session>::time::<alloc[e4f0635e60ac80e6]::boxed::Box<dyn core[ab88971f7bd07419]::any::Any>, rustc_interface[9454197c0663f660]::passes::start_codegen::{closure#0}>
  33:     0x7f26e523c43b - rustc_interface[9454197c0663f660]::passes::start_codegen
  34:     0x7f26e52361ea - <rustc_middle[35cdf0e183cfd1ac]::ty::context::GlobalCtxt>::enter::<<rustc_interface[9454197c0663f660]::queries::Queries>::ongoing_codegen::{closure#0}, core[ab88971f7bd07419]::result::Result<alloc[e4f0635e60ac80e6]::boxed::Box<dyn core[ab88971f7bd07419]::any::Any>, rustc_span[1c21d65e766a0dc0]::ErrorGuaranteed>>
  35:     0x7f26e5235203 - <rustc_interface[9454197c0663f660]::interface::Compiler>::enter::<rustc_driver_impl[4f58748155a7808f]::run_compiler::{closure#1}::{closure#2}, core[ab88971f7bd07419]::result::Result<core[ab88971f7bd07419]::option::Option<rustc_interface[9454197c0663f660]::queries::Linker>, rustc_span[1c21d65e766a0dc0]::ErrorGuaranteed>>
  36:     0x7f26e522e2f5 - rustc_span[1c21d65e766a0dc0]::set_source_map::<core[ab88971f7bd07419]::result::Result<(), rustc_span[1c21d65e766a0dc0]::ErrorGuaranteed>, rustc_interface[9454197c0663f660]::interface::run_compiler<core[ab88971f7bd07419]::result::Result<(), rustc_span[1c21d65e766a0dc0]::ErrorGuaranteed>, rustc_driver_impl[4f58748155a7808f]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  37:     0x7f26e522dd66 - <scoped_tls[21ade261175d8f7f]::ScopedKey<rustc_span[1c21d65e766a0dc0]::SessionGlobals>>::set::<rustc_interface[9454197c0663f660]::interface::run_compiler<core[ab88971f7bd07419]::result::Result<(), rustc_span[1c21d65e766a0dc0]::ErrorGuaranteed>, rustc_driver_impl[4f58748155a7808f]::run_compiler::{closure#1}>::{closure#0}, core[ab88971f7bd07419]::result::Result<(), rustc_span[1c21d65e766a0dc0]::ErrorGuaranteed>>
  38:     0x7f26e522d32c - std[480f6991fdf244e4]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[9454197c0663f660]::util::run_in_thread_pool_with_globals<rustc_interface[9454197c0663f660]::interface::run_compiler<core[ab88971f7bd07419]::result::Result<(), rustc_span[1c21d65e766a0dc0]::ErrorGuaranteed>, rustc_driver_impl[4f58748155a7808f]::run_compiler::{closure#1}>::{closure#0}, core[ab88971f7bd07419]::result::Result<(), rustc_span[1c21d65e766a0dc0]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ab88971f7bd07419]::result::Result<(), rustc_span[1c21d65e766a0dc0]::ErrorGuaranteed>>
  39:     0x7f26e522d0f5 - <<std[480f6991fdf244e4]::thread::Builder>::spawn_unchecked_<rustc_interface[9454197c0663f660]::util::run_in_thread_pool_with_globals<rustc_interface[9454197c0663f660]::interface::run_compiler<core[ab88971f7bd07419]::result::Result<(), rustc_span[1c21d65e766a0dc0]::ErrorGuaranteed>, rustc_driver_impl[4f58748155a7808f]::run_compiler::{closure#1}>::{closure#0}, core[ab88971f7bd07419]::result::Result<(), rustc_span[1c21d65e766a0dc0]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ab88971f7bd07419]::result::Result<(), rustc_span[1c21d65e766a0dc0]::ErrorGuaranteed>>::{closure#1} as core[ab88971f7bd07419]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  40:     0x7f26e2d71305 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf1b68689a77864ac
                               at /rustc/598a0a3cb36343e08bc682670a728837fda6674a/library/alloc/src/boxed.rs:1993:9
  41:     0x7f26e2d71305 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he27f59da8d845828
                               at /rustc/598a0a3cb36343e08bc682670a728837fda6674a/library/alloc/src/boxed.rs:1993:9
  42:     0x7f26e2d71305 - std::sys::unix::thread::Thread::new::thread_start::h3c599ac9d675f30c
                               at /rustc/598a0a3cb36343e08bc682670a728837fda6674a/library/std/src/sys/unix/thread.rs:108:17
  43:     0x7f26e2b0f044 - start_thread
                               at ./nptl/pthread_create.c:442:8
  44:     0x7f26e2b8f5fc - __GI___clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  45:                0x0 - <unknown>
@glandium glandium added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 15, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 15, 2023
@matthiaskrgr
Copy link
Member

cc #113500 , might just need beta backport?

@glandium
Copy link
Contributor Author

rustc 1.72.0-nightly (6162f6f 2023-07-01): good
rustc 1.72.0-nightly (839e9a6 2023-07-02): bad

rustc 1.73.0-nightly (39f42ad 2023-07-19): bad
rustc 1.73.0-nightly (399b068 2023-07-20): good

that would match.

@AlifianK
Copy link

Might not be related but ripgrep also failed to build again with simd-accel enabled.

rustc --version --verbose
rustc 1.73.0-nightly (0bdb00d55 2023-08-15)
binary: rustc
commit-hash: 0bdb00d55aa7d6aebe5a01bc6d3c5bf474a853ab
commit-date: 2023-08-15
host: x86_64-pc-windows-msvc
release: 1.73.0-nightly
LLVM version: 17.0.0
cargo build --release --features 'pcre2 simd-accel'
   Compiling packed_simd_2 v0.3.8
   Compiling clap v2.34.0
   Compiling ignore v0.4.20 (D:\Dev\ripgrep\crates\ignore)
   Compiling ripgrep v13.0.0 (D:\Dev\ripgrep)
error: unrecognized platform-specific intrinsic function: `simd_shuffle2`
  --> C:\Users\A\.cargo\registry\src\index.crates.io-6f17d22bba15001f\packed_simd_2-0.3.8\src\codegen\llvm.rs:10:5
   |
10 |     pub fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: unrecognized platform-specific intrinsic function: `simd_shuffle4`
  --> C:\Users\A\.cargo\registry\src\index.crates.io-6f17d22bba15001f\packed_simd_2-0.3.8\src\codegen\llvm.rs:11:5
   |
11 |     pub fn simd_shuffle4<T, U>(x: T, y: T, idx: [u32; 4]) -> U;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: unrecognized platform-specific intrinsic function: `simd_shuffle8`
  --> C:\Users\A\.cargo\registry\src\index.crates.io-6f17d22bba15001f\packed_simd_2-0.3.8\src\codegen\llvm.rs:12:5
   |
12 |     pub fn simd_shuffle8<T, U>(x: T, y: T, idx: [u32; 8]) -> U;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: unrecognized platform-specific intrinsic function: `simd_shuffle16`
  --> C:\Users\A\.cargo\registry\src\index.crates.io-6f17d22bba15001f\packed_simd_2-0.3.8\src\codegen\llvm.rs:13:5
   |
13 |     pub fn simd_shuffle16<T, U>(x: T, y: T, idx: [u32; 16]) -> U;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: unrecognized platform-specific intrinsic function: `simd_shuffle32`
  --> C:\Users\A\.cargo\registry\src\index.crates.io-6f17d22bba15001f\packed_simd_2-0.3.8\src\codegen\llvm.rs:14:5
   |
14 |     pub fn simd_shuffle32<T, U>(x: T, y: T, idx: [u32; 32]) -> U;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: unrecognized platform-specific intrinsic function: `simd_shuffle64`
  --> C:\Users\A\.cargo\registry\src\index.crates.io-6f17d22bba15001f\packed_simd_2-0.3.8\src\codegen\llvm.rs:15:5
   |
15 |     pub fn simd_shuffle64<T, U>(x: T, y: T, idx: [u32; 64]) -> U;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: could not compile `packed_simd_2` (lib) due to 6 previous errors

@glandium
Copy link
Contributor Author

@AlifianK that's fixed in the latest version of packed_simd, which switched names back(?) from packed_simd_2.

@apiraino apiraino added the regression-from-stable-to-beta Performance or correctness regression from stable to beta. label Aug 17, 2023
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Aug 17, 2023
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Aug 17, 2023
@Mark-Simulacrum Mark-Simulacrum added this to the 1.72.0 milestone Aug 18, 2023
@Mark-Simulacrum
Copy link
Member

Should be fixed by #113529 on beta and 1.73 (current nightly).

@Noratrieb Noratrieb removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants