[PATCH] D126392: [RISCV] Use two ADDIs to do some stack pointer adjustments.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 25 11:40:31 PDT 2022


craig.topper planned changes to this revision.
craig.topper added a comment.

In D126392#3537748 <https://reviews.llvm.org/D126392#3537748>, @jrtc27 wrote:

> Doesn't this run the risk of temporarily misaligning the stack (e.g. for Val == 2064)? The psABI says using such a non-standard ABI //within// a function is fine and that kernels should realign stacks before calling signal handlers. Both FreeBSD and Linux correctly do this for signal handlers so as to not make assumptions about whether userspace is following the standard ABI, but both assume that the kernel itself is following the standard ABI, and so do not realign the stack in their exception entry points, causing the stack to be misaligned if an interrupt is taken in between. Whether this is a bug or not in the kernels is debatable, but with a more careful splitting of Val it should be possible to avoid anyway, with the exception of 4080?

Good point. I copied the split from what we do in isel without thinking about it. I'll try a better split.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126392/new/

https://reviews.llvm.org/D126392



More information about the llvm-commits mailing list