From: Jakob Botsch Nielsen Date: Mon, 9 Aug 2021 17:20:39 +0000 (+0200) Subject: Fix missing offset in contained BITCAST for STORE_LCL_FLD (#57059) X-Git-Tag: accepted/tizen/unified/20220110.054933~548 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=de984a0d234f86b414f398332c9909bc5c5533b9;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Fix missing offset in contained BITCAST for STORE_LCL_FLD (#57059) --- diff --git a/src/coreclr/jit/codegenxarch.cpp b/src/coreclr/jit/codegenxarch.cpp index 529d1fe..f268c6a 100644 --- a/src/coreclr/jit/codegenxarch.cpp +++ b/src/coreclr/jit/codegenxarch.cpp @@ -4450,7 +4450,7 @@ void CodeGen::genCodeForStoreLclFld(GenTreeLclFld* tree) LclVarDsc* varDsc = compiler->lvaGetDesc(lclNum); GetEmitter()->emitIns_S_R(ins_Store(srcType, compiler->isSIMDTypeLocalAligned(lclNum)), - emitTypeSize(targetType), bitCastSrc->GetRegNum(), lclNum, 0); + emitTypeSize(targetType), bitCastSrc->GetRegNum(), lclNum, tree->GetLclOffs()); varDsc->SetRegNum(REG_STK); } else diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_55141/Runtime_55141_2.cs b/src/tests/JIT/Regression/JitBlue/Runtime_55141/Runtime_55141_2.cs new file mode 100644 index 0000000..2d70237 --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_55141/Runtime_55141_2.cs @@ -0,0 +1,38 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// Generated by Fuzzlyn v1.2 on 2021-07-22 13:45:33 +// Seed: 7718323254176193466 +// Reduced from 89.3 KiB to 0.4 KiB in 00:00:46 +// Debug: Outputs 1 +// Release: Outputs 0 + +using System.Runtime.CompilerServices; + +struct S2 +{ + public uint F0; + public long F1; + public uint F2; + public short F3; + public bool F4; + public S2(uint f0, uint f2): this() + { + F0 = f0; + F2 = f2; + } +} + +public class Runtime_55141_2 +{ + static int s_1; + public static int Main() + { + int vr23 = s_1; + S2 vr29 = new S2(1, (uint)vr23 / 40319); + return M(vr29.F0) == 1 ? 100 : -1; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private static uint M(uint val) => val; +} \ No newline at end of file diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_55141/Runtime_55141_2.csproj b/src/tests/JIT/Regression/JitBlue/Runtime_55141/Runtime_55141_2.csproj new file mode 100644 index 0000000..e8e73ed --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_55141/Runtime_55141_2.csproj @@ -0,0 +1,10 @@ + + + Exe + True + None + + + + + \ No newline at end of file