diff --git a/runtime/compiler/p/codegen/J9TreeEvaluator.cpp b/runtime/compiler/p/codegen/J9TreeEvaluator.cpp index d8e55abbda5..7bcb6d4b814 100644 --- a/runtime/compiler/p/codegen/J9TreeEvaluator.cpp +++ b/runtime/compiler/p/codegen/J9TreeEvaluator.cpp @@ -2489,7 +2489,7 @@ TR::Register *J9::Power::TreeEvaluator::ArrayCopyBNDCHKEvaluator(TR::Node *node, { gcPoint = generateLabelInstruction(cg, TR::InstOpCode::bl, node, snippetLabel); } - else if (firstChild->getOpCode().isLoadConst() && firstChild->getInt() <= UPPER_IMMED && firstChild->getRegister() == NULL) + else if (firstChild->getOpCode().isLoadConst() && firstChild->getInt() >= LOWER_IMMED && firstChild->getInt() <= UPPER_IMMED && firstChild->getRegister() == NULL) { TR::Register *copyIndexReg = cg->evaluate(secondChild); if (noTrap) @@ -2508,7 +2508,7 @@ TR::Register *J9::Power::TreeEvaluator::ArrayCopyBNDCHKEvaluator(TR::Node *node, else { TR::Register *boundReg = cg->evaluate(firstChild); - if (secondChild->getOpCode().isLoadConst() && secondChild->getInt() <= UPPER_IMMED) + if (secondChild->getOpCode().isLoadConst() && secondChild->getInt() >= LOWER_IMMED && secondChild->getInt() <= UPPER_IMMED) { if (noTrap) {