Skip to content

Commit

Permalink
Disable bu2i with i2b child removal for signed arraycmp
Browse files Browse the repository at this point in the history
When the ArrayCmpSign flag is set on an arraycmp node it can return a int -1,
which will not fit in an unsigned byte value.

Signed-off-by: Spencer Comin <[email protected]>
  • Loading branch information
Spencer-Comin committed Jul 13, 2023
1 parent b1af0b4 commit 01391ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/optimizer/OMRSimplifierHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12464,7 +12464,7 @@ TR::Node *bu2iSimplifier(TR::Node * node, TR::Block * block, TR::Simplifier * s)
}
else if (firstChild->getOpCodeValue() == TR::i2b &&
(firstChild->getFirstChild()->getOpCodeValue() == TR::butest ||
firstChild->getFirstChild()->getOpCodeValue() == TR::arraycmp ||
(firstChild->getFirstChild()->getOpCodeValue() == TR::arraycmp && !firstChild->getFirstChild()->isArrayCmpSign()) ||
firstChild->getFirstChild()->getOpCodeValue() == TR::icmpeq ||
firstChild->getFirstChild()->getOpCodeValue() == TR::lcmpeq ||
firstChild->getFirstChild()->getOpCodeValue() == TR::icmpne ||
Expand Down

0 comments on commit 01391ea

Please sign in to comment.