Skip to content

Assertion failed 'fldSeqForStaticVar->GetTail() == zeroOffsetFldSeq' during 'Do value numbering' #64773

@kunalspathak

Description

@kunalspathak
// Found by Antigen
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
public class TestClass
{
    public struct S1
    {
        public struct S1_D1_F3
        {
            public decimal decimal_2;
        }
        public struct S1_D1_F4
        {
            public struct S1_D2_F3
            {
                public S1.S1_D1_F3 s1_s1_d1_f3_5;
            }
            public ulong ulong_3;
            public float float_4;
        }
        public ushort ushort_0;
        public int int_1;
    }
    public struct S2
    {
        public struct S2_D1_F1
        {
            public S1.S1_D1_F3 s1_s1_d1_f3_6;
        }
        public ulong ulong_7;
        public S1.S1_D1_F3 s1_s1_d1_f3_8;
        public float float_9;
    }
    public struct S3
    {
        public ulong ulong_10;
        public int int_11;
        public S2 s2_12;
    }
    public struct S4
    {
        public int int_13;
        public S1 s1_14;
    }
    public struct S5
    {
        public struct S5_D1_F3
        {
            public S1.S1_D1_F4.S1_D2_F3 s1_s1_d1_f4_s1_d2_f3_18;
            public S1.S1_D1_F4 s1_s1_d1_f4_19;
        }
        public byte byte_15;
    }
    static bool s_bool_20 = false;
    static byte s_byte_21 = 1;
    static decimal s_decimal_23 = 2.0857142857142857142857142857m;
    static short s_short_25 = 0;
    static int s_int_26 = 4;
    static long s_long_27 = 4;
    static sbyte s_sbyte_28 = 2;
    static ushort s_ushort_31 = 1;
    static uint s_uint_32 = 63;
    static S1.S1_D1_F3 s_s1_s1_d1_f3_34 = new S1.S1_D1_F3();
    static S1.S1_D1_F4.S1_D2_F3 s_s1_s1_d1_f4_s1_d2_f3_35 = new S1.S1_D1_F4.S1_D2_F3();
    static S1 s_s1_37 = new S1();
    static S2.S2_D1_F1 s_s2_s2_d1_f1_38 = new S2.S2_D1_F1();
    static S2 s_s2_39 = new S2();
    static S3 s_s3_40 = new S3();
    static S4 s_s4_41 = new S4();
    static S5.S5_D1_F3 s_s5_s5_d1_f3_42 = new S5.S5_D1_F3();
    static S5 s_s5_43 = new S5();
    byte byte_45 = 1;
    decimal decimal_47 = 4m;
    short short_49 = 1;
    int int_50 = 4;
    long long_51 = -1;
    sbyte sbyte_52 = 5;
    ushort ushort_55 = 0;
    uint uint_56 = 1;
    S1.S1_D1_F3 s1_s1_d1_f3_58 = new S1.S1_D1_F3();
    S1.S1_D1_F4.S1_D2_F3 s1_s1_d1_f4_s1_d2_f3_59 = new S1.S1_D1_F4.S1_D2_F3();
    S1.S1_D1_F4 s1_s1_d1_f4_60 = new S1.S1_D1_F4();
    S1 s1_61 = new S1();
    S2.S2_D1_F1 s2_s2_d1_f1_62 = new S2.S2_D1_F1();
    S2 s2_63 = new S2();
    S3 s3_64 = new S3();
    S4 s4_65 = new S4();
    S5.S5_D1_F3 s5_s5_d1_f3_66 = new S5.S5_D1_F3();
    S5 s5_67 = new S5();
    [MethodImpl(MethodImplOptions.NoInlining)]
    public decimal LeafMethod3()
    {
        unchecked
        {
            return s_decimal_23 /= 15+4;
        }
    }
    public short LeafMethod5()
    {
        unchecked
        {
            return short_49 |= 15|4;
        }
    }
    [MethodImpl(MethodImplOptions.NoInlining)]
    public int LeafMethod6()
    {
        unchecked
        {
            return s_s1_37.int_1 += 15|4;
        }
    }
    [MethodImpl(MethodImplOptions.NoInlining)]
    public long LeafMethod7()
    {
        unchecked
        {
            return long_51;
        }
    }
    public sbyte LeafMethod8()
    {
        unchecked
        {
            return (sbyte)(15<<4);
        }
    }
    public ushort LeafMethod11()
    {
        unchecked
        {
            return 15|4;
        }
    }
    [MethodImpl(MethodImplOptions.NoInlining)]
    public uint LeafMethod12()
    {
        unchecked
        {
            return uint_56 <<= s4_65.int_13 = 15+4;
        }
    }
    public ulong LeafMethod13()
    {
        unchecked
        {
            return s_s3_40.s2_12.ulong_7 |= 15&4;
        }
    }
    public S1.S1_D1_F4.S1_D2_F3 LeafMethod15()
    {
        unchecked
        {
            return s_s1_s1_d1_f4_s1_d2_f3_35;
        }
    }
    [MethodImpl(MethodImplOptions.NoInlining)]
    public S5.S5_D1_F3 LeafMethod22()
    {
        unchecked
        {
            return s5_s5_d1_f3_66;
        }
    }
    public int Method1(ref S1.S1_D1_F3 p_s1_s1_d1_f3_68, S2.S2_D1_F1 p_s2_s2_d1_f1_69, out S2.S2_D1_F1 p_s2_s2_d1_f1_70, S1.S1_D1_F4 p_s1_s1_d1_f4_71, out S1.S1_D1_F4.S1_D2_F3 p_s1_s1_d1_f4_s1_d2_f3_72, S5 p_s5_73)
    {
        unchecked
        {
            S2.S2_D1_F1 s2_s2_d1_f1_95 = new S2.S2_D1_F1();
            S2.S2_D1_F1 s2_s2_d1_f1_96 = s2_s2_d1_f1_95;
            p_s2_s2_d1_f1_70 = s2_s2_d1_f1_96;
            p_s1_s1_d1_f4_s1_d2_f3_72 = s_s1_s1_d1_f4_s1_d2_f3_35;
            return s3_64.int_11;
        }
    }
    public S1.S1_D1_F3 Method2(decimal p_decimal_105, S1.S1_D1_F3 p_s1_s1_d1_f3_106)
    {
        unchecked
        {
            S1.S1_D1_F3 s1_s1_d1_f3_121 = new S1.S1_D1_F3();
            S1.S1_D1_F3 s1_s1_d1_f3_122 = s1_s1_d1_f3_121;
            return s1_s1_d1_f3_122;
        }
    }
    public void Method0()
    {
        unchecked
        {
            byte byte_155 = 63;
            short short_159 = 1;
            int int_160 = 1;
            long long_161 = 63;
            sbyte sbyte_162 = 63;
            float float_163 = -0.78947365f;
            ushort ushort_165 = 4;
            uint uint_166 = 1;
            S1.S1_D1_F3 s1_s1_d1_f3_168 = new S1.S1_D1_F3();
            S1.S1_D1_F3 s1_s1_d1_f3_169 = s1_s1_d1_f3_168;
            S1.S1_D1_F4.S1_D2_F3 s1_s1_d1_f4_s1_d2_f3_170 = new S1.S1_D1_F4.S1_D2_F3();
            S1.S1_D1_F4.S1_D2_F3 s1_s1_d1_f4_s1_d2_f3_171 = s1_s1_d1_f4_s1_d2_f3_170;
            S1.S1_D1_F4 s1_s1_d1_f4_172 = new S1.S1_D1_F4();
            S1 s1_173 = new S1();
            S1 s1_174 = s1_173;
            S2.S2_D1_F1 s2_s2_d1_f1_175 = new S2.S2_D1_F1();
            S2 s2_176 = new S2();
            S2 s2_177 = s2_176;
            S3 s3_178 = new S3();
            S3 s3_179 = s3_178;
            S4 s4_180 = new S4();
            S5.S5_D1_F3 s5_s5_d1_f3_181 = new S5.S5_D1_F3();
            S5 s5_182 = new S5();
            S5 s5_183 = s5_182;
            if (15*4!= 15/4+ s3_64.s2_12.float_9)
            {
            }
            else
            {
                if ((s3_64.s2_12.s1_s1_d1_f3_8.decimal_2 = LeafMethod3())+ LeafMethod3() - LeafMethod3()+ 63.075m + s_s5_s5_d1_f3_42.s1_s1_d1_f4_s1_d2_f3_18.s1_s1_d1_f3_5.decimal_2- s_s5_s5_d1_f3_42.s1_s1_d1_f4_s1_d2_f3_18.s1_s1_d1_f3_5.decimal_2<= (s_s1_s1_d1_f3_34.decimal_2 += s1_s1_d1_f3_58.decimal_2)/ (s2_63.s1_s1_d1_f3_8.decimal_2 / LeafMethod3()+ 19+ 92)% (s_s5_s5_d1_f3_42.s1_s1_d1_f4_s1_d2_f3_18.s1_s1_d1_f3_5.decimal_2 + s_s1_s1_d1_f4_s1_d2_f3_35.s1_s1_d1_f3_5.decimal_2)* LeafMethod3()+ 1)
                {
                    switch (s4_65.int_13 ^= 15<<4<< LeafMethod6() + s_int_26| LeafMethod6())
                    {
                        case 1:
                        {
                            s_s5_43.byte_15 /= (byte)((s_byte_21 += 15+4)/ 15%4* s_s5_43.byte_15* (byte_155 >>= s1_61.int_1 % 15+4)+ 71+ 20);
                            break;
                        }
                        case 0:
                        {
                            break;
                        }
                        case -2:
                        {
                            if (s_bool_20)
                            {
                                if (s_sbyte_28 >= ((sbyte_52 %= (sbyte)(LeafMethod8() | 15+4))^ LeafMethod8() >> s1_174.int_1^ sbyte_52 >> LeafMethod6()))
                                {
                                    s5_183.byte_15 <<= s4_65.s1_14.int_1 * (s1_61.int_1 + (s_s1_37.int_1 = LeafMethod6()))* (s_s1_37.int_1 |= -1);
                                    Method2(LeafMethod3() % LeafMethod3() + s1_s1_d1_f3_169.decimal_2+ 69/ LeafMethod3() % LeafMethod3()+ 5- (s_s2_s2_d1_f1_38.s1_s1_d1_f3_6.decimal_2 + LeafMethod3())+ 28, s1_s1_d1_f3_169);
                                }
                                else
                                {
                                }
                                if (long_51 >= (s_long_27 *= s_long_27))
                                {
                                }
                                else
                                {
                                    s_ushort_31 |= ushort_55 ^= s1_61.ushort_0 ^= (ushort)(LeafMethod11() | s1_61.ushort_0& LeafMethod11());
                                    s_s4_41.s1_14.ushort_0 %= (ushort)(ushort_165 + s4_65.s1_14.ushort_0+ 74);
                                }
                            }
                            else
                            {
                                s_uint_32 |= uint_56 = LeafMethod12()+ (uint_56 ^= s_uint_32);
                            }
                            break;
                        }
                        default:
                        {
                            switch (s_long_27 += s_long_27 + LeafMethod7() ^ LeafMethod7()% 15+4)
                            {
                                case 1:
                                {
                                    Method2(s3_64.s2_12.s1_s1_d1_f3_8.decimal_2 + LeafMethod3()% LeafMethod3() / s2_s2_d1_f1_175.s1_s1_d1_f3_6.decimal_2+ 79+ 48* LeafMethod3() + LeafMethod3()+ s1_s1_d1_f4_s1_d2_f3_59.s1_s1_d1_f3_5.decimal_2 / (s1_s1_d1_f3_168.decimal_2+ 41), s1_s1_d1_f3_168);
                                    break;
                                }
                                case -5:
                                {
                                    switch (15+4^ s_long_27)
                                    {
                                        case 1:
                                        {
                                            break;
                                        }
                                        case -1:
                                        {
                                            sbyte_52 &= (sbyte)(sbyte_162 * LeafMethod8()% 15+4- s_sbyte_28 * LeafMethod8()* LeafMethod8()>> 15^4);
                                            s1_s1_d1_f3_168.decimal_2 = s_s5_s5_d1_f3_42.s1_s1_d1_f4_s1_d2_f3_18.s1_s1_d1_f3_5.decimal_2 % (s3_178.s2_12.s1_s1_d1_f3_8.decimal_2 = LeafMethod3())+ 91- (s5_s5_d1_f3_66.s1_s1_d1_f4_s1_d2_f3_18.s1_s1_d1_f3_5.decimal_2 = s1_s1_d1_f4_s1_d2_f3_59.s1_s1_d1_f3_5.decimal_2 += s3_64.s2_12.s1_s1_d1_f3_8.decimal_2)% 4.0952380952380952380952380952m - -2147483647m % s5_s5_d1_f3_66.s1_s1_d1_f4_s1_d2_f3_18.s1_s1_d1_f3_5.decimal_2+ 86+ 50;
                                            break;
                                        }
                                        case 0:
                                        {
                                            s1_s1_d1_f4_60.ulong_3 |= s_s3_40.ulong_10 -= s_s5_s5_d1_f3_42.s1_s1_d1_f4_19.ulong_3;
                                            s5_67.byte_15 %= (byte)(byte_45 - (s_s5_43.byte_15 | (s5_67.byte_15 %= 15+4))+ 5);
                                            break;
                                        }
                                        default:
                                        {
                                            s_long_27 <<= s4_180.int_13 /= 15>>4<< s_s4_41.s1_14.int_1+ s3_178.int_11 | LeafMethod6()/ (s3_178.int_11 * s_s1_37.int_1/ (s4_65.int_13 = s4_180.s1_14.int_1)+ 62)+ 61;
                                            break;
                                        }
                                    }
                                    s1_s1_d1_f4_60.float_4 %= s_s3_40.s2_12.float_9 /= s_s2_39.float_9 += 15+4;
                                    long_51 *= long_161 + (long_51 <<= 15>>4)+ (LeafMethod7() << LeafMethod6())% (s_long_27 << LeafMethod6())+ 66;
                                    LeafMethod22();
                                    break;
                                }
                                case 0:
                                {
                                    long_161 >>= s_s3_40.int_11 = s_s1_37.int_1 + LeafMethod6() + s1_173.int_1- LeafMethod6() + LeafMethod6();
                                    LeafMethod15();
                                    switch ((LeafMethod7() >> (s_s1_37.int_1 = int_50 << s3_64.int_11))+ (long_51 ^= long_51 >>= LeafMethod6())>> 15/4)
                                    {
                                        case -1:
                                        {
                                            short_159 |= (short)(LeafMethod5() & (short_49 |= LeafMethod5()));
                                            short_49 /= (short)(LeafMethod5()+ 97);
                                            s3_64.ulong_10 >>= s_s1_37.int_1 += int_50% (s_int_26 = s4_65.int_13 - s1_61.int_1+ LeafMethod6() << s3_64.int_11)+ 42;
                                            break;
                                        }
                                        case 0:
                                        {
                                            uint_56 >>= s4_180.s1_14.int_1 << LeafMethod6()% (s_s3_40.int_11 -= s1_173.int_1)+ 51^ s4_65.int_13 - LeafMethod6()* s_s3_40.int_11& (s_s1_37.int_1 &= int_50 &= s1_174.int_1 %= 15+4);
                                            s_s3_40.s2_12.ulong_7 /= 15+4;
                                            s5_s5_d1_f3_181.s1_s1_d1_f4_s1_d2_f3_18.s1_s1_d1_f3_5.decimal_2 /= s_s1_s1_d1_f4_s1_d2_f3_35.s1_s1_d1_f3_5.decimal_2 *= LeafMethod3() % 15-4* (s_s2_39.s1_s1_d1_f3_8.decimal_2 = s2_s2_d1_f1_62.s1_s1_d1_f3_6.decimal_2)+ 35+ 26;
                                            s_s2_39.float_9 -= float_163;
                                            break;
                                        }
                                        default:
                                        {
                                            s_short_25 -= short_159 >>= s4_65.s1_14.int_1 = 15&4^ s_s1_37.int_1 + s4_180.s1_14.int_1;
                                            s2_63.ulong_7 *= s3_64.ulong_10 * s3_179.ulong_10 + s2_176.ulong_7+ LeafMethod13()- 1;
                                            break;
                                        }
                                    }
                                    LeafMethod3();
                                    uint_166 ^= (s_uint_32 <<= LeafMethod6() % 15+4)* s_uint_32 * 15+15%4+ 43;
                                    LeafMethod22();
                                    LeafMethod3();
                                    break;
                                }
                                default:
                                {
                                    LeafMethod3();
                                    break;
                                }
                            }
                            break;
                        }
                    }
                    if (LeafMethod3() * LeafMethod3() + LeafMethod3()- s3_64.s2_12.s1_s1_d1_f3_8.decimal_2 + LeafMethod3()- LeafMethod3()> (s5_s5_d1_f3_66.s1_s1_d1_f4_s1_d2_f3_18.s1_s1_d1_f3_5.decimal_2 *= LeafMethod3())% decimal_47+ 27- (s5_s5_d1_f3_66.s1_s1_d1_f4_s1_d2_f3_18.s1_s1_d1_f3_5.decimal_2 -= s2_176.s1_s1_d1_f3_8.decimal_2)/ LeafMethod3() + s2_63.s1_s1_d1_f3_8.decimal_2+ 68)
                    {
                    }
                    else
                    {
                        s2_s2_d1_f1_62.s1_s1_d1_f3_6.decimal_2 -= s5_s5_d1_f3_66.s1_s1_d1_f4_s1_d2_f3_18.s1_s1_d1_f3_5.decimal_2 /= LeafMethod3()+ 5* (decimal_47 += s2_177.s1_s1_d1_f3_8.decimal_2 = s_s3_40.s2_12.s1_s1_d1_f3_8.decimal_2 *= LeafMethod3());
                    }
                }
                else
                {
                }
                long_161 |= (LeafMethod7() - s_long_27/ (long_161 += long_51)+ 81>> (s4_65.s1_14.int_1 %= s_s3_40.int_11 + LeafMethod6()+ 94))* s_long_27 << LeafMethod6() ^ int_50<< int_160 / LeafMethod6()+ 75/ LeafMethod6()+ 83;
            }
            s4_65.int_13 = Method1(ref s1_s1_d1_f3_58, s_s2_s2_d1_f1_38, out s2_s2_d1_f1_62, s1_s1_d1_f4_172, out s_s1_s1_d1_f4_s1_d2_f3_35, s_s5_43);
            s1_s1_d1_f3_169 = Method2(LeafMethod3() - s2_63.s1_s1_d1_f3_8.decimal_2+ LeafMethod3()* (s2_63.s1_s1_d1_f3_8.decimal_2 += LeafMethod3() + s3_64.s2_12.s1_s1_d1_f3_8.decimal_2), s1_s1_d1_f3_58);
            return;
        }
    }
    public static void Main(string[] args)
    {
        new TestClass().Method0();
    }
}
/*
Got output diff:
--------- Baseline ---------  

Environment:



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

Environment:

set COMPlus_TieredCompilation=0
set COMPlus_JitDoRedundantBranchOpts=0
set COMPlus_EnableHWIntrinsic=0
set COMPlus_AltJitName=clrjit_unix_x64_x64.dll
set COMPlus_AltJit=Method0

Assert failure(PID 61576 [0x0000f088], Thread: 41552 [0xa250]): Assertion failed 'fldSeqForStaticVar->GetTail() == zeroOffsetFldSeq' in 'TestClass:Method0():this' during 'Do value numbering' (IL size 3737)
    File: D:\git\dotnet-runtime\src\coreclr\jit\valuenum.cpp Line: 8207
    Image: d:\git\dotnet-runtime\artifacts\tests\coreclr\windows.x64.Checked\tests\Core_Root\CoreRun.exe
*/

Metadata

Metadata

Labels

arch-x64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIos-linuxLinux OS (any supported distro)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions