rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.43k stars 12.73k forks source link

ICE: unknown intrinsic #94379

Open matthiaskrgr opened 2 years ago

matthiaskrgr commented 2 years ago

Code

#![crate_type = "staticlib"]
#![feature(core_intrinsics)]
use std::intrinsics::rustc_peek;
#[no_mangle]
fn foo() -> i32 {
    let x = 0;
    rustc_peek(x)
}

Meta

rustc --version --verbose:

rustc 1.61.0-nightly (4b043faba 2022-02-24)
binary: rustc
commit-hash: 4b043faba34ccc053a4d0110634c323f6c03765e
commit-date: 2022-02-24
host: x86_64-unknown-linux-gnu
release: 1.61.0-nightly
LLVM version: 14.0.0

Error output

Backtrace

``` error: internal compiler error: compiler/rustc_codegen_llvm/src/intrinsic.rs:370:18: unknown intrinsic 'rustc_peek' thread 'rustc' panicked at 'Box', compiler/rustc_errors/src/lib.rs:1160:9 stack backtrace: 0: 0x7fd004afdd4c - std::backtrace_rs::backtrace::libunwind::trace::h853a1389f6e5e745 at /rustc/4b043faba34ccc053a4d0110634c323f6c03765e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5 1: 0x7fd004afdd4c - std::backtrace_rs::backtrace::trace_unsynchronized::h141fba7f3343285a at /rustc/4b043faba34ccc053a4d0110634c323f6c03765e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x7fd004afdd4c - std::sys_common::backtrace::_print_fmt::h3413d0b0d4b31c4c at /rustc/4b043faba34ccc053a4d0110634c323f6c03765e/library/std/src/sys_common/backtrace.rs:66:5 3: 0x7fd004afdd4c - ::fmt::hbc867a15ccd0341f at /rustc/4b043faba34ccc053a4d0110634c323f6c03765e/library/std/src/sys_common/backtrace.rs:45:22 4: 0x7fd004b5d9fc - core::fmt::write::h35157148513e92bc at /rustc/4b043faba34ccc053a4d0110634c323f6c03765e/library/core/src/fmt/mod.rs:1190:17 5: 0x7fd004aede78 - std::io::Write::write_fmt::hc5517132c5cecddc at /rustc/4b043faba34ccc053a4d0110634c323f6c03765e/library/std/src/io/mod.rs:1657:15 6: 0x7fd004b01d27 - std::sys_common::backtrace::_print::hc5f683d445b22529 at /rustc/4b043faba34ccc053a4d0110634c323f6c03765e/library/std/src/sys_common/backtrace.rs:48:5 7: 0x7fd004b01d27 - std::sys_common::backtrace::print::hd841ed3190824cc9 at /rustc/4b043faba34ccc053a4d0110634c323f6c03765e/library/std/src/sys_common/backtrace.rs:35:9 8: 0x7fd004b01d27 - std::panicking::default_hook::{{closure}}::h9a0c56b9dbc35012 at /rustc/4b043faba34ccc053a4d0110634c323f6c03765e/library/std/src/panicking.rs:295:22 9: 0x7fd004b019df - std::panicking::default_hook::hc46807a97c7de333 at /rustc/4b043faba34ccc053a4d0110634c323f6c03765e/library/std/src/panicking.rs:314:9 10: 0x7fd0052930d1 - rustc_driver[442ed871d20551d1]::DEFAULT_HOOK::{closure#0}::{closure#0} 11: 0x7fd004b025f6 - std::panicking::rust_panic_with_hook::h1ad2fcf54bcf9bb5 at /rustc/4b043faba34ccc053a4d0110634c323f6c03765e/library/std/src/panicking.rs:702:17 12: 0x7fd0062fcf11 - std[2a6da251afaa3124]::panicking::begin_panic::::{closure#0} 13: 0x7fd0062fce76 - std[2a6da251afaa3124]::sys_common::backtrace::__rust_end_short_backtrace::::{closure#0}, !> 14: 0x7fd00630337f - std[2a6da251afaa3124]::panicking::begin_panic:: 15: 0x7fd0063104ad - std[2a6da251afaa3124]::panic::panic_any:: 16: 0x7fd00630f737 - ::bug 17: 0x7fd00630f230 - ::bug 18: 0x7fd0062667d9 - rustc_middle[cef953e2dc6653d0]::ty::context::tls::with_opt::::{closure#0}, ()> 19: 0x7fd006266a70 - rustc_middle[cef953e2dc6653d0]::util::bug::opt_span_bug_fmt:: 20: 0x7fd0062669e6 - rustc_middle[cef953e2dc6653d0]::util::bug::bug_fmt 21: 0x7fd0071342e0 - ::codegen_intrinsic_call 22: 0x7fd007145736 - >::codegen_intrinsic_call 23: 0x7fd0064b0d2c - rustc_codegen_ssa[795ae6073e3d8cbc]::mir::codegen_mir:: 24: 0x7fd00646fb02 - rustc_codegen_llvm[fbf752d051d739ba]::base::compile_codegen_unit::module_codegen 25: 0x7fd0070f75f2 - rustc_codegen_llvm[fbf752d051d739ba]::base::compile_codegen_unit 26: 0x7fd0071201be - rustc_codegen_ssa[795ae6073e3d8cbc]::base::codegen_crate:: 27: 0x7fd0070e403a - ::codegen_crate 28: 0x7fd0070d3b67 - ::time::, rustc_interface[65caae14b4217ef3]::passes::start_codegen::{closure#0}> 29: 0x7fd0070bba46 - ::enter::<::ongoing_codegen::{closure#0}::{closure#0}, core[a2af605994515733]::result::Result, rustc_errors[1b480dc045645b1a]::ErrorReported>> 30: 0x7fd0070b1edf - ::ongoing_codegen 31: 0x7fd007089fdd - ::enter::, rustc_errors[1b480dc045645b1a]::ErrorReported>> 32: 0x7fd00708c196 - rustc_span[cac29f2f15677c0e]::with_source_map::, rustc_interface[65caae14b4217ef3]::interface::create_compiler_and_run, rustc_driver[442ed871d20551d1]::run_compiler::{closure#1}>::{closure#1}> 33: 0x7fd0070899b1 - rustc_interface[65caae14b4217ef3]::interface::create_compiler_and_run::, rustc_driver[442ed871d20551d1]::run_compiler::{closure#1}> 34: 0x7fd007075372 - >::set::, rustc_driver[442ed871d20551d1]::run_compiler::{closure#1}>::{closure#0}, core[a2af605994515733]::result::Result<(), rustc_errors[1b480dc045645b1a]::ErrorReported>> 35: 0x7fd007074c2d - std[2a6da251afaa3124]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver[442ed871d20551d1]::run_compiler::{closure#1}>::{closure#0}, core[a2af605994515733]::result::Result<(), rustc_errors[1b480dc045645b1a]::ErrorReported>>::{closure#0}, core[a2af605994515733]::result::Result<(), rustc_errors[1b480dc045645b1a]::ErrorReported>> 36: 0x7fd007073419 - <::spawn_unchecked_, rustc_driver[442ed871d20551d1]::run_compiler::{closure#1}>::{closure#0}, core[a2af605994515733]::result::Result<(), rustc_errors[1b480dc045645b1a]::ErrorReported>>::{closure#0}, core[a2af605994515733]::result::Result<(), rustc_errors[1b480dc045645b1a]::ErrorReported>>::{closure#1} as core[a2af605994515733]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 37: 0x7fd004b0e183 - as core::ops::function::FnOnce>::call_once::hbda7b2dd6cb05b7b at /rustc/4b043faba34ccc053a4d0110634c323f6c03765e/library/alloc/src/boxed.rs:1854:9 38: 0x7fd004b0e183 - as core::ops::function::FnOnce>::call_once::h4e7c4e55f1ee6074 at /rustc/4b043faba34ccc053a4d0110634c323f6c03765e/library/alloc/src/boxed.rs:1854:9 39: 0x7fd004b0e183 - std::sys::unix::thread::Thread::new::thread_start::h272cda2d6cad9954 at /rustc/4b043faba34ccc053a4d0110634c323f6c03765e/library/std/src/sys/unix/thread.rs:108:17 40: 0x7fd004a13259 - start_thread 41: 0x7fd00492f5e3 - __GI___clone 42: 0x0 - note: 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: rustc 1.61.0-nightly (4b043faba 2022-02-24) running on x86_64-unknown-linux-gnu query stack during panic: end of query stack error: aborting due to previous error ```

