Skip to content

JIT: Assertion failed 'varTypeIsUnsigned(srcLoadType) || (genTypeSize(srcLoadType) >= genTypeSize(castType))' during 'Generate code' #124508

Closed

Description

@jakobbotsch
// Generated by Fuzzlyn v3.3 on 2026-02-15 18:01:33
// Run on X86 Windows
// Seed: 12192374036514626124-vectort,vector128,vector256,x86aes,x86avx,x86avx2,x86avx512bw,x86avx512bwvl,x86avx512cd,x86avx512cdvl,x86avx512dq,x86avx512dqvl,x86avx512f,x86avx512fvl,x86bmi1,x86bmi2,x86fma,x86lzcnt,x86pclmulqdq,x86popcnt,x86sse,x86sse2,x86sse3,x86sse41,x86sse42,x86ssse3,x86x86base
// Reduced from 109.7 KiB to 8.5 KiB in 00:08:17
// Hits JIT assert for Release:
// Assertion failed 'varTypeIsUnsigned(srcLoadType) || (genTypeSize(srcLoadType) >= genTypeSize(castType))' in 'Program:M3():ushort' during 'Generate code' (IL size 1258; hash 0x58d20529; FullOpts)
// 
//     File: D:\a\_work\1\s\src\coreclr\jit\codegenlinear.cpp Line: 2503
// 
using System.Numerics;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;

public class Program
{
    public static IRuntime s_rt;
    public static sbyte[] s_1;
    public static long s_3;
    public static byte s_4;
    public static Vector256<int> s_5;
    public static ulong s_8;
    public static byte s_12;
    public static int s_13;
    public static uint s_15;
    public static uint s_16;
    public static Vector256<ushort>[] s_17;
    public static ulong[] s_18;
    public static Vector128<uint> s_23 = Vector128.Create(0, 1U, 0, 0);
    public static void Main()
    {
        M3();
    }

