8357381: C2: assert(false) failed: should not be here#31037
Open
sarannat wants to merge 1 commit intoopenjdk:masterfrom
Open
8357381: C2: assert(false) failed: should not be here#31037sarannat wants to merge 1 commit intoopenjdk:masterfrom
sarannat wants to merge 1 commit intoopenjdk:masterfrom
Conversation
|
👋 Welcome back snatarajan! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
vnkozlov
reviewed
May 5, 2026
Comment on lines
+4152
to
+4153
| } else if (use->Opcode() == Op_AryEq || use->Opcode() == Op_StrComp || use->Opcode() == Op_CountPositives || | ||
| use->Opcode() == Op_StrEquals || use->Opcode() == Op_StrIndexOf || use->Opcode() == Op_StrIndexOfChar) { |
Contributor
There was a problem hiding this comment.
Can you add a new method to combine these check into one place and use it here and other places where which check these intrinsics?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue
The assertion
assert(false, "should not be here")inConnectionGraph::move_inst_memfires because aStoreBnode hasStrEqualsas a memory user.Analysis
The main issues starts after the first iteration of iterative escape analysis. As mentioned in JDK-8357381, EA#0 does lock removal. During IGVN after EA#0, the string intrinsic node
StrEqualundergoes an ideal transformation (StrIntrinsicNode::Ideal()) which peels itsMergeMeminput node. At this pointStoreBbecomes a direct input ofStrEquals.Now EA#1 runs on the transformed graph. Phase 2 of
split_unique_typesexplicitly allowsStrEqualsas a user ofStoreB. In Phase 4,split_unique_typesthen callsmove_inst_memwhich is responsible for moving memory users to their memory slices. However,move_inst_memonly handlesMergeMem,MemBar,Mem, andPhias memory user. Since,StrEqualsis not handled inmove_inst_memeven though it is allowed in Phase 2 ofsplit_unique_typesit fires the assertionassert(false, "should not be here").Solution
In the proposed fix, I have extended
move_inst_memto move string intrinsic nodes that are explicitly allowed in Phase 2 ofsplit_unique_typeto their appropriate memory slices.Testing
Tier1-3 and Github actions
Question to reviewers
Please let me know if this fix looks reasonable.
Thank you @danielogh for the initial analysis.
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31037/head:pull/31037$ git checkout pull/31037Update a local copy of the PR:
$ git checkout pull/31037$ git pull https://git.openjdk.org/jdk.git pull/31037/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 31037View PR using the GUI difftool:
$ git pr show -t 31037Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31037.diff
Using Webrev
Link to Webrev Comment