RFR: 8331575: C2: crash when ConvL2I is split thru phi at LongCountedLoop

Christian Hagedorn chagedorn at openjdk.org
Tue May 7 17:28:57 UTC 2024


On Mon, 6 May 2024 11:50:40 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> Are we sure divisions are the only cause of bugs?

Not 100% sure. But the only cases I've observed so far are with division/mod where they float above and end up being executed too early (the result is never actually observed, though).

> that once pushed thru phi, the type of the ConvL2I is simply not correct and that's the root cause.

Yes, that's my understanding, too. But since the `AddL` input into the loop iv phi contains zero, it raised the question if we could actually detect that and do our decision based on whether the input contains zero instead of simply disabling pushing `ConvL2I` (and `ConvI2L`) nodes through phis entirely. 

It also seems that it's only a problem with loop iv phis because we improve the iv type in such a way that some of the possible values of the backedge are excluded. So, maybe a first step could be to allow splitting the `Conv*` nodes through non-loop-iv phi nodes. However, there might also be other non-loop-iv phi problems I'm currently not aware of. Nevertheless, it might be worth to investigate further in a separate RFE.

> I wonder if we could get other failures because of this: maybe a node becoming top because of the incorrect type or an out of bound array access.

Could very well be.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19086#discussion_r1592835265


More information about the hotspot-compiler-dev mailing list