[aarch64-port-dev ] Is this a bug in C2?

Andrew Haley aph at redhat.com
Tue Apr 9 09:08:37 UTC 2019


On 4/8/19 3:48 PM, Roland Westrelin wrote:
> 
>> We've recently been bitten by a JDK8 AArch64 back-end bug where
>> constants out of the 0-31 range were matched by int shift patterns. I
>> am surprised to see this: isn't C2 supposed to normalize shifts earlier
>> in processing? We can fix it in the back end, but I'm wondering if we
>> should. Thanks.
> 
> That came up before:
> 
> https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2011-March/004944.html
> 
> (for a review related to arm32).
> 
> "I am concern about masking during ideal transformation. It affects all
> platforms and you will convert a negative value to positive which may
> produce a different result since it may affect some ideal
> transformations. I would suggest to do it in .ad file."
> 
> https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2011-March/004954.html

That's a bizarre comment from Vladimir. The truncation of shifts is defined by
the JLS so it must be consistent across all platforms. Still, OK, we'll mask
in the .ad file. I don't think it's the best thing to do, but I can't waste the
time arguing. :-)

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the aarch64-port-dev mailing list