Skip to content

Commit

Permalink
Make globalReg clobberable in Z iRegStoreEvaluator
Browse files Browse the repository at this point in the history
If the iRegStoreEvaluator generates an LGFR to sign extend, it is
incorrect to assume that the iRegStore's child is clobberable. We must
preserve the original value when sign extending. This commit fixes
this issue by using the gprClobberEvaluate routine so that the sign
extension is performed in a different register, and we don't potentially
overwrite the upper-half data in the original register.
  • Loading branch information
dchopra001 committed Nov 15, 2023
1 parent 09c77a9 commit df44968
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/z/codegen/OMRTreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13787,7 +13787,7 @@ OMR::Z::TreeEvaluator::iRegStoreEvaluator(TR::Node * node, TR::CodeGenerator * c

if (!useLGHI)
{
globalReg = cg->evaluate(value);
globalReg = needsLGFR && noLGFgenerated ? cg->gprClobberEvaluate(value) : cg->evaluate(value);
}
else
{
Expand Down

0 comments on commit df44968

Please sign in to comment.