Skip to content

cranelift: fix backend limit diagnostics#158827

Open
Dnreikronos wants to merge 4 commits into
rust-lang:mainfrom
Dnreikronos:cranelift/backend_limit_diagnostics
Open

cranelift: fix backend limit diagnostics#158827
Dnreikronos wants to merge 4 commits into
rust-lang:mainfrom
Dnreikronos:cranelift/backend_limit_diagnostics

Conversation

@Dnreikronos

@Dnreikronos Dnreikronos commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

fixes #158801

cg_clif was reporting cranelift impl-limit failures through earlydiagctxt. that printed the backend error, but it never reached the session dcx, so join_codegen could still hit the worker-thread ice.

the fix routes those failures through the shared emitter/session dcx path. verifier failures also use one fatal diagnostic, so the pretty verifier text does not get lost behind an earlier queued error.

imo this is the least weird fix because the backend limit itself is fine; the bad part was the diagnostic plumbing. i added both a cg_clif harness check and a cranelift-gated ui fixture. idk if we keep both forever, but they make the regression pretty obvious. ltm if you want the ui one dropped.

@rustbot

rustbot commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

rustc_codegen_cranelift is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_cranelift instead.

cc @bjorn3

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 5, 2026
@rustbot

rustbot commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

r? @chenyukang

rustbot has assigned @chenyukang.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 21 candidates

@bjorn3

bjorn3 commented Jul 6, 2026

Copy link
Copy Markdown
Member

Thanks for figuring out why this ICE happened! Could you open this PR against https://github.com/rust-lang/rustc_codegen_cranelift/ to reduce the risk of conflicts during the next subtree sync? That is where development of cg_clif happens. I did be fine with omitting the test. I don't think it is that likely to regress in the future and it is just an ICE and not a miscompilation anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: expected abort due to worker thread errors with rediculous repr(align())

4 participants