1 $NetBSD: patch-hotspot_src_share_vm_opto_library__call.cpp,v 1.2 2019/11/02 21:31:14 tnn Exp $
3 Left shift of negative values is UB.
5 --- hotspot/src/share/vm/opto/library_call.cpp.orig 2019-10-16 01:41:55.000000000 +0000
6 +++ hotspot/src/share/vm/opto/library_call.cpp
7 @@ -3803,7 +3803,7 @@ Node* LibraryCallKit::generate_array_gua
9 // Now test the correct condition.
10 jint nval = (obj_array
11 - ? (jint)(Klass::_lh_array_tag_type_value
12 + ? (jint)((juint)Klass::_lh_array_tag_type_value
13 << Klass::_lh_array_tag_shift)
14 : Klass::_lh_neutral_value);
15 Node* cmp = _gvn.transform(new(C) CmpINode(layout_val, intcon(nval)));