-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
Consider this code:
#![feature(no_core, lang_items,start)]
#![no_std]
#![no_core]
#[lang="sized"] trait Sized {}
#[lang="copy"] trait Copy {}
#[repr(u64)]
enum A {
A = 0u64,
B = !0u64,
}
fn cmp() -> A {
A::B
}
#[start]
fn main(b:isize, a: *const *const u8)->isize { 0 }
if compiled targetting i686
target, this ICEs with
error: internal compiler error: ../src/librustc_trans/mir/operand.rs:82: impossible case reached
This is because ABI code claims that this u64 enum has to be returned via value (i.e. ret i64 %smth
):
FnType { args: [], ret: ArgType { kind: Direct, original_ty: i64, ty: i64, signedness: Some(false), cast: None, ... }
Whereas MIR only has OperandRef(Ref(...))
because the common::is_immediate_type
returns false for this enum. Calling immediate()
on this OperandRef
then causes this ICE.
This is a regression from the old->MIR trans move.
Metadata
Metadata
Assignees
Labels
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.