JDK-8261912 : Code IfNode::fold_compares_helper more defensively
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9,11,16,17
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2021-02-17
  • Updated: 2021-08-13
  • Resolved: 2021-02-18
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 11 JDK 15 JDK 16 JDK 17
11.0.11Fixed 15.0.3Fixed 16.0.1Fixed 17 b11Fixed
Related Reports
Relates :  
Relates :  
Description
As JDK-8261914 indicates, there are cases that break the internal asserts in IfNode::fold_compares_helper, code added by JDK-8073480 in JDK 9. Unfortunately, release builds would happily miscompile when that happens. It would be better to code IfNode::fold_compares_helper more defensively, so it bails when asserts are violated. This implicitly works around the bug in JDK-8261914. The goal for this limited workaround is to be trivially backportable in order to quickly unbreak 11u, 16u and 17.
Comments
Fix Request (15u) Same reason as for 16u and 11u.
04-03-2021

Fix Request (16u) Same reason as for 11u.
01-03-2021

Fix Request (11u) This workarounds C2 miscompilation. Patch applies cleanly to 11u, passes tier{1,2}. Patch is low-risk, as it disables the C2 optimization in places where it would definitely miscompile.
01-03-2021

Changeset: e9f3aab7 Author: Aleksey Shipilev <shade@openjdk.org> Date: 2021-02-18 15:51:45 +0000 URL: https://git.openjdk.java.net/jdk/commit/e9f3aab7
18-02-2021

ILW = Same as JDK-8261914 = P2
18-02-2021