RFR: 8327963: C2: fix construction of memory graph around Initialize node to prevent incorrect execution if allocation is removed [v12]

Roland Westrelin roland at openjdk.org
Wed Sep 17 14:14:19 UTC 2025


On Fri, 12 Sep 2025 22:42:08 GMT, Dean Long <dlong at openjdk.org> wrote:

>> It's one of the things mentioned in that comment:
>> https://github.com/openjdk/jdk/pull/24570#issuecomment-2883651987
>> 
>> "I added asserts to catch cases where proj_out is called but the node has more than one matching projection. With those asserts, I caught some false positive/cases where we got lucky and worked around them by reworking the code so it doesn't use proj_out. That's the case in PhaseIdealLoop::intrinsify_fill(): we can end up there with more than one FramePtr projection because the code pattern used elsewhere is to add one more projection and let identical projections common during igvn. "
>
> Are we just lucky that we don't have the same problem with ReturnAdr here?

Yes, most likely.
This is also a pretty harmless corner case: if there is more than one `Parm` projection, the assert in `proj_out` catches it even though it does no harm to have more than one projection in this particular case. So this change is here, not to fix some broken code, but to make it possible to have a strict assert in `proj_out`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24570#discussion_r2355669590


More information about the hotspot-compiler-dev mailing list