changeset 52131:c11be049acb8

8209511: C2 asserts with UseSSE < 4 and AVX enabled: "Label was never bound to a location, but it was used as a jmp target' Summary: Make sure label is bound even if SSE is disabled. Reviewed-by: kvn
author thartmann
date Thu, 16 Aug 2018 09:09:18 +0200
parents 45d1f2ec5342
children 6bb7b8d0da76
files src/hotspot/cpu/x86/macroAssembler_x86.cpp
diffstat 1 files changed, 20 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Wed Aug 15 19:22:46 2018 -0700
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Thu Aug 16 09:09:18 2018 +0200
@@ -10567,7 +10567,7 @@
   XMMRegister tmp1Reg, XMMRegister tmp2Reg,
   XMMRegister tmp3Reg, XMMRegister tmp4Reg,
   Register tmp5, Register result) {
-  Label copy_chars_loop, return_length, return_zero, done, below_threshold;
+  Label copy_chars_loop, return_length, return_zero, done;
 
   // rsi: src
   // rdi: dst
@@ -10590,13 +10590,12 @@
 
     set_vector_masking();  // opening of the stub context for programming mask registers
 
-    Label copy_32_loop, copy_loop_tail, restore_k1_return_zero;
-
-    // alignement
-    Label post_alignement;
-
-    // if length of the string is less than 16, handle it in an old fashioned
-    // way
+    Label copy_32_loop, copy_loop_tail, restore_k1_return_zero, below_threshold;
+
+    // alignment
+    Label post_alignment;
+
+    // if length of the string is less than 16, handle it in an old fashioned way
     testl(len, -32);
     jcc(Assembler::zero, below_threshold);
 
@@ -10609,7 +10608,7 @@
     kmovql(k3, k1);
 
     testl(len, -64);
-    jcc(Assembler::zero, post_alignement);
+    jcc(Assembler::zero, post_alignment);
 
     movl(tmp5, dst);
     andl(tmp5, (32 - 1));
@@ -10618,7 +10617,7 @@
 
     // bail out when there is nothing to be done
     testl(tmp5, 0xFFFFFFFF);
-    jcc(Assembler::zero, post_alignement);
+    jcc(Assembler::zero, post_alignment);
 
     // ~(~0 << len), where len is the # of remaining elements to process
     movl(result, 0xFFFFFFFF);
@@ -10638,8 +10637,8 @@
     addptr(dst, tmp5);
     subl(len, tmp5);
 
-    bind(post_alignement);
-    // end of alignement
+    bind(post_alignment);
+    // end of alignment
 
     movl(tmp5, len);
     andl(tmp5, (32 - 1));    // tail count (in chars)
@@ -10694,12 +10693,13 @@
     jmp(return_zero);
 
     clear_vector_masking();   // closing of the stub context for programming mask registers
-  }
+
+    bind(below_threshold);
+  }
+
   if (UseSSE42Intrinsics) {
     Label copy_32_loop, copy_16, copy_tail;
 
-    bind(below_threshold);
-
     movl(result, len);
 
     movl(tmp5, 0xff00ff00);   // create mask to test for Unicode chars in vectors
@@ -10812,8 +10812,7 @@
     Label copy_32_loop, copy_tail;
     Register tmp3_aliased = len;
 
-    // if length of the string is less than 16, handle it in an old fashioned
-    // way
+    // if length of the string is less than 16, handle it in an old fashioned way
     testl(len, -16);
     jcc(Assembler::zero, below_threshold);
 
@@ -10927,7 +10926,10 @@
     addptr(dst, 8);
 
     bind(copy_bytes);
-  }
+  } else {
+    bind(below_threshold);
+  }
+
   testl(len, len);
   jccb(Assembler::zero, done);
   lea(src, Address(src, len, Address::times_1));