This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PowerPC64] Fix FAIL: ExtraClassLoader execution - gij test
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Date: Wed, 30 Nov 2005 13:41:30 +1030
- Subject: [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