RFR: 8266854: LibraryCallKit::inline_preconditions_checkIndex modifies control flow even if the intrinsic bailed out [v3]

Vladimir Kozlov kvn at openjdk.java.net
Wed May 12 19:08:08 UTC 2021


On Wed, 12 May 2021 16:57:17 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:

>> LibraryCallKit::inline_preconditions_checkIndex can result in the following assert sometimes:
>>    "# assert(ctrl == kit.control()) failed: Control flow was added although the intrinsic bailed out"
>> 
>> Consider the following code snippet:
>>  ...
>>  set_control(_gvn.transform(new IfTrueNode(rc)));
>>  {
>>    PreserveJVMState pjvms(this);
>>    set_control(_gvn.transform(new IfFalseNode(rc)));
>>    uncommon_trap(Deoptimization::Reason_range_check,
>>                  Deoptimization::Action_make_not_entrant);
>>  }
>>  ..
>>  Here the control is being modified by set_control even though a bailout is possible afterwards.
>>  Moving the set_control later in the intrinsic fixes this.
>> 
>>  This is a small fix. Please review.
>> 
>> Best Regards,
>> Sandhya
>
> Sandhya Viswanathan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   return true if stopped

Looks good but it would be nice to have a test which verifies such edge cases for this intrinsic.

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

PR: https://git.openjdk.java.net/jdk/pull/3958


More information about the hotspot-compiler-dev mailing list