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

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

Open
bjorn3 opened this issue Feb 12, 2024 · 1 comment
Labels
bug Incorrect behavior in the current implementation that needs fixing cranelift Issues related to the Cranelift code generator

Comments

@bjorn3
Copy link
Contributor

bjorn3 commented Feb 12, 2024

.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

@bjorn3 bjorn3 added bug Incorrect behavior in the current implementation that needs fixing cranelift Issues related to the Cranelift code generator labels Feb 12, 2024
@bjorn3
Copy link
Contributor Author

bjorn3 commented Feb 12, 2024

It looks like the referenced impl limit only applies to arguments passed on the stack, not to local stack slots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior in the current implementation that needs fixing cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

No branches or pull requests

1 participant