From bc037b15ff00692333f434b1483fb4d2a2e522cd Mon Sep 17 00:00:00 2001 From: Benjamin Thomas Date: Thu, 27 Aug 2020 14:21:08 +0000 Subject: [PATCH] Add internal pointer assert to Power select evaluator The select evaluator in the Power codegen cannot handle select nodes with children that are internal pointers, since information about the pinning array pointer would be lost. An assert has been added to verify that internal pointers are not passed to this evaluator. Signed-off-by: Ben Thomas --- compiler/p/codegen/ControlFlowEvaluator.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/compiler/p/codegen/ControlFlowEvaluator.cpp b/compiler/p/codegen/ControlFlowEvaluator.cpp index 2b7022fba7a..0dbaec8f022 100644 --- a/compiler/p/codegen/ControlFlowEvaluator.cpp +++ b/compiler/p/codegen/ControlFlowEvaluator.cpp @@ -1770,6 +1770,11 @@ TR::Register *OMR::Power::TreeEvaluator::iselectEvaluator(TR::Node *node, TR::Co generateTrg1Src3Instruction(cg, iselOp, node, trgReg, trueReg, falseReg, condReg); } + TR_ASSERT_FATAL_WITH_NODE( + node, + !trueReg->containsInternalPointer() && !falseReg->containsInternalPointer(), + "Select nodes cannot have children that are internal pointers" + ); if (trueReg->containsCollectedReference() || falseReg->containsCollectedReference()) trgReg->setContainsCollectedReference(); } @@ -1780,6 +1785,11 @@ TR::Register *OMR::Power::TreeEvaluator::iselectEvaluator(TR::Node *node, TR::Co trgReg = cg->gprClobberEvaluate(trueNode); TR::Register *falseReg = cg->evaluate(falseNode); + TR_ASSERT_FATAL_WITH_NODE( + node, + !trgReg->containsInternalPointer() && !falseReg->containsInternalPointer(), + "Select nodes cannot have children that are internal pointers" + ); if (falseReg->containsCollectedReference()) trgReg->setContainsCollectedReference();