JDK-8276105 : C2: Conv(D|F)2(I|L)Nodes::Ideal should handle rounding correctly
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17,18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-10-28
  • Updated: 2021-11-15
  • Resolved: 2021-11-02
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 18
11.0.15-oracleFixed 18 b22Fixed
Related Reports
Relates :  
Description
Seems to only manifest on x86_32, and only with SSE=0. The test sets UseAVX=1, maybe that's the problem.

$ CONF=linux-x86-server-fastdebug make run-test TEST=compiler/loopopts/superword/CoLocatePack.java TEST_VM_OPTS="-XX:UseAVX=0 -XX:UseSSE=0" 
...

CompileCommand: compileonly compiler/loopopts/superword/CoLocatePack.test bool compileonly = true
 191  ConvF2L  === _  714  [[ 193 ]]  !jvms: CoLocatePack::test @ bci:30 (line 70)
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/phaseX.cpp:1128
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/shade/trunks/jdk/src/hotspot/share/opto/phaseX.cpp:1128), pid=1717516, tid=1717532
#  fatal error: modified node was not processed by IGVN.transform_old()
#

Comments
Fix Request (17u) Same reason as for 11u.
15-11-2021

Fix Request (11u) Fixes the long-standing obscure compiler bug, which manifests on x86_32 with strictfp. Patch applies cleanly. Testing passes.
12-11-2021

Changeset: 0488ebdf Author: Aleksey Shipilev <shade@openjdk.org> Date: 2021-11-02 06:38:26 +0000 URL: https://git.openjdk.java.net/jdk/commit/0488ebdf14dacfa79d98de16ed949c813dd88701
02-11-2021

Aha. I think I understand why. The Conv(D|F)2(I|L)Nodes::Ideal-s have the rules that handle Rounding(Float|Double) inputs. But when those are taken, we do set_req and still return NULL! So GVN is properly confused. This path started to be taken on x86_32 after JDK-8266950, which requires rounding more frequently with low SSE, now that everything is strictfp.
29-10-2021

ILW = C2 assertion in IGVN, only single test and observed on x86_32, use UseSSE>=1 or disable compilation of affected method = HLL = P4
29-10-2021

Bisection points to JDK-8266950 as the first bad commit.
28-10-2021