JDK-8343907 : C2: Constants without root as control in PhaseIdealLoop::split_thru_phi
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 24
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2024-11-11
  • Updated: 2024-11-15
  • Resolved: 2024-11-15
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
tbdResolved
Related Reports
Duplicate :  
Relates :  
Description
In PhaseIdealLoop::split_thru_phi, loop opts.cpp:191 the code snippet

if (x->is_Con()) {
      // Constant's control is always root.
      set_root_as_ctrl(x);
      continue;
    }

sets control of constants to root. This seems suspicious as constants in loop opts should always have their control set to root. However, adding an assert (assert(get_ctrl(x) == C->root(), "constant without root control");) inside the if to test this assumption, immediately triggers with --version. 

This code should be re-examined to ensure this is not just a band-aid solution.

Discussion:
https://github.com/openjdk/jdk/pull/21836#discussion_r1834827466
Comments
Will be fixed in the PR for JDK-8343148
15-11-2024