--- a/src/hotspot/share/opto/node.cpp Wed Jan 09 00:25:41 2019 -0800
+++ b/src/hotspot/share/opto/node.cpp Fri Dec 07 17:56:51 2018 +0100
@@ -37,6 +37,7 @@
#include "opto/node.hpp"
#include "opto/opcodes.hpp"
#include "opto/regmask.hpp"
+#include "opto/rootnode.hpp"
#include "opto/type.hpp"
#include "utilities/copy.hpp"
#include "utilities/macros.hpp"
@@ -1310,6 +1311,9 @@
while (nstack.size() > 0) {
dead = nstack.pop();
+ if (dead->Opcode() == Op_SafePoint) {
+ dead->as_SafePoint()->disconnect_from_root(igvn);
+ }
if (dead->outcnt() > 0) {
// Keep dead node on stack until all uses are processed.
nstack.push(dead);