7169934: pow(x,y) or x64 computes incorrect result when x<0 and y is an odd integer
Summary: bad test for parity of y in pow(x,y) (c1, interpreter)
Reviewed-by: kvn, twisti
--- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp Fri May 18 12:20:24 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp Mon May 21 09:46:02 2012 +0200
@@ -6954,7 +6954,7 @@
tmp = rdx;
}
Register tmp2 = rax;
- NOT_LP64(Register tmp3 = rcx;)
+ Register tmp3 = rcx;
if (is_exp) {
// Stack: X
@@ -7081,7 +7081,8 @@
#else
{
Label integer;
- shlq(tmp2, 1);
+ mov(tmp3, tmp2); // preserve tmp2 for parity check below
+ shlq(tmp3, 1);
jcc(Assembler::carryClear, integer);
jcc(Assembler::notZero, integer);
stop("integer indefinite value shouldn't be seen here");