RFR: 8291669: [REDO] Fix array range check hoisting for some scaled loop iv [v3]

Pengfei Li pli at openjdk.org
Tue Sep 13 02:52:41 UTC 2022


On Fri, 9 Sep 2022 12:50:02 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> I'm just wondering if there's a good reason for bailing out for integer overflows and if the same applies to long overflows. @rwestrel, you added that check with JDK-8278296, do you remember why?
>
> The:
> if (scale == min_signed_integer(exp_bt)) {
> ?
> (It's` from JDK-8259609)
> The problem I think is for the expression: -min_jint * i
> scale here is min_jint initially, stored in a long. It's then multiplied by -1. -min_jint = min_jint when stored in an int but not in a long. When scale is later transformed from a long to an int, some code finds that -(long)min_jint can't be stored in an int.

Thanks for explanation. In my understanding, `min_jint` is also a special point where bailing out is required. I should update the condition of `scale_sum < min_signed_integer(exp_bt)` to `scale_sum <= min_signed_integer(exp_bt)`, right?

-------------

PR: https://git.openjdk.org/jdk/pull/9851


More information about the hotspot-compiler-dev mailing list