[compiler-rt] r298029 - Revert "[PowerPC] Fix sanitizer frame unwind on 32-bit ABIs"

Juergen Ributzka via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 18:15:39 PDT 2017


Author: ributzka
Date: Thu Mar 16 20:15:39 2017
New Revision: 298029

URL: http://llvm.org/viewvc/llvm-project?rev=298029&view=rev
Log:
Revert "[PowerPC] Fix sanitizer frame unwind on 32-bit ABIs"

This broke GreenDragon:
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/29210/

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc?rev=298029&r1=298028&r2=298029&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc Thu Mar 16 20:15:39 2017
@@ -79,22 +79,15 @@ void BufferedStackTrace::FastUnwindStack
   while (IsValidFrame((uptr)frame, stack_top, bottom) &&
          IsAligned((uptr)frame, sizeof(*frame)) &&
          size < max_depth) {
-     // PowerPC ABIs specify that the return address is saved on the
-     // *caller's* stack frame.  Thus we must dereference the back chain
-     // to find the caller frame before extracting it.
-     uhwptr *caller_frame = (uhwptr*)frame[0];
-     if (!IsValidFrame((uptr)caller_frame, stack_top, bottom) ||
-         !IsAligned((uptr)caller_frame, sizeof(uhwptr)))
-       break;
 #ifdef __powerpc__
-    // For most ABIs the offset where the return address is saved is two
-    // register sizes.  The exception is the SVR4 ABI, which uses an
-    // offset of only one register size.
-#ifdef _CALL_SYSV
-    uhwptr pc1 = caller_frame[1];
-#else
+    // PowerPC ABIs specify that the return address is saved at offset
+    // 16 of the *caller's* stack frame.  Thus we must dereference the
+    // back chain to find the caller frame before extracting it.
+    uhwptr *caller_frame = (uhwptr*)frame[0];
+    if (!IsValidFrame((uptr)caller_frame, stack_top, bottom) ||
+        !IsAligned((uptr)caller_frame, sizeof(uhwptr)))
+      break;
     uhwptr pc1 = caller_frame[2];
-#endif
 #elif defined(__s390__)
     uhwptr pc1 = frame[14];
 #else




More information about the llvm-commits mailing list