[PATCH] D147372: [libunwind][LoongArch] Restore $r1 before $r4 in `jumpto`

Lu Weining via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 2 20:10:51 PDT 2023


SixWeining marked an inline comment as done.
SixWeining added inline comments.


================
Comment at: libunwind/src/UnwindRegistersRestore.S:1225
   ld.d    $r1,  $a0, (8 * 32)  // load new pc into $ra
+  ld.d    $r4,  $a0, (8 * 4)   // restore $a0 last
 
----------------
xen0n wrote:
> Ah now I know why no one has noticed this before. Someone mixed raw register names (`$r1` `r4`) and ABI names (`$ra` `$a0`) so the flaw was not immediately noticeable otherwise.
> 
> So, in order to reduce unnecessary mental burden reading this, I'd suggest changing `$r1` and `$r4` to ABI names while at it. The code change is okay otherwise, thanks for the patch!
Thanks for your suggestion. I have changed them.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147372



More information about the llvm-commits mailing list