================ @@ -305,9 +305,22 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext) mflr 0 std 0, PPC64_OFFS_SRR0(3) // store lr as ssr0 PPC64_STR(1) + PPC64_STR(4) // Save r4 first since it will be used for fixing r2. +#if defined(_AIX) + // The TOC register (r2) was changed by the glue code if unw_getcontext + // is called from a different module. Save the original TOC register + // in the context if this is the case. + mflr 4 ---------------- xingxue-ibm wrote:
Yes, `r0` has `LR` at this point and `mflr 4` has the same effect as `mr 4, 0` here. FWIW, I thought using `mflr 4` directly in the same new code block might make it a little easier for readers. If you think `mr 4, 0` is better, I can make the change. https://github.com/llvm/llvm-project/pull/66549 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits