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]

Re: FYI: PR 15713 - interpret.cc aliasing


Ulrich Weigand wrote:

Bryce McKinley wrote:



PR libgcj/15713
* include/jvm.h (_Jv_value): New union type.
* gcj/field.h (_Jv_Field): Add new _addr union field variants * interperet.cc (run): Use _Jv_value union type and *_addr _Jv_Field union members.



This breaks s390(x) and presumably all other big-endian platforms, because this:




- jbyte value = (*(jint*)&rvalue) & 0xff;
- PUSHI (value);



is not at all the same as this:




+ PUSHI (rvalue.byte_value);



except by chance on little-endian platforms.



Yeah - I find it a rather annoying feature of libffi that smaller-than-int return values are promoted to int. Its not the first time I've been tripped up by this ;-)


The patch below fixes this (and two other similiarly wrong changes).
Tested on s390-ibm-linux and s390x-ibm-linux, fixes a bunch of gij failures.

OK?


Yes, thanks for fixing this...

Bye,
Ulrich


ChangeLog:


* interpret.cc (run): Fix bug introduced by last change.



... however this ChangeLog could be a little more descriptive?


Thanks

Bryce


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