RFR: 8295124: Atomic::add to pointer type may return wrong value [v2]

Kim Barrett kbarrett at openjdk.org
Mon Oct 17 20:18:02 UTC 2022


On Wed, 12 Oct 2022 20:38:10 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Please review this change to the handling of Atomic pointer arithmetic. When
>> the value being modified is a pointer `P*`, the type of the value in the
>> destination passed to the platform operation is `const char*`, so a pointer
>> type whose pointee is size 1. This allows the platform operation to just treat
>> the arithmetic as a simple byte adjustment.
>> 
>> To demonstrate the problem described in the bug (possible incorrect result for
>> Atomic pointer arithmetic) and show that it is now fixed, this change also
>> includes some gtests for Atomic operations, including pointer arithmetic which
>> fails before the change and succeeds after.
>> 
>> Testing: mach5 tier1-3
>
> Kim Barrett has updated the pull request incrementally with one additional commit since the last revision:
> 
>   conditionalize 64bit tests on 64bit platform

Poke - any takers.

-------------

PR: https://git.openjdk.org/jdk/pull/10667


More information about the hotspot-runtime-dev mailing list