RFR: 8351889: C2 crash: assertion failed: Base pointers must match (addp 344) [v2]
Emanuel Peter
epeter at openjdk.org
Thu Nov 13 16:24:48 UTC 2025
On Thu, 2 Oct 2025 09:29:34 GMT, Roland Westrelin <roland at openjdk.org> wrote:
>> What if we just relax the assert? I failed to figure out what this assert is protecting us from by looking at the code. So what happens in a product build or when this assert is commented out?
>
>> What if we just relax the assert? I failed to figure out what this assert is protecting us from by looking at the code. So what happens in a product build or when this assert is commented out?
>
> For this particular test case, nothing. The assert is right before the cast nodes are removed, anyway. Once they are removed, the `AddP` in the chain all have the same base input.
> The risk, I think, is if some code that transforms a chain of `AddP`s (some time before the assert) wrongly assume they all have the same base. It's also easier to write such a transformation if it's an invariant that a chain of `AddP`s have the same base (it's one less thing to worry about).
@rwestrel I'm also not sure if the fix is complete, but as you say, it's not clear that it is not complete. I'm trying to think where it could fail.
What if the CastPP above the phi are not yet on the worklist, because their inputs are only later going to change? But that would require CastPP to have different inputs/ctrl in the first place, and that probably cannot happen from unrolling the loop, or other similar operations, such as pre/main/post?
Another thought: if it is so important that we common the just duplicated `CastPP` first, then maybe we really should take care not to duplicate them in the first place. Is that a feasible alternative approach?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25386#issuecomment-3528601902
More information about the hotspot-compiler-dev
mailing list