gcj/321

Jeff Sturm jsturm@detroit.appnet.com
Fri Aug 18 14:50:00 GMT 2000


The following reply was made to PR gcj/321; it has been noted by GNATS.

From: Jeff Sturm <jsturm@detroit.appnet.com>
To: java-gnats@sourceware.cygnus.com, apbianco@cygnus.com
Cc: aph@cygnus.com
Subject: Re: gcj/321
Date: Fri, 18 Aug 2000 17:46:24 -0400

 I looked closer at this.  The
 
 #define int32 long
 
 is necessary, though it looks wrong, because tree pointers are stored in jword
 types (ick).  Consequently the WORD_TO_INT macro is wrong:
 
 /* Sign extend w. */
 static inline jint
 WORD_TO_INT(jword w)
 {
   jint n = w;
   n ^= (jint)1 << 31;
   n -= (jint)1 << 31;
   return n;
 }
 
 I don't really understand the bit arithmetic used there, though it is clearly
 intended for 32-bit types.  Anyway, the comment is probably wrong... there's no
 real "sign extend" taking place since jword and jint are always both the same
 size as an int32.  A simple cast ought to work, and indeed works for me.
 
 (I'm Cc:'ing Andrew since he originally committed the WORD_TO_INT function.)
 
 
 http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=321&database=java
 
 --
 Jeff Sturm
 jeff.sturm@appnet.com


More information about the Java-prs mailing list