8202179: Compilation fails with assert(n->is_expensive()) failed: expensive nodes with non-null control here only
authorthartmann
Fri, 27 Apr 2018 07:59:29 +0200
changeset 49908 22eb3e22f245
parent 49907 1ca3406a2101
child 49909 f276b348ec14
8202179: Compilation fails with assert(n->is_expensive()) failed: expensive nodes with non-null control here only Summary: Only treat the SqrtFNode as expensive if the control input is not NULL. Reviewed-by: kvn, roland
src/hotspot/share/opto/node.cpp
src/hotspot/share/opto/subnode.hpp
--- a/src/hotspot/share/opto/node.cpp	Thu Apr 26 15:41:48 2018 +0200
+++ b/src/hotspot/share/opto/node.cpp	Fri Apr 27 07:59:29 2018 +0200
@@ -700,7 +700,7 @@
 //------------------------------is_unreachable---------------------------------
 bool Node::is_unreachable(PhaseIterGVN &igvn) const {
   assert(!is_Mach(), "doesn't work with MachNodes");
-  return outcnt() == 0 || igvn.type(this) == Type::TOP || in(0)->is_top();
+  return outcnt() == 0 || igvn.type(this) == Type::TOP || (in(0) != NULL && in(0)->is_top());
 }
 
 //------------------------------add_req----------------------------------------
--- a/src/hotspot/share/opto/subnode.hpp	Thu Apr 26 15:41:48 2018 +0200
+++ b/src/hotspot/share/opto/subnode.hpp	Fri Apr 27 07:59:29 2018 +0200
@@ -448,7 +448,12 @@
 public:
   SqrtFNode(Compile* C, Node *c, Node *in1) : Node(c, in1) {
     init_flags(Flag_is_expensive);
-    C->add_expensive_node(this);
+    if (c != NULL) {
+      // Treat node only as expensive if a control input is set because it might
+      // be created from a SqrtDNode in ConvD2FNode::Ideal() that was found to
+      // be unique and therefore has no control input.
+      C->add_expensive_node(this);
+    }
   }
   virtual int Opcode() const;
   const Type *bottom_type() const { return Type::FLOAT; }