JDK-8321414 : C1: possible failure to improve type
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8,11,17,21,22,23
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2023-12-05
  • Updated: 2025-10-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
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
There’s an old change in LIRGenerator::profile_type() (see JDK-8027631) that tries to improve the type.  There is code near the end where it computes improved_klass, but then doesn’t use the value.  Instead it uses the value of exact_signature_k again.  It looks like a copy-paste-error.  It's unknown how often we hit this case or the impact.  We should investigate.

There are also extra null checks that were added since 8027631 that don't look right.  It doesn't make sense to check klass1 != klass2 if we already know one side is nullptr.


Comments
[~thartmann], no, I have no immediate plans to work on it. We can certainly give it to someone else.
17-10-2025

Relevant code: https://github.com/openjdk/jdk/blob/46c23bb1a252916096876c2ae3a72f4a525dd6f9/src/hotspot/share/c1/c1_LIRGenerator.cpp#L2462C9-L2462C20
17-10-2025

I just discovered this again when working on related code in Valhalla. [~dlong] do you still intend to work on this or can we hand over to someone else to get this fixed?
17-10-2025

ILW = Possible failures due to using the wrong ciKlass object, no failures observed yet, possibly disable compilation of affected method = MLM = P4
06-12-2023