RFR(S): 8205574: Loop predication "assert(f <= 1 && f >= 0) failed Incorrect frequency"

Roland Westrelin rwestrel at redhat.com
Wed Nov 7 16:13:38 UTC 2018


Loop predicates needs to compute the frequencies of paths in a loop. To
sanity check that logic (make sure one path is not counted twice for
instance), the code that computes frequencies verifies they are kept
between 0 and 1. Because rounding can send a correctly computed
frequency above 1, the code adjust fp rounding to always round
down. There were a few occurence on windows where an assert finds a
frequency above 1 in spite of the rounding mode changes. I looked at one
and found that fesetround() is broken on windows. Right after the call


the mxcsr value is 3f80 which is round toward -infinity. Actually using
FE_DOWNWARD sets mxcsr to round toward +infinity.

Anyway, adjusting rounding is not required for correctness and the most
reasonable way to fix this seems to be to not do sanity checking on


More information about the hotspot-compiler-dev mailing list