forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
That blocks the swap:
noway_assert(op1);
if (op1->OperIsConst() && (op1->gtType != TYP_REF))
{
// TODO-Review: We used to assert here that
// noway_assert(!op2->OperIsConst() || !opts.OptEnabled(CLFLG_CONSTANTFOLD));
// With modifications to AddrTaken==>AddrExposed, we did more assertion propagation,
// and would sometimes hit this assertion. This may indicate a missed "remorph".
// Task is to re-enable this assertion and investigate.
/* Swap the operands */
tree->AsOp()->gtOp1 = op2;
tree->AsOp()->gtOp2 = op1;
op1 = op2;
op2 = tree->AsOp()->gtOp2;
}
so for a tree-like ADD(ref 0, cnst_int 4) we don't transform that tree,
// If this addition is adding an offset to a null pointer,
// avoid the work and yield the null pointer immediately.
// Dereferencing the pointer in either case will have the
// same effect.
that comment is probably wrong because it expects ref 0 as the second operand, but it will be always the first.
and at the end SetEvalOrder will ignore ref and swap them. See issue 32466
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels