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

ICE: panicked at 'index 8 is out-of-bounds of vector type i8 with length 1', #83697

Closed
chengniansun opened this issue Mar 31, 2021 · 1 comment
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. 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.

Comments

@chengniansun
Copy link

Code

#![feature(platform_intrinsics)]
#![feature(staged_api)]
struct i8x1(i8);
extern "platform-intrinsic" {
    #[rustc_const_stable(feature = "foo", since = "1.3.37")]
    fn simd_extract<T, U>(x: T, idx: u32) -> U;
}
fn main() {
    const U: i8x1 = i8x1(13);
    const V: i8x1 = U;
    const Y0: i8 = unsafe { simd_extract(V, 8) };
}

Meta

rustc --version --verbose:

rustc 1.53.0-nightly (74874a690 2021-03-30)
binary: rustc
commit-hash: 74874a690bc95443292496ff5df5cc5c8cb56e0b
commit-date: 2021-03-30
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0

Error output

warning: type `i8x1` should have an upper camel case name
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:3:8
  |
3 | struct i8x1(i8);
  |        ^^^^ help: convert the identifier to upper camel case (notice the capitalization): `I8x1`
  |
  = note: `#[warn(non_camel_case_types)]` on by default

warning: struct is never constructed: `i8x1`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:3:8
  |
3 | struct i8x1(i8);
  |        ^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: function is never used: `simd_extract`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:6:5
  |
6 |     fn simd_extract<T, U>(x: T, idx: u32) -> U;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: constant is never used: `U`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:9:5
  |
9 |     const U: i8x1 = i8x1(13);
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^

warning: constant is never used: `V`
  --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:10:5
   |
10 |     const V: i8x1 = U;
   |     ^^^^^^^^^^^^^^^^^^

warning: constant is never used: `Y0`
  --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:11:5
   |
