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]

[PowerPC64] Fix FAIL: ExtraClassLoader execution - gij test


Fixes two libjava testsuite failures on powerpc64-linux.  Bootstrapped
and regression tested powerpc64-linux and powerpc-linux.  OK for 4.1 and
4.2?

	* stacktrace.cc (UnwindTraceFn): For powerpc64, compare the function
	code entry not the function descriptor against _Unwind_GetRegionStart.

Index: libjava/stacktrace.cc
===================================================================
--- libjava/stacktrace.cc	(revision 107640)
+++ libjava/stacktrace.cc	(working copy)
@@ -117,7 +117,16 @@ _Jv_StackTrace::UnwindTraceFn (struct _U
   // correspondance between call frames in the interpreted stack and occurances
   // of _Jv_InterpMethod::run() on the native stack.
 #ifdef INTERPRETER
-  if ((void (*)(void)) func_addr == (void (*)(void)) &_Jv_InterpMethod::run)
+#ifdef __powerpc64__
+  // A powerpc64 function pointer is a pointer to the function descriptor.
+  // _Unwind_GetRegionStart returns a code address, so read the function entry.
+  bool is_interp_run
+    = func_addr == *reinterpret_cast<_Unwind_Ptr *> (&_Jv_InterpMethod::run);
+#else
+  bool is_interp_run
+    = (void (*)(void)) func_addr == (void (*)(void)) &_Jv_InterpMethod::run;
+#endif
+  if (is_interp_run)
     {
       state->frames[pos].type = frame_interpreter;
       state->frames[pos].interp.meth = state->interp_frame->self;

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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