[lworld] RFR: 8368782: [lworld] C2: fatal error: no reachable node should have no use
Tobias Hartmann
thartmann at openjdk.org
Mon Oct 6 12:36:36 UTC 2025
On Mon, 6 Oct 2025 12:13:06 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
> `test9()` in `TestLWorld.java` is crashing intermittently when running with `StressLoopPeeling`.
>
> The problem can be traced back to a node that is not re-added to the IGVN worklist in `PhiNode::Ideal()`:
> <img width="282" height="198" alt="graph" src="https://github.com/user-attachments/assets/e8597cf1-d49f-4c8d-b248-184b25f30fba" />
>
> We are processing `3786 Phi` and update its input `3748 Phi` to another node. As a result, `3748 Phi` loses it's last output and is now dead. It should be re-added to the IGVN worklist to be cleaned up. But that does not happen because we use `set_req()` on `3786 Phi` instead of `set_req_X()` when replacing the input `3748 Phi`. As a result, the dead node stays in the graph and eventually triggers the "no dead use" assert.
>
> The fix is straight forward to use `set_req_X()` which ensures that a now dead input node is pushed to the IGVN worklist again and cleaned up later.
>
> The affected code is also wrong in mainline but has never triggered there. Therefore, I suggest to wait and not eagerly upstream it to mainline for now.
>
> Thanks,
> Christian
Looks good and trivial!
-------------
Marked as reviewed by thartmann (Committer).
PR Review: https://git.openjdk.org/valhalla/pull/1662#pullrequestreview-3304303935
More information about the valhalla-dev
mailing list