JDK-8367690 : C2: Unneeded branch in reduce_phi
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 26
  • Priority: P5
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2025-09-15
  • Updated: 2025-10-16
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
Causes :  
Description
In escape.cpp, the function reduce_phi has the following fragment:

```
...
    } else if (use->is_SafePoint()) {
      // processed later
    } else {
      assert(use->is_SafePoint(), "Unexpected user of reducible Phi %d -> %d:%s:%d", ophi->_idx, use->_idx, use->Name(), use->outcnt());
    }
```

This is unnecessary as the assert will always trigger. We can either remove the else if branch or change the assert for a ShouldNotReachHere
Comments
[~cslucas] I believe this was part of your set of changes for EA improvements in C2. I was wondering which was your original intention here and if it could be better to either (a) remove the else if branch or (b) modify the assert to a e.g. ShouldNotReachHere. Thanks!
15-09-2025