-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8324121: SIGFPE in PhaseIdealLoop::extract_long_range_checks #18397
Conversation
👋 Welcome back roland! A progress list of the required criteria for merging this PR into |
@rwestrel This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
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 272 new commits pushed to the
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 |
Webrevs
|
@@ -1106,7 +1107,8 @@ int PhaseIdealLoop::extract_long_range_checks(const IdealLoopTree* loop, jlong s | |||
jlong scale = 0; | |||
if (loop->is_range_check_if(if_proj, this, T_LONG, phi, range, offset, scale) && | |||
loop->is_invariant(range) && loop->is_invariant(offset) && | |||
original_iters_limit / ABS(scale * stride_con) >= min_iters) { | |||
original_iters_limit / ABS(scale) >= min_iters * ABS(stride_con)) { |
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 assume there is check somewhere that stride_con
is not MIN_INT
.
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.
In my opinion ABS() should assert that it has legal input (not MIN_INT) and output (non-negative value) in debug builds.
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 reviewing this.
We can't get to this code if stride_con
is MIN_INT
because some other condition (that doesn't explicitly check that stride_con
is not MIN_INT
) causes a bail out from the transformation. I added an explicit bail out in that case in a new commit anyway to make the code more robust.
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.
In my opinion ABS() should assert that it has legal input (not MIN_INT) and output (non-negative value) in debug builds.
I agree and filed JDK-8328934 for that.
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.
Unfortunately, there is still an overflow here when scale
is min_jlong.
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.
Right but isn't it harmless in this particular case?
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.
No, if it's undefined behavior, we can't be sure what result the C++ compiler will give. And if we test with -ftrapv it will crash.
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.
Ok. I filed https://bugs.openjdk.org/browse/JDK-8329163 to track it.
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.
Good.
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.
Looks good!
@vnkozlov @chhagedorn for the reviews |
/integrate |
Going to push as commit cb2a671.
Your commit was automatically rebased without conflicts. |
Both failures occur because
ABS(scale * stride_con)
overflows (scalea really large long number). I reworked the test so overflow is no
longer an issue.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18397/head:pull/18397
$ git checkout pull/18397
Update a local copy of the PR:
$ git checkout pull/18397
$ git pull https://git.openjdk.org/jdk.git pull/18397/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18397
View PR using the GUI difftool:
$ git pr show -t 18397
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18397.diff
Webrev
Link to Webrev Comment