RFR: 8350896: Integer/Long.compress gets wrong type from CompressBitsNode::Value [v7]

Jatin Bhateja jbhateja at openjdk.org
Tue May 6 10:37:15 UTC 2025


On Tue, 6 May 2025 08:59:24 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Adding additional test
>
> src/hotspot/share/opto/intrinsicnode.cpp line 302:
> 
>> 300:       // res.hi = MIN(res.hi, (1L << result_bit_width) - 1)
>> 301:       hi = src_type->hi_as_long() >= 0 ? src_type->hi_as_long() : hi;
>> 302:       hi = result_bit_width < mask_bit_width ? MIN2((jlong)((1L << result_bit_width) - 1L), hi) : hi;
> 
> Note that if `result_bit_width == 63`, this computation will do `min_jlong - 1` which is UB.

Thanks @merykitty , I liked your to-the-point, informative and crisp comment.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23947#discussion_r2075188291


More information about the hotspot-compiler-dev mailing list