RFR: 8370459: C2: CompressBitsNode::Value produces wrong result on Windows (1UL vs 1ULL), found by ExpressionFuzzer [v2]

Emanuel Peter epeter at openjdk.org
Fri Oct 31 11:47:39 UTC 2025


On Fri, 31 Oct 2025 08:15:43 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Apply suggestions from code review
>>   
>>   Co-authored-by: Tobias Hartmann <tobias.hartmann at oracle.com>
>
> src/hotspot/share/opto/intrinsicnode.cpp line 379:
> 
>> 377:         // We can further constrain the upper bound of bit compression if the number of bits
>> 378:         // which can be set(one) is less than the maximum number of bits of integral type.
>> 379:         hi = MIN2((jlong)((1ULL << result_bit_width) - 1L), hi);
> 
> It seems weird having `- 1L` mixed with ULL now.  It might be better to use right_n_bits_typed<jlong>() here and at line 276.

Great idea, I did not know about `right_n_bits_typed` :)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28062#discussion_r2481143360


More information about the hotspot-compiler-dev mailing list