On Mon, 6 Oct 2025 12:13:06 GMT, Christian Hagedorn <[email protected]> 
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

This pull request has now been integrated.

Changeset: 619825cd
Author:    Christian Hagedorn <[email protected]>
URL:       
https://git.openjdk.org/valhalla/commit/619825cd7640af99253455dda68e8b9d9018d478
Stats:     1 line in 1 file changed: 0 ins; 0 del; 1 mod

8368782: [lworld] C2: fatal error: no reachable node should have no use

Reviewed-by: thartmann

-------------

PR: https://git.openjdk.org/valhalla/pull/1662

Reply via email to