This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Do not build libsanitizer also for powerpc*-*-linux*


Looks like now function does not return anything for ARM case? I'd say we should replace this pc = ... with return like all other cases, the code is just asking for trouble.

--- libsanitizer/sanitizer_common/sanitizer_stacktrace.cc	(revision 209878)
+++ libsanitizer/sanitizer_common/sanitizer_stacktrace.cc	(revision 209879)
@@ -18,11 +18,13 @@
  namespace __sanitizer {

  uptr StackTrace::GetPreviousInstructionPc(uptr pc) {
-#ifdef __arm__
+#if defined(__arm__)
    // Cancel Thumb bit.
    pc = pc & (~1);
-#endif
-#if defined(__sparc__)
+#elif defined(__powerpc__) || defined(__powerpc64__)
+  // PCs are always 4 byte aligned.
+  return pc - 4;
+#elif defined(__sparc__)
    return pc - 8;
  #else
    return pc - 1;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]