RFR(S): 8181741: C2 compilation fails with "assert(i<_max) failed: oob"
tobias.hartmann at oracle.com
Thu Jun 8 13:17:33 UTC 2017
please review the following patch:
PhaseIdealLoop::split_thru_phi() creates a new PhiNode 'phi' and sets the _igvn type through PhaseIdealLoop::register_new_node() -> PhaseIterGVN::register_new_node_with_optimizer() -> set_type_bottom(). Later in PhaseIdealLoop::split_if_with_blocks_pre() we call n->as_ConstraintCast()->dominating_cast(this) with n == 'phi' which fails because the type for 'phi' is not initialized in PhaseIdealLoop (but only in _igvn).
The call to dominating_cast(this) was introduced in JDK 9 by JDK-8139771 but the the problem only shows up with JDK-8176506 which added a call to type_or_null(val). We should pass both &_igvn and 'this'. I also added an assert to type() and type_or_null() to verify that these methods are not used from PhaseIdealLoop.
Tested with replay compilation, JPRT and RBT (running).
More information about the hotspot-compiler-dev