8251442: [lworld] C2 compilation fails with assert(value->bottom_type()->higher_equal(_type)) #151
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Similar to JDK-8242453 [1], the problem is that a load from a non-flat array can be pushed through an arraycopy from a flat array (see LoadNode::can_see_arraycopy_value) and end up with an inconsistent memory input (oop load from a flat array). The checks emitted by the arraycopy intrinsic will catch this and the load will be removed but other Ideal transformations can still be executed before that happens and encounter this inconsistent state.
The fix is to add CheckCastPPNodes to the arraycopy intrinsic that propagate the information that the src/dst array is not flat. This makes sure that the data path consistently dies if the input array is in fact a flat array. I've also removed the workaround from the JDK-8242453 [1] fix.
When updating the type of CheckCastPPNodes, we need to make sure that the not_null_free and not_flat properties of TypeAryPtr are propagated. This is done by TypeAryPtr::update_properties. A CheckCastPPNode that ends up with an inconsistent input is then simply replaced by TOP.
This change also includes:
[1] https://bugs.openjdk.java.net/browse/JDK-8242453
Progress
Issue
Download
$ git fetch https://git.openjdk.java.net/valhalla pull/151/head:pull/151
$ git checkout pull/151