8147386: assert(size == calc_size) failed: incorrect size calculattion x86_32.ad
authorroland
Tue, 19 Jan 2016 17:58:02 +0100
changeset 35585 439d9cd90559
parent 35583 3e83096ee8e5
child 35586 2aeb1ca2c40b
8147386: assert(size == calc_size) failed: incorrect size calculattion x86_32.ad Summary: incorrect offset used in spill code for vectors Reviewed-by: vlivanov, kvn, mcberg
hotspot/src/cpu/x86/vm/x86_32.ad
--- a/hotspot/src/cpu/x86/vm/x86_32.ad	Wed Jan 20 17:00:17 2016 -1000
+++ b/hotspot/src/cpu/x86/vm/x86_32.ad	Tue Jan 19 17:58:02 2016 +0100
@@ -968,14 +968,15 @@
   case Op_VecS:
     calc_size = 3+src_offset_size + 3+dst_offset_size;
     break;
-  case Op_VecD:
+  case Op_VecD: {
     calc_size = 3+src_offset_size + 3+dst_offset_size;
-    src_offset += 4;
-    dst_offset += 4;
-    src_offset_size = (src_offset == 0) ? 0 : ((src_offset < 0x80) ? 1 : 4);
-    dst_offset_size = (dst_offset == 0) ? 0 : ((dst_offset < 0x80) ? 1 : 4);
+    int tmp_src_offset = src_offset + 4;
+    int tmp_dst_offset = dst_offset + 4;
+    src_offset_size = (tmp_src_offset == 0) ? 0 : ((tmp_src_offset < 0x80) ? 1 : 4);
+    dst_offset_size = (tmp_dst_offset == 0) ? 0 : ((tmp_dst_offset < 0x80) ? 1 : 4);
     calc_size += 3+src_offset_size + 3+dst_offset_size;
     break;
+  }   
   case Op_VecX:
   case Op_VecY:
   case Op_VecZ:
@@ -1020,7 +1021,7 @@
       ShouldNotReachHere();
     }
     int size = __ offset() - offset;
-    assert(size == calc_size, "incorrect size calculattion");
+    assert(size == calc_size, "incorrect size calculation");
     return size;
 #ifndef PRODUCT
   } else if (!do_size) {