Skip to content

8386482: C2 CountedLoopConverter::filtered_type_from_dominators: assert(_base == Int) failed: Not an Int#31481

Closed
eme64 wants to merge 2 commits into
openjdk:masterfrom
eme64:JDK-8386482-filtered_type_from_dominators-top
Closed

8386482: C2 CountedLoopConverter::filtered_type_from_dominators: assert(_base == Int) failed: Not an Int#31481
eme64 wants to merge 2 commits into
openjdk:masterfrom
eme64:JDK-8386482-filtered_type_from_dominators-top

Conversation

@eme64

@eme64 eme64 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

This fixes another bug in the CountedLoopConverter::has_truncation_wrap optimization.

This issue was discovered by the template fuzzer: #31501

The issue here: we did not expect an unreachable state. But if we traverse several if conditions, their join type can become top, which means the phi type is impossible, the loop unreachable.

Fix: just return nullptr if we get an empty type.

Looks like this bug was created by #17508. Before that change, we could have TypeInt with lo > hi, and that would be considered an empty type, TypeInt::empty() == true. So it used to make sense to return TypeInt* from these kinds of optimizations, and they could return empty type that way. Now that's not possible any more. We would have to return top, and change the signatures to Type*. That would require a lot of effort, and I don't think that makes sense for a bug-fix. Returning nullptr just means we did not narrow the type, and that should always be safe.



Progress

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

Issue

  • JDK-8386482: C2 CountedLoopConverter::filtered_type_from_dominators: assert(_base == Int) failed: Not an Int (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31481

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Jun 11, 2026

Copy link
Copy Markdown

👋 Welcome back epeter! 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

openjdk Bot commented Jun 11, 2026

Copy link
Copy Markdown

@eme64 This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8386482: C2 CountedLoopConverter::filtered_type_from_dominators: assert(_base == Int) failed: Not an Int

Reviewed-by: kvn, qamai

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 11 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk Bot changed the title JDK-8386482 8386482: C2 CountedLoopConverter::filtered_type_from_dominators: assert(_base == Int) failed: Not an Int Jun 11, 2026
@openjdk

openjdk Bot commented Jun 11, 2026

Copy link
Copy Markdown

@eme64 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 commented Jun 11, 2026

Copy link
Copy Markdown

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot-compiler. This can be overridden with the /reviewers command.

@eme64 eme64 marked this pull request as ready for review June 11, 2026 14:54
@openjdk openjdk Bot added the rfr Pull request is ready for review label Jun 11, 2026
@mlbridge

mlbridge Bot commented Jun 11, 2026

Copy link
Copy Markdown

Webrevs

@vnkozlov vnkozlov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good.

@merykitty merykitty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for making the change.

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Jun 11, 2026
@eme64

eme64 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

@merykitty @vnkozlov Thanks for the reviews and approvals!

/integrate

@openjdk

openjdk Bot commented Jun 15, 2026

Copy link
Copy Markdown

Going to push as commit b9f7bd2.
Since your change was applied there have been 20 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk Bot added the integrated Pull request has been integrated label Jun 15, 2026
@openjdk openjdk Bot closed this Jun 15, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 15, 2026
@openjdk

openjdk Bot commented Jun 15, 2026

Copy link
Copy Markdown

@eme64 Pushed as commit b9f7bd2.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

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

Labels

hotspot-compiler [email protected] integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants