Skip to content

Wrapping simd call results in compiler panic (nightly) #59469

Closed
@dignifiedquire

Description

@dignifiedquire

Expected the following code to compile

#[cfg(target_arch = "x86")]
use core::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use core::arch::x86_64::*;

unsafe fn pclmul(a: __m128i, b: __m128i, imm8: i32) -> __m128i {
    _mm_clmulepi64_si128(a, b, imm8)
}

But getting

Standard Error

   Compiling playground v0.0.1 (/playground)
thread 'rustc' panicked at 'index out of bounds: the len is 2 but the index is 3', /rustc/fbd34efb32b9efb574899e4335bdc8c6525ac27e/src/libcore/slice/mod.rs:2539:10
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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.35.0-nightly (fbd34efb3 2019-03-26) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `playground`.

To learn more, run the command again with --verbose.

Repro:

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=36e55f5180a9cf903585dead5b4c2a8d

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions