# HG changeset patch # User Christian Wimmer # Date 1327336005 28800 # Node ID e3374bccaa5f78cb4caa3f244fc39dc521e0b8db # Parent ef004bae30ae3d6c79b2ccaa585c2886a9cf23c4# Parent b4b16e4e043fe4d765630d6bd61c2c84ddc1d473 Merge diff -r b4b16e4e043f -r e3374bccaa5f graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/LIRVerifier.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/LIRVerifier.java Mon Jan 23 14:35:29 2012 +0100 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/LIRVerifier.java Mon Jan 23 08:26:45 2012 -0800 @@ -147,7 +147,9 @@ private CiValue use(CiValue value, OperandMode mode, EnumSet flags) { allowed(curInstruction, value, mode, flags); - if (beforeRegisterAllocation && isVariable(value)) { + if (isVariable(value)) { + assert beforeRegisterAllocation; + int variableIdx = asVariable(value).index; if (!curVariablesLive.get(variableIdx)) { TTY.println("block %s instruction %s", curBlock, curInstruction); @@ -159,9 +161,13 @@ throw Util.shouldNotReachHere(); } - } else if (beforeRegisterAllocation && isAllocatableRegister(value)) { + } else if (isAllocatableRegister(value)) { int regNum = asRegister(value).number; - if (curRegistersLive[regNum] != value) { + if (mode == OperandMode.Alive) { + curRegistersDefined.set(regNum); + } + + if (beforeRegisterAllocation && curRegistersLive[regNum] != value) { TTY.println("block %s instruction %s", curBlock, curInstruction); TTY.println("live registers: %s", Arrays.toString(curRegistersLive)); TTY.println("ERROR: Use of fixed register %s that is not defined in this block", value); @@ -174,7 +180,9 @@ private CiValue def(CiValue value, OperandMode mode, EnumSet flags) { allowed(curInstruction, value, mode, flags); - if (beforeRegisterAllocation && isVariable(value)) { + if (isVariable(value)) { + assert beforeRegisterAllocation; + int variableIdx = asVariable(value).index; if (variableDefinitions[variableIdx] != null) { TTY.println("block %s instruction %s", curBlock, curInstruction); @@ -190,7 +198,7 @@ curVariablesLive.set(variableIdx); } - } else if (beforeRegisterAllocation && isAllocatableRegister(value)) { + } else if (isAllocatableRegister(value)) { int regNum = asRegister(value).number; if (curRegistersDefined.get(regNum)) { TTY.println("block %s instruction %s", curBlock, curInstruction);