RFR: 8338197: ubsan: ad_x86.hpp:6417:11: runtime error: shift exponent 100 is too large for 32-bit type 'unsigned int' [v2]

Boris Ulasevich bulasevich at openjdk.org
Fri Aug 22 19:18:10 UTC 2025


On Fri, 22 Aug 2025 16:46:17 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Boris Ulasevich has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   remove redundant code
>
> src/hotspot/share/adlc/output_h.cpp line 774:
> 
>> 772:     fprintf(fp_hpp, "  Pipeline_Use_Cycle_Mask& operator<<=(int n) {\n");
>> 773:     fprintf(fp_hpp, "    int max_shift = 8 * sizeof(_mask) - 1;\n");
>> 774:     fprintf(fp_hpp, "    _mask <<= (n < max_shift) ? n : max_shift;\n");
> 
> sizeof(_mask) is know - it is sizeof(uint).
> Lines 760-768 should be cleaned: ` <= 32` checks are redundant because of check at line 758. This is leftover from SPARC code (not clean) removal.

Good point - I removed the redundant code.

As for `sizeof(_mask)`, shouldn’t it just be `max_shift = 31` or `_mask <<= (n < 32) ? n : 31;`?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26890#discussion_r2294482253


More information about the hotspot-compiler-dev mailing list