8054054: 8040121 is broken
authorroland
Thu, 31 Jul 2014 19:59:36 +0200
changeset 25922 2967d086df71
parent 25921 3e0e9399c3ac
child 25923 7fdd555fd532
8054054: 8040121 is broken Summary: C++ code pattern from 8040121 is incorrect Reviewed-by: kvn
hotspot/src/share/vm/opto/output.cpp
hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp
--- a/hotspot/src/share/vm/opto/output.cpp	Tue Jul 29 21:28:09 2014 +0000
+++ b/hotspot/src/share/vm/opto/output.cpp	Thu Jul 31 19:59:36 2014 +0200
@@ -785,7 +785,8 @@
     // grow downwards in all implementations.
     // (If, on some machine, the interpreter's Java locals or stack
     // were to grow upwards, the embedded doubles would be word-swapped.)
-    jlong_accessor acc = { jlong_cast(d) };
+    jlong_accessor acc;
+    acc.long_value = jlong_cast(d);
     array->append(new ConstantIntValue(acc.words[1]));
     array->append(new ConstantIntValue(acc.words[0]));
 #endif
@@ -804,7 +805,8 @@
     // grow downwards in all implementations.
     // (If, on some machine, the interpreter's Java locals or stack
     // were to grow upwards, the embedded doubles would be word-swapped.)
-    jlong_accessor acc = { d };
+    jlong_accessor acc;
+    acc.long_value = d;
     array->append(new ConstantIntValue(acc.words[1]));
     array->append(new ConstantIntValue(acc.words[0]));
 #endif
--- a/hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp	Tue Jul 29 21:28:09 2014 +0000
+++ b/hotspot/src/share/vm/runtime/sharedRuntimeMath.hpp	Thu Jul 31 19:59:36 2014 +0200
@@ -42,29 +42,34 @@
 } DoubleIntConv;
 
 static inline int high(double d) {
-  DoubleIntConv x = { d };
+  DoubleIntConv x;
+  x.d = d;
   return x.split.hi;
 }
 
 static inline int low(double d) {
-  DoubleIntConv x = { d };
+  DoubleIntConv x;
+  x.d = d;
   return x.split.lo;
 }
 
 static inline void set_high(double* d, int high) {
-  DoubleIntConv conv = { *d };
+  DoubleIntConv conv;
+  conv.d = *d;
   conv.split.hi = high;
   *d = conv.d;
 }
 
 static inline void set_low(double* d, int low) {
-  DoubleIntConv conv = { *d };
+  DoubleIntConv conv;
+  conv.d = *d;
   conv.split.lo = low;
   *d = conv.d;
 }
 
 static double copysignA(double x, double y) {
-  DoubleIntConv convX = { x };
+  DoubleIntConv convX;
+  convX.d = x;
   convX.split.hi = (convX.split.hi & 0x7fffffff) | (high(y) & 0x80000000);
   return convX.d;
 }