-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8373525: C2: assert(_base == Long) failed: Not a Long #28920
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
base: master
Are you sure you want to change the base?
Conversation
|
👋 Welcome back dfenacci! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
Webrevs
|
mhaessig
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this, @dafedafe. The fix looks good. I only have some minor comments on the test.
test/hotspot/jtreg/compiler/loopopts/TestValidTypeInOverflowProtection.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/compiler/loopopts/TestValidTypeInOverflowProtection.java
Outdated
Show resolved
Hide resolved
…otection.java Co-authored-by: Manuel Hässig <[email protected]>
mhaessig
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing my comments. Looks good to me.
chhagedorn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, looks good to me, too, thanks!
| const TypeLong* x_long = phase->type(x)->isa_long(); | ||
| // Collapsed graph not equivalent if potential over/underflow -> bailing out (*) | ||
| if (can_overflow(phase->type(x)->is_long(), con1->get_long() + con2->get_long())) { | ||
| if (x_long == nullptr || can_overflow(x_long, con1->get_long() + con2->get_long())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to to add a comment about when x_long is not a long as described in the PR description.
| * @summary Test for the check of a valid type (long) for the input variable of overflow protection | ||
| * @run main/othervm -Xbatch -XX:-TieredCompilation -XX:CompileCommand=compileonly,compiler.loopopts.TestValidTypeInOverflowProtection::test | ||
| * ${test.main.class} | ||
| * @run driver ${test.main.class} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be main to allow to pass flags in.
| * @run driver ${test.main.class} | |
| * @run main ${test.main.class} |
Issue
Olivier's fuzzer found a test that makes C2 crash while running the optimization that collapses the addition with overflow-protection (
fold_subI_no_underflow_pattern).Causes
The crash happens because during
fold_subI_no_underflow_patternthe first input of theAddLnode (see comment below) becomes top.jdk/src/hotspot/share/opto/addnode.cpp
Lines 1525 to 1533 in 82b04f0
This happens because of a whole
IfFalsesubgraph that dies and nodes are being removed.AddLis not removed immediately as it has another input which is still alive but it is put in the IGVN worklist instead.Unfortunately the
fold_subI_no_underflow_patternoptimization runs before the next GVN pass and triggers the assert.Fix
fold_subI_no_underflow_patternshould actually take into account that we could have the graph in such a state and thatxcould be top. So, the sensible fix is not to presumexto be of type long and bailout if it is not.Testing
Tier 1-3+
(also checked for new regression test failure before the change)
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28920/head:pull/28920$ git checkout pull/28920Update a local copy of the PR:
$ git checkout pull/28920$ git pull https://git.openjdk.org/jdk.git pull/28920/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28920View PR using the GUI difftool:
$ git pr show -t 28920Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28920.diff
Using Webrev
Link to Webrev Comment