Dylan-DPC commented 2 years ago

output from cargo-bisect:

********************************************************************************
Regression in nightly-2021-09-02
********************************************************************************

fetching https://static.rust-lang.org/dist/2021-09-01/channel-rust-nightly-git-commit-hash.txt
nightly manifest 2021-09-01: 40 B / 40 B [=============================================================================================] 100.00 % 601.57 KB/s converted 2021-09-01 to 29ef6cf1637aa8317f8911f93f14e18d404c1b0e
fetching https://static.rust-lang.org/dist/2021-09-02/channel-rust-nightly-git-commit-hash.txt
nightly manifest 2021-09-02: 40 B / 40 B [=============================================================================================] 100.00 % 345.56 KB/s converted 2021-09-02 to 50171c310cd15e1b2d3723766ce64e2e4d6696fc
looking for regression commit between 2021-09-01 and 2021-09-02
cloning rust repository
fetching (via local git) commits from 29ef6cf1637aa8317f8911f93f14e18d404c1b0e to 50171c310cd15e1b2d3723766ce64e2e4d6696fc
refreshing repository at "rust.git"
From https://github.com/rust-lang/rust
 * branch                    HEAD       -> FETCH_HEAD
opening existing repository at "rust.git"
looking up first commit
looking up second commit
checking that commits are by bors and thus have ci artifacts...
finding bors merge commits
found 9 bors merge commits in the specified range
  commit[0] 2021-08-31UTC: Auto merge of #88506 - Mark-Simulacrum:fix-rlibs, r=ehuss
  commit[1] 2021-08-31UTC: Auto merge of #88533 - oli-obk:tait_🧊, r=spastorino
  commit[2] 2021-09-01UTC: Auto merge of #87688 - camsteffen:let-else, r=cjgillot
  commit[3] 2021-09-01UTC: Auto merge of #88121 - camelid:better-recursive-alias-error, r=estebank
  commit[4] 2021-09-01UTC: Auto merge of #88272 - willcrichton:mutable-sparse-matrix, r=ecstatic-morse
  commit[5] 2021-09-01UTC: Auto merge of #88556 - m-ou-se:rollup-q636wyd, r=m-ou-se
  commit[6] 2021-09-01UTC: Auto merge of #88395 - ricky26:llvm-submodule, r=nikic
  commit[7] 2021-09-01UTC: Auto merge of #88269 - prconrad:doctest-persist-binaries, r=jyn514
  commit[8] 2021-09-01UTC: Auto merge of #88563 - ehuss:update-cargo-books, r=ehuss