11 |     const Y0: i8 = unsafe { simd_extract(V, 8) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: module has missing stability attribute
  --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
   |
1  | / #![feature(platform_intrinsics)]
2  | | #![feature(staged_api)]
3  | | struct i8x1(i8);
4  | | extern "platform-intrinsic" {
...  |
11 | |     const Y0: i8 = unsafe { simd_extract(V, 8) };
12 | | }
   | |_^

thread 'rustc' panicked at 'index `8` is out-of-bounds of vector type `i8` with length `1`', compiler/rustc_mir/src/interpret/intrinsics.rs:447:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

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.53.0-nightly (74874a690 2021-03-30) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `main::Y0`
#1 [eval_to_const_value_raw] simplifying constant for the type system `main::Y0`
end of query stack
error: aborting due to previous error; 6 warnings emitted
Backtrace

warning: type `i8x1` should have an upper camel case name
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:3:8
  |
3 | struct i8x1(i8);
  |        ^^^^ help: convert the identifier to upper camel case (notice the capitalization): `I8x1`
  |
  = note: `#[warn(non_camel_case_types)]` on by default

warning: struct is never constructed: `i8x1`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:3:8
  |
3 | struct i8x1(i8);
  |        ^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: function is never used: `simd_extract`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:6:5
  |
6 |     fn simd_extract<T, U>(x: T, idx: u32) -> U;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: constant is never used: `U`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:9:5
  |
9 |     const U: i8x1 = i8x1(13);
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^

warning: constant is never used: `V`
  --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:10:5
   |
10 |     const V: i8x1 = U;
   |     ^^^^^^^^^^^^^^^^^^

warning: constant is never used: `Y0`
  --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:11:5
   |
11 |     const Y0: i8 = unsafe { simd_extract(V, 8) };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: module has missing stability attribute
  --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
   |
1  | / #![feature(platform_intrinsics)]
2  | | #![feature(staged_api)]
3  | | struct i8x1(i8);
4  | | extern "platform-intrinsic" {
...  |
11 | |     const Y0: i8 = unsafe { simd_extract(V, 8) };
12 | | }
   | |_^

thread 'rustc' panicked at 'index `8` is out-of-bounds of vector type `i8` with length `1`', compiler/rustc_mir/src/interpret/intrinsics.rs:447:17
stack backtrace:
   0: rust_begin_unwind
             at /rustc/74874a690bc95443292496ff5df5cc5c8cb56e0b/library/std/src/panicking.rs:493:5
   1: std::panicking::begin_panic_fmt
             at /rustc/74874a690bc95443292496ff5df5cc5c8cb56e0b/library/std/src/panicking.rs:435:5
   2: rustc_mir::interpret::intrinsics::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::emulate_intrinsic
   3: <rustc_mir::const_eval::machine::CompileTimeInterpreter as rustc_mir::interpret::machine::Machine>::call_intrinsic
   4: rustc_mir::interpret::terminator::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::eval_fn_call
   5: rustc_mir::interpret::step::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::run
   6: rustc_mir::const_eval::eval_queries::eval_to_allocation_raw_provider
   7: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::eval_to_allocation_raw>::compute
   8: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
   9: rustc_data_structures::stack::ensure_sufficient_stack
  10: rustc_query_system::query::plumbing::force_query_with_job
  11: rustc_query_system::query::plumbing::get_query_impl
  12: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::eval_to_allocation_raw
  13: rustc_mir::const_eval::eval_queries::eval_to_const_value_raw_provider
  14: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::eval_to_const_value_raw>::compute
  15: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  16: rustc_data_structures::stack::ensure_sufficient_stack
  17: rustc_query_system::query::plumbing::force_query_with_job
  18: rustc_query_system::query::plumbing::get_query_impl
  19: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::eval_to_const_value_raw
  20: rustc_mir::const_eval::eval_queries::eval_to_const_value_raw_provider
  21: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::eval_to_const_value_raw>::compute
  22: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  23: rustc_data_structures::stack::ensure_sufficient_stack
  24: rustc_query_system::query::plumbing::force_query_with_job
  25: rustc_query_system::query::plumbing::get_query_impl
  26: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::eval_to_const_value_raw
  27: rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_global_id
  28: rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_poly
  29: <rustc_lint::BuiltinCombinedLateLintPass as rustc_lint::passes::LateLintPass>::check_item
  30: rustc_hir::intravisit::Visitor::visit_nested_item
  31: rustc_hir::intravisit::walk_block
  32: rustc_hir::intravisit::walk_expr
  33: rustc_hir::intravisit::walk_body
  34: rustc_hir::intravisit::walk_fn
  35: rustc_hir::intravisit::walk_item
  36: rustc_hir::intravisit::Visitor::visit_nested_item
  37: rustc_hir::intravisit::walk_crate
  38: rustc_lint::late::late_lint_crate
  39: rustc_data_structures::sync::join
  40: std::panic::catch_unwind
  41: rustc_session::utils::<impl rustc_session::session::Session>::time
  42: rustc_interface::passes::analysis
  43: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  44: rustc_data_structures::stack::ensure_sufficient_stack
  45: rustc_query_system::query::plumbing::force_query_with_job
  46: rustc_query_system::query::plumbing::get_query_impl
  47: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  48: rustc_interface::passes::QueryContext::enter
  49: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  50: rustc_span::with_source_map
  51: rustc_interface::interface::create_compiler_and_run
  52: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

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.53.0-nightly (74874a690 2021-03-30) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `main::Y0`
#1 [eval_to_const_value_raw] simplifying constant for the type system `main::Y0`
#2 [eval_to_const_value_raw] simplifying constant for the type system `main::Y0`
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error; 6 warnings emitted

@chengniansun chengniansun 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 Mar 31, 2021
fanninpm added a commit to fanninpm/glacier that referenced this issue Apr 2, 2021
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Apr 2, 2021
@Alexendoo
Copy link
Member

Original can still ice with the addition of a stability gate, but closing for the same reason as #94382

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. glacier ICE tracked in rust-lang/glacier. 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.
Projects
None yet
Development

No branches or pull requests

3 participants