Skip to content

[RISC-V] Bad immediate value for Zcmp instructions with E extension #84925

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

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

nemanjai
Copy link
Member

When we are using the Zcmp extension together with the E extension in 32-bit mode and we need to spill both callee-saved registers as well as needing a couple of 32-bit stack slots, we emit a meaningless stack adjustment with cm.push/cm.popret. Furthermore this leads to the stack slot for the ra being clobbered so control returns to a random location.

This is just a pre-commit test so that the PR for the fix shows the difference in code generation.

When we are using the Zcmp extension together with the E extension
in 32-bit mode and we need to spill both callee-saved registers
as well as needing a couple of 32-bit stack slots, we emit a
meaningless stack adjustment with cm.push/cm.popret. Furthermore
this leads to the stack slot for the ra being clobbered so
control returns to a random location.

This is just a pre-commit test so that the PR for the fix
shows the difference in code generation.
@nemanjai nemanjai requested review from topperc and wangpc-pp March 12, 2024 14:49
@nemanjai nemanjai merged commit 08dd645 into llvm:main Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant