FYI: PR 15713 - interpret.cc aliasing

Bryce McKinlay mckinlay@redhat.com
Wed Jul 14 00:57:00 GMT 2004


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



More information about the Gcc-patches mailing list