RFR: 8351889: C2 crash: assertion failed: Base pointers must match (addp 344) [v4]

Emanuel Peter epeter at openjdk.org
Wed Dec 3 05:46:06 UTC 2025


On Wed, 3 Dec 2025 05:36:52 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Roland Westrelin has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 14 additional commits since the last revision:
>> 
>>  - more
>>  - review
>>  - Merge branch 'master' into JDK-8351889
>>  - exp
>>  - Merge branch 'master' into JDK-8351889
>>  - verif
>>  - Merge branch 'master' into JDK-8351889
>>  - test seed
>>  - more
>>  - Merge branch 'master' into JDK-8351889
>>  - ... and 4 more: https://git.openjdk.org/jdk/compare/d6d17aab...15c17bb1
>
> src/hotspot/share/opto/phaseX.cpp line 2076:
> 
>> 2074:     if (addp->in(AddPNode::Base) == n->in(AddPNode::Base)) {
>> 2075:       return false;
>> 2076:     }
> 
> Suggestion:
> 
>     if (!addp->is_AddP() ||
>         addp->in(AddPNode::Base)->is_top() ||
>         addp->in(AddPNode::Base) == n->in(AddPNode::Base)) {
>       return false;
>     }

It could be a bit compacted.

How do you imagine `verify_node_invariants_for` will grow over time? I suspect it will become a laundry-list of invariants, we continue going down through it as long as no invariant is violated. For that, it may make more sense to invert your condition, and assert/print inside the if-block. It would make the code more extendable.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25386#discussion_r2583696057


More information about the hotspot-compiler-dev mailing list