Skip to content

Cranelift: Huge stack slot results in panic rather than an error returned from codegen #7916

@bjorn3

Description

@bjorn3

.clif Test Case

test compile
target x86_64

function u0:12() system_v {
    ss0 = explicit_slot 1073741824
    ss1 = explicit_slot 16
    ss2 = explicit_slot 1073741824
    ss3 = explicit_slot 16
    ss4 = explicit_slot 48

block0:
    v21 = stack_load.i8 ss3
    trap user0
}

Steps to Reproduce

  • Compile above test.

Expected Results

Returns an error from compile_function.

Actual Results

Panics with Offset in NominalSPOffset is greater than 2GB; should hit impl limit first: TryFromIntError(())

Versions and Environment

Cranelift version or commit: 0.104

Operating system: N/A

Architecture: x86_64

Extra Info

Reported by @matthiaskrgr at rust-lang/rustc_codegen_cranelift#1434

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behavior in the current implementation that needs fixingcraneliftIssues related to the Cranelift code generator

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions