RFR: 8367967: C2: "fatal error: Not monotonic" with Mod nodes [v3]
Christian Hagedorn
chagedorn at openjdk.org
Fri Sep 26 08:51:31 UTC 2025
On Tue, 23 Sep 2025 08:28:00 GMT, Hannes Greule <hgreule at openjdk.org> wrote:
>> Generally, we shouldn't return a wider type (ZERO) if there is a later case that would return a more narrow type (TOP) for the same input types. If the inputs are widened and the first case doesn't match anymore but the later one still does, the result is not monotonic with the previous result.
>>
>> Please review :)
>
> Hannes Greule has updated the pull request incrementally with one additional commit since the last revision:
>
> move test
Testing looks good!
I also left a comment about ignoring the zero divisor case. It's an interesting thought to just ignore/remove it. Anyway, the current patch just fixes the current situation and does not make it worse. So, I agree with it but if you want to switch to the ignoring case, I'm also fine. In the latter case, I won't be able to review it anymore since I will be on vacation next week (assuming we also wait for Vladimir's additional input about it). But you would have my implicit approval :-)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27408#issuecomment-3337417287
More information about the hotspot-compiler-dev
mailing list