This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

3.4 PATCH: Fix Tru64 UNIX libjava bootstrap failure in java/lang/natObject.cc


Current mainline failed to bootstrap on alpha-dec-osf4.0f and
alpha-dec-osf5.1:

/vol/gnu/src/gcc/gcc-dist/libjava/java/lang/natObject.cc: In function `bool _Jv_ObjectCheckMonitor(java::lang::Object*)':
/vol/gnu/src/gcc/gcc-dist/libjava/java/lang/natObject.cc:1130: error: ISO C++ forbids comparison between pointer and integer

This is the following test

      not_mine = hl ? (hl->si.mutex.owner != self) : true;

where hl->si.mutex.owner is pthread_t (a pointer to some structure on
Tru64 UNIX), self is _Jv_ThreadId_t (typedef'ed to unsigned long).

The following patch fixes this and allowed the bootstrap to finish.  There
are several libjava testsuite regressions compared to my last successful
bootstrap on 20030925, but they are almost certainly unrelated:

FAIL: ArrayClass -O3 compilation from bytecode

ArrayClass.java: In class `ArrayClass':
ArrayClass.java: In method `class$(java.lang.String)':
ArrayClass.java:0: internal compiler error: in cgraph_function_possibly_inlined_p, at cgraph.c:541

They happen on several other platforms (e.g. i386-pc-solaris2.10,
mips-sgi-irix6.5) as well, even when POSIX Threads are not in use, but only
at -O3.

Ok for mainline?

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University



Thu Oct 23 02:27:28 2003  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* java/lang/natObject.cc (_Jv_ObjectCheckMonitor): Use
	_Jv_MutexCheckMonitor instead of accessing mutex.owner directly.

Index: libjava/java/lang/natObject.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natObject.cc,v
retrieving revision 1.28
diff -u -p -r1.28 natObject.cc
--- libjava/java/lang/natObject.cc	21 Oct 2003 04:46:19 -0000	1.28
+++ libjava/java/lang/natObject.cc	23 Oct 2003 20:04:19 -0000
@@ -1127,7 +1127,7 @@ retry:
   else
     {
       heavy_lock* hl = find_heavy(addr, he);
-      not_mine = hl ? (hl->si.mutex.owner != self) : true;
+      not_mine = hl ? _Jv_MutexCheckMonitor(&hl->si.mutex) : true;
     }
 
   release_set(&(he -> address), address);	// unlock hash entry


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