RFR: 8351889: C2 crash: assertion failed: Base pointers must match (addp 344) [v2]
Emanuel Peter
epeter at openjdk.org
Mon Nov 24 09:49:57 UTC 2025
On Fri, 21 Nov 2025 10:13:31 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> > Do you know why we insert a new `CastPP` there, and why it is put not at the ctrl of the CastPP, but of the phi? I suppose the ctrl of the phi is correct, but we do lose information there, and that later prevents the `CastPP` to common.
>
> When the `Phi` is removed because all of its inputs are the same once uncasted, there is a risk of losing a dependency. To prevent that, a `CastPP` is inserted. All we know is that some casts along some inputs of the `Phi` may carry a dependency that we don't want to loose. The only possible control for the `CastPP` then is the one of the `Phi`.
In general we can probably not do anything better. But in this case that fails here, we could have looked at both `CastPP`, and seen that they have the same ctrl, and used that one, no? But I'm not sure that is worth it yet.
> The duplication comes from loop body cloning so I'm not sure how we could prevent the duplication. We could try to common the CastPP nodes once PhaseIdealLoop::peeled_dom_test_elim() is called.
Right, that could be an option. Do you think that is worth it?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25386#issuecomment-3569810303
More information about the hotspot-dev
mailing list