RFR: 8367483: C2 crash in PhaseValues::type: assert(t != nullptr) failed: must set before get - missing notification for CastX2P(SubL(x, y))
Emanuel Peter
epeter at openjdk.org
Fri Sep 12 08:44:29 UTC 2025
On Fri, 12 Sep 2025 08:28:51 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
>> `CastX2PNode::Ideal` optimizes cases:
>>
>> CastX2P(AddX(x, y)) -> AddP(CastX2P(x), y)
>> CastX2P(SubL(x, y)) -> AddP(CastX2P(x), SubL(0, y))
>>
>>
>> But the notification code `PhaseIterGVN::add_users_of_use_to_worklist` only adds `CastX2P` to the worklist for the `AddX` and not the `SubX` cases.
>>
>> ---------------------------------------
>>
>> A little brag: this is the second (unrelated, i.e. non aliasing) bug that `TestAliasingFuzzer.java` found. Fuzzing access to native MemorySegment seems to trigger new/rare patterns.
>
> test/hotspot/jtreg/compiler/c2/gvn/MissedOptimizationWithCastX2PSubX.java line 1:
>
>> 1: /*
>
> There is a `compiler/igvn` test folder. I think this suits better than `c2/gvn`.
Yes. We already have other missed optimization tests in `c2/gvn` though 😆
As always: quite a mess.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27249#discussion_r2343441022
More information about the hotspot-compiler-dev
mailing list