# HG changeset patch # User Roland Schatz # Date 1375453262 -7200 # Node ID 4c648c43150c0523c8e822843bf39bed9c2fc925 # Parent 87d9b55180653adada1e27d432ea2323a33f5168 Fix bug in FixedGuardNode simplification. diff -r 87d9b5518065 -r 4c648c43150c graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java Fri Aug 02 11:22:23 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java Fri Aug 02 16:21:02 2013 +0200 @@ -84,16 +84,18 @@ public void simplify(SimplifierTool tool) { if (condition instanceof LogicConstantNode) { LogicConstantNode c = (LogicConstantNode) condition; - if (c.getValue() != negated) { - this.replaceAtUsages(BeginNode.prevBegin(this)); - graph().removeFixed(this); - } else { - FixedWithNextNode predecessor = (FixedWithNextNode) predecessor(); + if (c.getValue() == negated) { + FixedNode next = this.next(); + if (next != null) { + tool.deleteBranch(next); + } + DeoptimizeNode deopt = graph().add(new DeoptimizeNode(DeoptimizationAction.InvalidateRecompile, reason)); deopt.setDeoptimizationState(getDeoptimizationState()); - tool.deleteBranch(this); - predecessor.setNext(deopt); + setNext(deopt); } + this.replaceAtUsages(BeginNode.prevBegin(this)); + graph().removeFixed(this); } }