getAndAddInt() breaks AOT compilation for AArch64

stewartd.qdt stewartd.qdt at
Mon Jun 4 14:58:58 UTC 2018

I just uploaded a patch for this fix to 

It is essentially the same as Zhongwei proposed and does not contain any advanced handling for immediates. I think at this point simpler is better. It also appeared to me that Hotspot does not have special handling for the immediate cases either, so I chose the simple route. 

Please have a look and my apologies for the breakage.


-----Original Message-----
From: Zhongwei Yao [mailto:zhongwei.yao at] 
Sent: Wednesday, May 30, 2018 5:43 AM
To: dean.long at
Cc: Andrew Haley <aph at>; Daniel Stewart <stewartd at>; stewartd.qdt <stewartd.qdt at>; graal-dev at
Subject: Re: getAndAddInt() breaks AOT compilation for AArch64

Hi, all,

Since Daniel is on holiday, here are my 2 methods to get it pass:

  - one is a quick fix for this error (the fix doesn't include optimization for special-case integer values as Andrew mentioned).

  - and another is a workaround which disables "registerUnsafeReadAndAddPlugins" completely.

Here are the patches:

Both of them are OK when running "jaotc --output --module java.base" and pass Graal unit tests.

Could you take a review?

And what shall I do if the patch is OK? Shall I create a pull request in Graal for it? Or should we just wait for Daniel's full fix for it?

On 30 May 2018 at 06:51,  <dean.long at> wrote:
> On 5/29/18 9:57 AM, Andrew Haley wrote:
>> On 05/29/2018 05:45 PM, Daniel Stewart wrote:
>>> Unfortunately I'm on holiday until Friday and have no access to be 
>>> able to patch this. I'll work on it once I'm back if someone doesn't 
>>> get to it first.
>>> Sorry for the breakage.
>> It's OK, we can work around it for now.  Better that you get to fix 
>> it yourself.  And if someone reading this is thinking about importing 
>> Graal to OpenJDK, this would not be a good time.
>> :-)
> Can we include a work-around in the Graal import rather than delaying it?
> dl

Best regards,

More information about the graal-dev mailing list