[compiler-rt] r331734 - Revert "[sanitizer] Be more accurate when calculating the previous instruction address on ARM."

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Mon May 7 21:39:00 PDT 2018


Author: ikudrin
Date: Mon May  7 21:39:00 2018
New Revision: 331734

URL: http://llvm.org/viewvc/llvm-project?rev=331734&view=rev
Log:
Revert "[sanitizer] Be more accurate when calculating the previous instruction address on ARM."

This reverts commit r331626 because it causes build bot failures:
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/5069

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

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

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.h?rev=331734&r1=331733&r2=331734&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.h Mon May  7 21:39:00 2018
@@ -75,11 +75,10 @@ struct StackTrace {
 ALWAYS_INLINE
 uptr StackTrace::GetPreviousInstructionPc(uptr pc) {
 #if defined(__arm__)
-  // T32 (Thumb) branch instructions can be 16 or 32 bit long,
-  // so we return (pc-2) in that case in order to be safe.
-  // For A32 mode we return (pc-4) because all instructions are 32 bit long.
-  return (pc - 3) & (~1);
-#elif defined(__powerpc__) || defined(__powerpc64__) || defined(__aarch64__)
+  // Cancel Thumb bit.
+  pc = pc & (~1);
+#endif
+#if defined(__powerpc__) || defined(__powerpc64__)
   // PCs are always 4 byte aligned.
   return pc - 4;
 #elif defined(__sparc__) || defined(__mips__)




More information about the llvm-commits mailing list