8238384: CTW: C2 compilation fails with "assert(store != load->find_exact_control(load->in(0))) failed: dependence cycle found"

Reviewed-by: vlivanov, thartmann
This commit is contained in:
Roland Westrelin 2020-02-20 16:41:05 +01:00
parent 1e796eae8f
commit 86ad195099
7 changed files with 82 additions and 20 deletions

View file

@ -707,19 +707,6 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) {
// instead of control + memory.
if (mstore->ideal_Opcode() == Op_SafePoint)
continue;
// Check if the store is a membar on which the load is control dependent.
// Inserting an anti-dependency between that membar and the load would
// create a cycle that causes local scheduling to fail.
if (mstore->isa_MachMemBar()) {
Node* dom = load->find_exact_control(load->in(0));
while (dom != NULL && dom != dom->in(0) && dom != mstore) {
dom = dom->in(0);
}
if (dom == mstore) {
continue;
}
}
} else {
// Some raw memory, such as the load of "top" at an allocation,
// can be control dependent on the previous safepoint. See