Skip to content

Commit 4851d08

Browse files
committed
JIT: avoid local jtrue assertions involving floating types
Float relop equality does not imply bitwise equality. So skip making local jtrue assertions about floating types. Contributes to dotnet#93246.
1 parent fd0ba02 commit 4851d08

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/coreclr/jit/assertionprop.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -2205,6 +2205,13 @@ AssertionInfo Compiler::optAssertionGenJtrue(GenTree* tree)
22052205
GenTree* op1 = relop->AsOp()->gtOp1->gtCommaStoreVal();
22062206
GenTree* op2 = relop->AsOp()->gtOp2->gtCommaStoreVal();
22072207

2208+
// Avoid creating local assertions for float types.
2209+
//
2210+
if (optLocalAssertionProp && varTypeIsFloating(op1))
2211+
{
2212+
return NO_ASSERTION_INDEX;
2213+
}
2214+
22082215
// Check for op1 or op2 to be lcl var and if so, keep it in op1.
22092216
if ((op1->gtOper != GT_LCL_VAR) && (op2->gtOper == GT_LCL_VAR))
22102217
{

0 commit comments

Comments
 (0)