Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8268362: [REDO] C2 crash when compile negative Arrays.copyOf length after loop #4480

Closed
wants to merge 1 commit into from

Conversation

huishi-hs
Copy link

@huishi-hs huishi-hs commented Jun 13, 2021

This redos PR #4238

Some closed tests fail due to original PR, the main reasons are:

  • 8268325/8268345
    • CastIINode created in AllocateArrayNode::make_ideal_length apply on a negative array length. GVN transform converts these CastIINode to top. This breaks assumptions, eg., array index node type is TypeInt.
  • 8268345
    • Some CastIINode is created in LoadRange::Ideal, which doesn't apply GVN transform. CastIINode can not be found in GVN hashtable and cause assertion failure.

Based on previous PR #4238, this PR unifies CastIINode processing post AllocateArrayNode::make_ideal_length. Setup type and add into igvn worklist. Avoid apply GVN transform to break different assumptions in parser.

Based on closed test failrue message, two new tests are added

  1. TestNegArrayLengthAsIndex1 : fail in debug build even without previous PR 8267904: C2 crash when compile negative Arrays.copyOf length after loop #4238, it loads a negative array length and apply GVN transform (In GraphKit::load_array_length) which covert length to top node. It also assert in Parse::array_addressing.

  2. TestNegArrayLengthAsIndex2 : similar with failrue in https://bugs.openjdk.java.net/browse/JDK-8268301


Progress

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

Issue

  • JDK-8268362: [REDO] C2 crash when compile negative Arrays.copyOf length after loop

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4480/head:pull/4480
$ git checkout pull/4480

Update a local copy of the PR:
$ git checkout pull/4480
$ git pull https://git.openjdk.java.net/jdk pull/4480/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4480

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4480.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 13, 2021

👋 Welcome back hshi! 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 added the rfr Pull request is ready for review label Jun 13, 2021
@openjdk
Copy link

openjdk bot commented Jun 13, 2021

@huishi-hs 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 hotspot-compiler hotspot-compiler-dev@openjdk.org label Jun 13, 2021
@mlbridge
Copy link

mlbridge bot commented Jun 13, 2021

Webrevs

@dean-long
Copy link
Member

@huishi-hs I submitted a test job for your changes. Also, I noticed your branch seems to be based off of "jdk" (jdk18). There is now a separate jdk17 repo. Unless you plan to push your fix to 18 and than backport to 17, it might be easier to base your PR on jdk17.

@huishi-hs
Copy link
Author

@huishi-hs I submitted a test job for your changes. Also, I noticed your branch seems to be based off of "jdk" (jdk18). There is now a separate jdk17 repo. Unless you plan to push your fix to 18 and than backport to 17, it might be easier to base your PR on jdk17.

Thanks for helping test! This PR target 17, will submit a new PR based on 17

@huishi-hs
Copy link
Author

Close this PR, PR is submited in jdk17 openjdk/jdk17#49

@huishi-hs huishi-hs closed this Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants