提交 12ef0030 编写于 作者: T thartmann

8008321: compile.cpp verify_graph_edges uses bool as int

Summary: The dead_nodes counter in verify_graph_edges(..) has the type bool but is used as int.
Reviewed-by: roland, anoll
上级 26e38aff
...@@ -3480,7 +3480,7 @@ void Compile::verify_graph_edges(bool no_dead_code) { ...@@ -3480,7 +3480,7 @@ void Compile::verify_graph_edges(bool no_dead_code) {
_root->verify_edges(visited); _root->verify_edges(visited);
if (no_dead_code) { if (no_dead_code) {
// Now make sure that no visited node is used by an unvisited node. // Now make sure that no visited node is used by an unvisited node.
bool dead_nodes = 0; bool dead_nodes = false;
Unique_Node_List checked(area); Unique_Node_List checked(area);
while (visited.size() > 0) { while (visited.size() > 0) {
Node* n = visited.pop(); Node* n = visited.pop();
...@@ -3491,14 +3491,16 @@ void Compile::verify_graph_edges(bool no_dead_code) { ...@@ -3491,14 +3491,16 @@ void Compile::verify_graph_edges(bool no_dead_code) {
if (visited.member(use)) continue; // already in the graph if (visited.member(use)) continue; // already in the graph
if (use->is_Con()) continue; // a dead ConNode is OK if (use->is_Con()) continue; // a dead ConNode is OK
// At this point, we have found a dead node which is DU-reachable. // At this point, we have found a dead node which is DU-reachable.
if (dead_nodes++ == 0) if (!dead_nodes) {
tty->print_cr("*** Dead nodes reachable via DU edges:"); tty->print_cr("*** Dead nodes reachable via DU edges:");
dead_nodes = true;
}
use->dump(2); use->dump(2);
tty->print_cr("---"); tty->print_cr("---");
checked.push(use); // No repeats; pretend it is now checked. checked.push(use); // No repeats; pretend it is now checked.
} }
} }
assert(dead_nodes == 0, "using nodes must be reachable from root"); assert(!dead_nodes, "using nodes must be reachable from root");
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册