# HG changeset patch # User Andreas Woess # Date 1338508909 -7200 # Node ID 4ea62e26643e28a38d4bf575de5758c981494150 # Parent ecb598b9d535a94cb2fa36bf7f54f000aca5fff7 fix for branches that have only a true successor (as emitted for negated guards). diff -r ecb598b9d535 -r 4ea62e26643e graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Thu May 31 18:24:53 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Fri Jun 01 02:01:49 2012 +0200 @@ -707,16 +707,24 @@ } private void emitNullCheckBranch(IsNullNode node, LabelRef trueSuccessor, LabelRef falseSuccessor, LIRDebugInfo info) { - emitBranch(operand(node.object()), CiConstant.NULL_OBJECT, Condition.NE, false, falseSuccessor, info); - if (trueSuccessor != null) { - emitJump(trueSuccessor, null); + if (falseSuccessor != null) { + emitBranch(operand(node.object()), CiConstant.NULL_OBJECT, Condition.NE, false, falseSuccessor, info); + if (trueSuccessor != null) { + emitJump(trueSuccessor, null); + } + } else { + emitBranch(operand(node.object()), CiConstant.NULL_OBJECT, Condition.EQ, false, trueSuccessor, info); } } public void emitCompareBranch(CompareNode compare, LabelRef trueSuccessorBlock, LabelRef falseSuccessorBlock, LIRDebugInfo info) { - emitBranch(operand(compare.x()), operand(compare.y()), compare.condition().negate(), !compare.unorderedIsTrue(), falseSuccessorBlock, info); - if (trueSuccessorBlock != null) { - emitJump(trueSuccessorBlock, null); + if (falseSuccessorBlock != null) { + emitBranch(operand(compare.x()), operand(compare.y()), compare.condition().negate(), !compare.unorderedIsTrue(), falseSuccessorBlock, info); + if (trueSuccessorBlock != null) { + emitJump(trueSuccessorBlock, null); + } + } else { + emitBranch(operand(compare.x()), operand(compare.y()), compare.condition(), compare.unorderedIsTrue(), trueSuccessorBlock, info); } }