JDK-8371917 : [lworld] C1 should use LayoutKind in its handling of flat layouts
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: repo-valhalla
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-11-14
  • Updated: 2025-11-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
repo-valhallaUnresolved
Related Reports
Causes :  
Relates :  
Description
C1 still uses a logic based on fields attributes to handle flat values, and not the LayoutKind layout info, which leads to bugs like this one:

bool needs_atomic_access = !field->is_null_free() || (field->is_volatile() && !is_naturally_atomic);

needs_atomic_access is false for a flat field with the ATOMIC_FLAT layout and a value type with multiple fields.

C1 code should be updated to be based on LayoudKind layout info and helper methods from JDK-8371915.
Comments
test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestTearing.java should be extended to cover this case.
17-11-2025