https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64999

--- Comment #51 from boger at us dot ibm.com ---
Here is the change I made to go-callers.c.  This patch along with my previous
changes to extern.go and pprof.go allows the test identified in this issue to
report the correct line number on ppc64le.  I wanted to post it here for
comments before I do the bootstrap build and test on ppc64 and ppc64le in case
there is a concern with using an #if defined.  This is in libgo/runtime and I
didn't see any other examples where it used the GOARCH value in C code so that
is why I did it this way.

===================================================================
--- libgo/runtime/go-callers.c  (revision 221039)
+++ libgo/runtime/go-callers.c  (working copy)
@@ -83,6 +83,10 @@ callback (void *data, uintptr_t pc, const char *fi
     }

   loc = &arg->locbuf[arg->index];
+#if defined(__powerpc64__) || defined(__s390__) || defined(__s390x__)
+  if ((pc & 1) == 1)
+    pc++;
+#endif
   loc->pc = pc;

   /* The libbacktrace library says that these strings might disappear,

Reply via email to