    public static ushort M3()
    {
        Vector128<short>[] var1 = default(Vector128<short>[]);
        uint var5 = default(uint);
        Vector256<byte> var7 = default(Vector256<byte>);
        Vector128<long> var9 = default(Vector128<long>);
        uint var15 = default(uint);
        Vector<byte> var18 = default(Vector<byte>);
        sbyte[] var19 = default(sbyte[]);
        byte var3 = 0;
        Vector<short>[] var4 = new Vector<short>[]
        {
            Vector.Create<short>(0)
        };
        s_rt.WriteLine(var5);
        try
        {
            throw new System.Exception();
        }
        catch (System.NotSupportedException)
        {
            var1 = new Vector128<short>[]
            {
                Vector128.Create<short>(0)
            };
        }
        catch (System.NotImplementedException)
        {
            s_rt.WriteLine(var7);
        }
        catch (System.InvalidOperationException)
        {
            ulong var8 = s_8;
            s_rt.WriteLine(var9);
            long var10 = 0;
            s_rt.WriteLine(var8);
            s_rt.WriteLine(var10);
        }
        catch (System.ArgumentOutOfRangeException)
        {
            uint[][][] var11 = new uint[][][]
            {
                new uint[][]
                {
                    new uint[]
                    {
                        0
                    },
                    new uint[]
                    {
                        0
                    },
                    new uint[]
                    {
                        0
                    }
                },
                new uint[][]
                {
                    new uint[]
                    {
                        0
                    },
                    new uint[]
                    {
                        0
                    }
                },
                new uint[][]
                {
                    new uint[]
                    {
                        0
                    }
                },
                new uint[][]
                {
                    new uint[]
                    {
                        0
                    },
                    new uint[]
                    {
                        0
                    }
                },
                new uint[][]
                {
                    new uint[]
                    {
                        0
                    },
                    new uint[]
                    {
                        0
                    },
                    new uint[]
                    {
                        0
                    }
                },
                new uint[][]
                {
                    new uint[]
                    {
                        0
                    },
                    new uint[]
                    {
                        0
                    },
                    new uint[]
                    {
                        0
                    }
                },
                new uint[][]
                {
                    new uint[]
                    {
                        0
                    },
                    new uint[]
                    {
                        0
                    },
                    new uint[]
                    {
                        0
                    }
                },
                new uint[][]
                {
                    new uint[]
                    {
                        0
                    },
                    new uint[]
                    {
                        0
                    },
                    new uint[]
                    {
                        0
                    }
                },
                new uint[][]
                {
                    new uint[]
                    {
                        0
                    },
                    new uint[]
                    {
                        0
                    }
                }
            };
            s_rt.WriteLine(var11[0][0][0]);
        }
        catch (System.ArgumentNullException)
        {
            short var12 = 0;
            Vector256<int> var13 = s_5;
            s_rt.WriteLine(var12);
            s_rt.WriteLine(var13);
        }
        catch (System.Exception)
        {
            s_1[0] >>= (int)Bmi1.BitFieldExtract(0, 0, var3);
            Vector128.Create<long>(s_3);
        }

        s_rt.WriteLine(var3);
        ushort[] var16 = new ushort[]
        {
            0
        };
        var vr4 = var1[0];
        Sse2.CompareLessThan(vr4, Vector128.Create<short>((short)Bmi2.ParallelBitExtract(var15, var15)));
        s_rt.WriteLine(var16[0]);
        var1[0] = var1[0];
        switch (s_13--)
        {
            case 0:
            {
                s_16 += M5();
                Vector.Create<byte>(s_12);
                s_rt.WriteLine(var18);
                s_rt.WriteLine(var19[0]);
                var vr1 = (byte)M11();
                Vector128.Create<byte>(vr1);
            }

                break;
            case 1:
            {
                Vector256<ushort>[] var20 = s_17;
                ulong[] var21 = s_18;
                s_rt.WriteLine(var20[0]);
                s_rt.WriteLine(var21[0]);
            }

                break;
            case -1:
            {
                sbyte var22 = s_1[0]++;
                Vector128<short>[,, ] var25 = new Vector128<short>[,, ]
                {
                    {
                        {
                            Vector128.Create(0, 0, 0, 0, 0, 0, 0, 0)
                        }
                    }
                };
                sbyte var26 = var22;
                s_17[0] = s_17[0];
                var vr3 = s_4++;
                var vr0 = M5();
                M9(vr0, (byte)Bmi2.ParallelBitExtract(s_15, (uint)Sse2.MoveMask(Vector128.CreateScalar((byte)0))), s_8--);
                s_rt.WriteLine(var25[0, 0, 0]);
                s_rt.WriteLine(var26);
                s_rt.WriteLine(var22);
            }

                break;
            case 3:
            {
            }

                break;
            case 4:
            {
                s_17[0] = s_17[0];
                Vector128<int> var33 = Vector128.Create(0, 0, 0, 0);
                bool var34 = -1 <= M11();
                var1[0] = Vector128.CreateScalar((short)(s_1[0] << (0 >> (ushort)M9(0, 0, 0))));
                var1 = new Vector128<short>[]
                {
                    Vector128.Create<short>(0)
                };
                s_rt.WriteLine(var33);
                s_rt.WriteLine(var34);
            }

                break;
            case 5:
            {
            }

                break;
            case 6:
            {
            }

                break;
            case 7:
            {
            }

                break;
            default:
            {
            }

                break;
        }

        var vr6 = Vector128.CreateScalar(0);
        var vr5 = (uint)Sse41.Extract(vr6, 0);
        return (ushort)Bmi2.ZeroHighBits(vr5, 0);
    }

    public static ushort M5()
    {
        return default(ushort);
    }

    public static long M9(ushort arg0, byte arg1, ulong arg2)
    {
        return s_3;
    }

    public static long M11()
    {
        var vr2 = Vector256.Create<int>(-2);
        Avx512F.VL.ConvertToVector128Int16(vr2);
        return 7708512004982082393L;
    }
}

public interface IRuntime
{
    void WriteLine<T>(T value);
}

public class Runtime : IRuntime
{
    public void WriteLine<T>(T value) => System.Console.WriteLine(value);
}

SPMI collection collected on 3249bf9:
col.zip

Activity

  1. added
    untriaged
    on Feb 17, 2026
  2. added
    area-CodeGen-coreclr
    on Feb 17, 2026
  3. dotnet-policy-service commented on Feb 17, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
    See info in area-owners.md if you want to be subscribed.

  4. added and removed
    untriaged
    on Feb 17, 2026
  5. added this to the 11.0.0 milestone on Feb 17, 2026
  6. self-assigned this
    on Feb 19, 2026
  7. added
    blocking-clean-ci-optional
    on Jul 22, 2026
  8. added
    Priority:1
    on Jul 30, 2026
  9. added a commit that references this issue on Jul 31, 2026
    db42477
  10. locked and limited conversation to collaborators on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Priority:1arch-x86area-CodeGen-coreclrblocking-clean-ci-optional

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions