Skip to content

Assertion failed 'emitOffsAdj == newOffsAdj' during 'Emit code'  #57041

@kunalspathak

Description

@kunalspathak
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
//
// This file is auto-generated.
// Seed: -1
//
using System;
using System.Runtime.CompilerServices;
public class TestClass34
{
    public struct S1
    {
    }
    public struct S2
    {
        public bool boolean_1;
    }
    public struct S4
    {
        public ulong uint64_1;
        public decimal decimal_3;
        public byte byte_4;
    }
    public struct S5
    {
    }
    static bool s_boolean_0 = false;
    static int s_int32_6 = 1;
    static float s_single_9 = 1;
    static ulong s_uint64_13 = 1;
    static S1 s_s1_15 = new S1();
    static S2 s_s2_16 = new S2();
    static S4 s_s4_18 = new S4();
    static int s_loopInvariant = 4;
    public int LeafMethod6()
    {
        unchecked
        {
            return s_int32_6 ^= s_int32_6 |= 15 | 4;
        }
    }
    [MethodImpl(MethodImplOptions.NoInlining)]
    public ulong LeafMethod13()
    {
        unchecked
        {
            return s_s4_18.uint64_1;
        }
    }
    public decimal Method1(ref S2 p_s2_0, ref S5 p_s5_1, out S2 p_s2_2, float p_single_3, S2 p_s2_4, S1 p_s1_5, ref S1 p_s1_6)
    {
        unchecked
        {
            int int32_2 = 1;
            ulong uint64_3 = 1;
            p_s2_2 = p_s2_4;
            { }
            {
                for (int __loopvar0 = s_loopInvariant - 9; s_int32_6 < (int32_2 %= 15 + 4) - (s_int32_6 *= LeafMethod6() ^ LeafMethod6() >> (int32_2 <<= 1805207166));)
                {
                    __loopvar0 += 3;
                    {
                        int __loopvar1 = 15 + 4, __loopSecondaryVar1_0 = 15 + 4;
                        for (; ; )
                        {
                            __loopvar1--;
                            __loopSecondaryVar1_0--;
                            if (s_boolean_0)
                            {
                                ulong uint64_238 = s_uint64_13 /= s_s4_18.uint64_1 |= 15 - 4 ^ (s_s4_18.uint64_1 &= (s_uint64_13 *= 26607244UL) % LeafMethod13() + 23) % LeafMethod13() ^ (uint64_3 *= s_uint64_13) ^ 15 & 4;
                            }
                        }
                    }
                }
            }
            return s_s4_18.decimal_3 /= 15 + 4;
        }
    }

    public static void Main(string[] args)
    {
        TestClass34 objTestClass34 = new TestClass34();
        S5 s5_4 = new S5();
        objTestClass34.Method1(ref s_s2_16, ref s5_4, out s_s2_16, s_single_9, s_s2_16, s_s1_15, ref s_s1_15);
    }
}
/*
Got output diff:
--------- Baseline ---------  

Environment:

COMPlus_JITMinOpts=1
COMPlus_TieredCompilation=1


--------- Test ---------  

Environment:

COMPlus_JITMinOpts=0
COMPlus_TieredCompilation=0
COMPlus_JitDoLoopInversion=0
COMPlus_JitStressRegs=1



Assert failure(PID 37488 [0x00009270], Thread: 21896 [0x5588]): Assertion failed 'emitOffsAdj == newOffsAdj' in 'TestClass34:Method1(byref,byref,byref,float,S2,S1,byref):System.Decimal:this' during 'Emit code' (IL size 258)

    File: D:\git\runtime\src\coreclr\jit\emit.cpp Line: 6049
    Image: D:\git\runtime\artifacts\tests\coreclr\windows.x64.Checked\tests\Core_Root\CoreRun.exe


*/

Note: The repro could be reduced further.

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIin-prThere is an active PR which will close this issue when it is merged

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions