Skip to content
This repository has been archived by the owner. It is now read-only.

8268371: C2: assert(_gvn.type(obj)->higher_equal(tjp)) failed: cast_up is no longer needed #55

wants to merge 2 commits into from


Copy link

@iwanowww iwanowww commented Jun 15, 2021

The way CheckCastPP nodes are handled now doesn't let redundant casts to be completely removed: even when the corresponding runtime check disappears, the cast node stays in the graph and it broadens/worsens the type of casted value.

Proposed fix leaves CheckCastPP handling intact, but skips the insertion of redundant cast nodes as part of receiver subtype check. ​

Also, interface casts on receiver temporarily don't get a CheckCastPP irrespective of whether the subtype check is redundant or not.

Though the assertion failures showed up after JDK-8267807, the bug was there long before.


  • hs-tier1 - hs-tier4


  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed


  • JDK-8268371: C2: assert(_gvn.type(obj)->higher_equal(tjp)) failed: cast_up is no longer needed



Using git

Checkout this PR locally:
$ git fetch pull/55/head:pull/55
$ git checkout pull/55

Update a local copy of the PR:
$ git checkout pull/55
$ git pull pull/55/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 55

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

Using diff file

Download this PR as a diff file:

Copy link

@bridgekeeper bridgekeeper bot commented Jun 15, 2021

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

Copy link

@openjdk openjdk bot commented Jun 15, 2021

@iwanowww 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.

@iwanowww iwanowww marked this pull request as ready for review Jun 15, 2021
@openjdk openjdk bot added the rfr label Jun 15, 2021
Copy link

@mlbridge mlbridge bot commented Jun 15, 2021


Copy link

@rwestrel rwestrel left a comment

Looks good to me.

Copy link

@openjdk openjdk bot commented Jun 15, 2021

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

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

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

8268371: C2: assert(_gvn.type(obj)->higher_equal(tjp)) failed: cast_up is no longer needed

Reviewed-by: roland, kvn

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 2 new commits pushed to the master branch:

  • 76cad4b: 8263321: Regression 8% in javadoc-steady in 17-b11
  • e36136f: 8268125: ZGC: Clone oop array gets wrong acopy stub

Please see this link for an up-to-date comparison between the source branch of this pull request and 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.

Copy link

@iwanowww iwanowww commented Jun 17, 2021

Thanks for the reviews, Roland and Vladimir.


Copy link

@openjdk openjdk bot commented Jun 17, 2021

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

  • 8545269: 8268676: assert(!ik->is_interface() && !ik->has_subklass()) failed: inconsistent klass hierarchy
  • c98d508: 8268265: MutableSpaceUsedHelper::take_sample() hits assert(left >= right) failed: avoid overflow
  • b66001a: 8268971: ProblemList tools/jpackage/windows/ on win-x64
  • 0011b52: 8264843: Javac crashes with NullPointerException when finding unencoded XML in
  • 2047da7: 8265297: javax/net/ssl/SSLSession/ failed with "RuntimeException: Connection reset"
  • 091bc4a: 8268353: Test is and is not present in jdk image
  • 69d01b6: 8249899: jdk/javadoc/tool/ uses @ignore w/o bug-id
  • 7d7bdbe: 8268776: Test missing /othervm from @run tag
  • 344e3ed: 8268080: java/util/concurrent/forkjoin/ fails with java.util.concurrent.RejectedExecutionException
  • 4c9aefd: 8268739: AArch64: Build failure after JDK-8267663
  • ... and 20 more:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Jun 17, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Jun 17, 2021
Copy link

@openjdk openjdk bot commented Jun 17, 2021

@iwanowww Pushed as commit 9130b8a.

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants