changeset 21402:8adf2a826696

[SPARC] Sign extend address to 64 bit when building an address
author Stefan Anzinger <stefan.anzinger@oracle.com>
date Fri, 15 May 2015 14:47:23 +0200
parents 307a1ee8f714
children 0c70dca70eeb
files graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Fri May 15 11:55:52 2015 +0200
+++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Fri May 15 14:47:23 2015 +0200
@@ -154,15 +154,15 @@
                 finalDisp += asConstant(index).asLong() * scale;
                 indexRegister = Value.ILLEGAL;
             } else {
+                Value longIndex = index.getKind() == Kind.Long ? index : emitSignExtend(index, 32, 64);
                 if (scale != 1) {
-                    Value longIndex = index.getKind() == Kind.Long ? index : emitSignExtend(index, 32, 64);
                     if (CodeUtil.isPowerOf2(scale)) {
                         indexRegister = emitShl(longIndex, JavaConstant.forLong(CodeUtil.log2(scale)));
                     } else {
                         indexRegister = emitMul(longIndex, JavaConstant.forLong(scale), false);
                     }
                 } else {
-                    indexRegister = asAllocatable(index);
+                    indexRegister = asAllocatable(longIndex);
                 }
             }
         } else {