RFR: 8287052: comparing double to max_intx gives unexpected results

Dean Long dlong at openjdk.java.net
Fri May 20 19:59:49 UTC 2022


On Fri, 20 May 2022 01:03:02 GMT, Dean Long <dlong at openjdk.org> wrote:

> It isn't safe to compare a double to 2^63-1 because the latter will be changed to 2^63 when converting to a double.
> This fixes a compiler warning with clang-12 and prevents the code from returning a negative value in some cases (observed on x64 with g++).

The java.1 man page says: "The CompileThresholdScaling option has a floating point value between 0 and +Inf", which is not quite correct.  Maybe we should change this to be less specific, or remove this part completely.  Also, I'm wonder if these kinds of changes will require a CSR.

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

PR: https://git.openjdk.java.net/jdk/pull/8798


More information about the hotspot-compiler-dev mailing list