RFR: 8323682: C2: guard check is not generated in Arrays.copyOfRange intrinsic when allocation is eliminated by EA [v2]

Daniel Lundén dlunden at openjdk.org
Tue Mar 26 14:40:51 UTC 2024


On Mon, 25 Mar 2024 16:50:36 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Daniel Lundén has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Readd negative end check
>
> src/hotspot/share/opto/library_call.cpp line 4323:
> 
>> 4321:     // Bail out if start is negative.
>> 4322:     generate_negative_guard(start, bailout, &start);
>> 4323: 
> 
> I think we need this check to avoid underflow in integer expression (end - start):  (min_int - 1) == max_int

OK, I see. Thanks, I readded the `end` guard.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18472#discussion_r1539380307


More information about the hotspot-compiler-dev mailing list