[PATCH] D120432: [sanitizer][sancov] Use pc-1 for s390x
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 23 13:35:43 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG632ea6929d5c: [sanitizer][sancov] Use pc-1 for s390x (authored by MaskRay).
Changed prior to commit:
https://reviews.llvm.org/D120432?vs=410916&id=410927#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120432/new/
https://reviews.llvm.org/D120432
Files:
compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cpp
compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
compiler-rt/test/tsan/test.h
llvm/tools/sancov/sancov.cpp
Index: llvm/tools/sancov/sancov.cpp
===================================================================
--- llvm/tools/sancov/sancov.cpp
+++ llvm/tools/sancov/sancov.cpp
@@ -698,7 +698,7 @@
return PC - 8;
if (TheTriple.isRISCV())
return PC - 2;
- if (TheTriple.isX86())
+ if (TheTriple.isX86() || TheTriple.isSystemZ())
return PC - 1;
return PC - 4;
}
Index: compiler-rt/test/tsan/test.h
===================================================================
--- compiler-rt/test/tsan/test.h
+++ compiler-rt/test/tsan/test.h
@@ -69,13 +69,12 @@
#endif
//The const kPCInc must be in sync with StackTrace::GetPreviousInstructionPc
-#if defined(__powerpc64__) || defined(__arm__) || defined(__aarch64__)
-// PCs are always 4 byte aligned.
-const int kPCInc = 4;
+#if defined(__s390__) || defined(__i386__) || defined(__x86_64__)
+const int kPCInc = 1;
#elif defined(__sparc__) || defined(__mips__)
const int kPCInc = 8;
#else
-const int kPCInc = 1;
+const int kPCInc = 4;
#endif
#ifdef __cplusplus
Index: compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
+++ compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
@@ -98,7 +98,7 @@
// It seems difficult to figure out the exact instruction length -
// pc - 2 seems like a safe option for the purposes of stack tracing
return pc - 2;
-#elif SANITIZER_I386 || SANITIZER_X32 || SANITIZER_X64
+#elif SANITIZER_S390 || SANITIZER_I386 || SANITIZER_X32 || SANITIZER_X64
return pc - 1;
#else
return pc - 4;
Index: compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cpp
+++ compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cpp
@@ -46,7 +46,7 @@
}
// bail-out if could not figure out the instruction size
return 0;
-#elif SANITIZER_I386 || SANITIZER_X32 || SANITIZER_X64
+#elif SANITIZER_S390 || SANITIZER_I386 || SANITIZER_X32 || SANITIZER_X64
return pc + 1;
#else
return pc + 4;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120432.410927.patch
Type: text/x-patch
Size: 2155 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220223/34335305/attachment.bin>
More information about the llvm-commits
mailing list