[all-commits] [llvm/llvm-project] 659029: [ARM] __cxa_end_cleanup: avoid clobbering r4

Ryan Prichard via All-commits all-commits at lists.llvm.org
Mon Mar 14 15:45:08 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 659029302dfb16a29219f931f66e9ad483ad1445
      https://github.com/llvm/llvm-project/commit/659029302dfb16a29219f931f66e9ad483ad1445
  Author: Ryan Prichard <rprichard at google.com>
  Date:   2022-03-14 (Mon, 14 Mar 2022)

  Changed paths:
    M libcxxabi/src/cxa_exception.cpp

  Log Message:
  -----------
  [ARM] __cxa_end_cleanup: avoid clobbering r4

The fix for D111703 clobbered r4 both to:
 - Save/restore the original lr.
 - Load the address of _Unwind_Resume for LIBCXXABI_BAREMETAL.

This patch saves and restores lr without clobbering any extra
registers.

For LIBCXXABI_BAREMETAL, it is still necessary to clobber one extra
register to hold the address of _Unwind_Resume, but it seems better to
use ip/r12 (intended for linker veneers/trampolines) than r4 for this
purpose.

The function also clobbers r0 for the _Unwind_Resume function's
parameter, but that is unavoidable.

Reviewed By: danielkiss, logan, MaskRay

Differential Revision: https://reviews.llvm.org/D121432




More information about the All-commits mailing list