Skip to content

Conversation

@merykitty
Copy link
Member

@merykitty merykitty commented Dec 22, 2025

Hi,

The issue here is the inconsistency in computing the _widen field of the TypeInt. At the first step, the types of the operands are:

t1 = int:0
t2 = int:-2..3, widen = 3

Since the type of the first operand is a constant zero, AddNode::Value returns the type of the second operand directly, as x ^ 0 == x for all x. In the second step, t1 is widened to 0..2. This triggers the real computation of the result. The algorithm then splits t2 into t21 = int:-2..-1 and t22 = int:0..3. The Xor of these with t1 are r1 = int:-4..-1 and r2 = int:0..3. As both have _hi - _lo <= SMALL_TYPEINT_THRESHOLD == 3, their _widens are normalized to 0. As a result, their meet also has _widen == 0. This value is smaller than that from the previous step, which was 3, which leads to the failure.

The root cause here is that, the _widen value of a node should be computed and normalized on the whole range of the node, not on its subranges, which may normalize it to 0 in more cases than what is expected. As a result, my proposed solution is to ignore the _widen value of the subranges, and pass the expected _widen value when composing the final result.

Please take a look and leave your reviews, thanks a lot.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8374180: C2 crash in PhaseCCP::verify_type - fatal error: Not monotonic (Bug - P3)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28952/head:pull/28952
$ git checkout pull/28952

Update a local copy of the PR:
$ git checkout pull/28952
$ git pull https://git.openjdk.org/jdk.git pull/28952/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 28952

View PR using the GUI difftool:
$ git pr show -t 28952

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28952.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 22, 2025

👋 Welcome back qamai! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Dec 22, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Dec 22, 2025

@merykitty The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 22, 2025
@mlbridge
Copy link

mlbridge bot commented Dec 22, 2025

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-compiler [email protected] rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant