Currently we don't emit any CFI instructions for the SCS register when
enabling SCS on RISCV. This causes problems when unwinding, since the
SCS register isn't being handled properly.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | ||
---|---|---|
84 | This is only safe to do with a one-byte buffer since you know the value fits. |
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | ||
---|---|---|
88 | Definitely don't use bregx. That takes another byte and CFI size is precious. Just use DW_OP_breg0 + n after an assertion that n < 32 because it actually is (it's 18 and will only ever be 18). |
Address comments
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | ||
---|---|---|
88 | I don't see a good way to not directly encode the length of the following expression without making this much more complex. |
This is only safe to do with a one-byte buffer since you know the value fits.
It should at the very least have an assertion that encodeSLEB128 returned 1.
But just using -SlotSize & 0x7f would be more clearly safe.