8202179: Compilation fails with assert(n->is_expensive()) failed: expensive nodes with non-null control here only

Only treat the SqrtFNode as expensive if the control input is not NULL.

Reviewed-by: kvn, roland
This commit is contained in:
Tobias Hartmann 2018-04-27 07:59:29 +02:00
parent 6cc62b8689
commit 1787461d8a
2 changed files with 7 additions and 2 deletions

View File

@ -700,7 +700,7 @@ bool Node::is_dead() const {
//------------------------------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----------------------------------------

View File

@ -448,7 +448,12 @@ class SqrtFNode : public Node {
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; }