RFR: 8368303: AlwaysAtomicAccesses is excessively strict

Andrew Haley aph at openjdk.org
Wed Sep 24 12:57:56 UTC 2025


On Wed, 24 Sep 2025 09:00:58 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> I thought the `else` branch is implementing the "optimization" -- using plain store/move for smaller types.
 
The problem is that when an access is marked as volatile, the back end has to believe it, even for less-than-word sizes when `AlwaysAtomicAssesses` is turned on. The back end has no way to know if the user code really needs a volatile store, so the back end has to assume that it is, and can't use a simple store. But all of this is pointless on a target that is single-copy atomic.

x86 can generate plain accesses for volatile accesses, but most processors can't do that. we need to distinguish between volatile and non-volatile accesses.

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

PR Comment: https://git.openjdk.org/jdk/pull/27432#issuecomment-3328283888


More information about the hotspot-dev mailing list