src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/MathUtil.java
changeset 58877 aec7bf35d6f5
parent 54084 84f10bbf993f
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/MathUtil.java	Thu Oct 31 14:23:06 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/MathUtil.java	Thu Oct 31 16:54:16 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -94,7 +94,9 @@
             if (before.predecessor() instanceof FixedBinaryNode) {
                 FixedBinaryNode binaryPredecessor = (FixedBinaryNode) before.predecessor();
                 if (fixedDiv.dataFlowEquals(binaryPredecessor)) {
-                    fixedDiv.safeDelete();
+                    if (fixedDiv.isAlive()) {
+                        fixedDiv.safeDelete();
+                    }
                     return binaryPredecessor;
                 }
             }