From c546af932a5e27f8b845e9d3dbe406dea17f6730 Mon Sep 17 00:00:00 2001 From: Jakob Botsch Nielsen Date: Wed, 20 Mar 2024 10:45:42 +0100 Subject: [PATCH] JIT: Fix flags updating when sinking stores below commas When we sink a store below a comma, we should update the comma's flags after updating the flags of the store, not before. Fix #99929 --- src/coreclr/jit/importer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index a562ab90ac3c1..9d5b574dd0aa1 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -1019,8 +1019,8 @@ GenTree* Compiler::impStoreStruct(GenTree* store, // Instead, we're going to sink the store below the COMMA. store->Data() = src->AsOp()->gtOp2; src->AsOp()->gtOp2 = impStoreStruct(store, curLevel, pAfterStmt, usedDI, block); - src->SetAllEffectsFlags(src->AsOp()->gtOp1, src->AsOp()->gtOp2); gtUpdateNodeSideEffects(store); + src->SetAllEffectsFlags(src->AsOp()->gtOp1, src->AsOp()->gtOp2); return src; }