diff --git a/runtime/compiler/optimizer/SequentialStoreSimplifier.cpp b/runtime/compiler/optimizer/SequentialStoreSimplifier.cpp index 366eec56d65..e4244ee3535 100644 --- a/runtime/compiler/optimizer/SequentialStoreSimplifier.cpp +++ b/runtime/compiler/optimizer/SequentialStoreSimplifier.cpp @@ -1655,8 +1655,9 @@ bool TR_arraycopySequentialStores::insertConsistentTree() dumpOptDetails(comp(), " insertTree: multiplier must be 1 in aiadd tree\n"); return false; } - TR::SymbolReference* activeBaseRef = _activeAddrTree->getBaseVarNode()->isNull() ? NULL : _activeAddrTree->getBaseVarNode()->getChild()->skipConversions()->getSymbolReference(); - if (activeBaseRef == NULL) + + TR::Node* activeBaseNode = _activeAddrTree->getBaseVarNode()->isNull() ? NULL : _activeAddrTree->getBaseVarNode()->getChild()->skipConversions(); + if (activeBaseNode == NULL) { dumpOptDetails(comp(), " insertTree: no base variable in aiadd tree\n"); return false; @@ -1670,8 +1671,8 @@ bool TR_arraycopySequentialStores::insertConsistentTree() } // make sure the index variable and base variable is consistent with the first tree - TR::SymbolReference* baseRef = _addrTree[0]->getBaseVarNode()->isNull() ? NULL : _addrTree[0]->getBaseVarNode()->getChild()->skipConversions()->getSymbolReference(); - if (baseRef != activeBaseRef) + TR::Node* baseNode = _addrTree[0]->getBaseVarNode()->isNull() ? NULL : _addrTree[0]->getBaseVarNode()->getChild()->skipConversions(); + if (baseNode != activeBaseNode) { dumpOptDetails(comp(), " insertTree: base variable is different than previous tree\n"); return false; @@ -1707,7 +1708,7 @@ bool TR_arraycopySequentialStores::insertConsistentTree() } // make sure the value tree doesn't reference the address tree base var - if (_activeValueTree->getRootNode()->referencesSymbolInSubTree(baseRef, _comp->incOrResetVisitCount())) + if (_activeValueTree->getRootNode() == baseNode || _activeValueTree->getRootNode()->hasChild(baseNode)) { dumpOptDetails(comp(), " insertTree: value tree %p references address tree base var\n", _activeValueTree->getRootNode()); return false;