8066045: opto/node.hpp:355, assert(i < _max) failed: oob: i=1, _max=1
Code in PhaseIterGVN::add_users_to_worklist() from 8054478 makes incorrect assumption about graph shape
Reviewed-by: iveresov
diff --git a/hotspot/src/share/vm/opto/phaseX.cpp b/hotspot/src/share/vm/opto/phaseX.cpp
index 3f5373b..477ab28 100644
--- a/hotspot/src/share/vm/opto/phaseX.cpp
+++ b/hotspot/src/share/vm/opto/phaseX.cpp
@@ -1431,7 +1431,7 @@
Node* castii = in1->raw_out(i);
if (castii->in(0) != NULL && castii->in(0)->in(0) != NULL && castii->in(0)->in(0)->is_If()) {
Node* ifnode = castii->in(0)->in(0);
- if (ifnode->in(1) != NULL && ifnode->in(1)->in(1) == use) {
+ if (ifnode->in(1) != NULL && ifnode->in(1)->is_Bool() && ifnode->in(1)->in(1) == use) {
// Reprocess a CastII node that may depend on an
// opaque node value when the opaque node is
// removed. In case it carries a dependency we can do