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

Sandhya Viswanathan sviswanathan at openjdk.java.net
Tue Jun 22 00:15:41 UTC 2021


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 and afterwards a bailout happens.

The fix is as per discussion on https://github.com/openjdk/jdk/pull/3958.

Best Regards,
Sandhya

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

Commit messages:
 - 8266854: LibraryCallKit::inline_preconditions_checkIndex modifies control flow even if the intrinsic bailed out

Changes: https://git.openjdk.java.net/jdk17/pull/114/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk17&pr=114&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8266854
  Stats: 9 lines in 1 file changed: 4 ins; 4 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk17/pull/114.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk17 pull/114/head:pull/114

PR: https://git.openjdk.java.net/jdk17/pull/114


More information about the hotspot-compiler-dev mailing list