RFR: 8341976: C2: use_mem_state != load->find_exact_control(load->in(0)) assert failure [v2]

Christian Hagedorn chagedorn at openjdk.org
Mon Mar 31 10:49:15 UTC 2025


On Fri, 28 Mar 2025 16:01:47 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>>> Added. The TraceLoopOpts crash reproduces: the code hits a malformed counted loop. I tweaked the printing code.
>> 
>> Is the malformed counted loop expected or a different issue to look into?
>
> It doesn't look an actual issue to me. `PhiNode::Value` manages to narrow the trip `phi`'s type of the pre loop enough that it's a constant. So the loop no longer has the expected counted loop shape but the loop exit condition that should constant fold doesn't because it's guarded by an `Opaque1` node.

This sounds very similar to [JDK-8297752](https://bugs.openjdk.org/browse/JDK-8297752) which also caused problems outside of `TraceLoopOpts`. We should probably handle this separately from this PR.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23465#discussion_r2020814123


More information about the hotspot-compiler-dev mailing list