Skip to content

ICE const value has different size than its type #6352

Closed
@ILyoan

Description

@ILyoan

The following test yields an ICE in trans

enum Foo {
    IntVal(i32),
    Int64Val(i64)
}

struct Bar {
    i: i32,
    v: Foo
}

static bar: Bar = Bar { i: 0, v: IntVal(0) };

fn main() {}

{ i32, { i32, i32, [8 x i8] } } { i32 0, { i32, i32, [8 x i8] } { i32 0, i32 0, [8 x i8] undef } }
{ i32, { i32, i64, [0 x i8] } } undef
error: internal compiler error: const expr(29: Bar{i: 0, v: IntVal(0),}) of type Bar has size 20 instead of 24

This error appears on arm target. and probably can appear on x86-32bit machine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️O-androidOperating system: Android

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions