RFR: 8367967: C2: "fatal error: Not monotonic" with Mod nodes
Aleksey Shipilev
shade at openjdk.org
Mon Sep 22 08:06:16 UTC 2025
On Sun, 21 Sep 2025 06:11:11 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 :)
This makes sense. I was about to ask what would be the result of `0 mod 0` then, but I see it is also covered: we return `TOP` on any `X mod 0` early on.
-------------
Marked as reviewed by shade (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/27408#pullrequestreview-3251064181
More information about the hotspot-compiler-dev
mailing list