8008321: compile.cpp verify_graph_edges uses bool as int
authorthartmann
Fri, 20 Jun 2014 08:14:30 +0200
changeset 25338 8afcbcb8271a
parent 25080 6566800452ca
child 25339 ca74d9691341
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
hotspot/src/share/vm/opto/compile.cpp
--- a/hotspot/src/share/vm/opto/compile.cpp	Thu Jun 19 12:50:52 2014 -0700
+++ b/hotspot/src/share/vm/opto/compile.cpp	Fri Jun 20 08:14:30 2014 +0200
@@ -3411,7 +3411,7 @@
     _root->verify_edges(visited);
     if (no_dead_code) {
       // 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);
       while (visited.size() > 0) {
         Node* n = visited.pop();
@@ -3422,14 +3422,16 @@
           if (visited.member(use))  continue;  // already in the graph
           if (use->is_Con())        continue;  // a dead ConNode is OK
           // 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:");
+            dead_nodes = true;
+          }
           use->dump(2);
           tty->print_cr("---");
           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");
     }
   }
 }