JDK-8282194 : C1: Missing side effects of dynamic constant linkage
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 18,19
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-02-21
  • Updated: 2022-04-04
  • Resolved: 2022-02-23
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.
JDK 19
19 b11Fixed
Related Reports
Relates :  
Relates :  
Description
C1 handles unresolved dynamic constants by performing constant resolution at runtime and then putting the constant value into the generated code by patching it. But it treats the not-yet-resolved value as a pure constant without any side effects. It's not the case for dynamic constants which are produced by a user-defined bootstrap method and there are no guarantees that it doesn't have any side effects.
Comments
Fix Request (JDK 18u) Fixes incorrect execution of Java code. The fix is low risk and applies cleanly (except a minor conflict due to changes to surrounding code). Tier 1-3 testing is running for JDK 18u.
04-04-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk18u/pull/88 Date: 2022-04-04 06:57:40 +0000
04-04-2022

Changeset: 93320717 Author: Vladimir Ivanov <vlivanov@openjdk.org> Date: 2022-02-23 10:17:01 +0000 URL: https://git.openjdk.java.net/jdk/commit/9332071784b7150512f7e27b07c290a356d43c2e
23-02-2022

ILW = Possible side effects of unresolved dynamic constants resulting in undefined behavior, low?, disable C1 compilation of affected method = HLM = P3
22-02-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7557 Date: 2022-02-21 13:20:08 +0000
21-02-2022