Skip to content

JIT: Assertion failed '!"Jump into middle of try region"' during 'Linear scan register alloc' #115835

@jakobbotsch

Description

@jakobbotsch
// Generated by Fuzzlyn v3.1 on 2025-05-21 13:34:52
// Run on X64 Windows
// Seed: 1035255821387701446-async,runtimeasync,vectort,vector128,vector256,x86aes,x86avx,x86avx2,x86bmi1,x86bmi1x64,x86bmi2,x86bmi2x64,x86fma,x86lzcnt,x86lzcntx64,x86pclmulqdq,x86pclmulqdqv256,x86popcnt,x86popcntx64,x86sse,x86ssex64,x86sse2,x86sse2x64,x86sse3,x86sse41,x86sse41x64,x86sse42,x86sse42x64,x86ssse3,x86x86base
// Reduced from 38.2 KiB to 2.4 KiB in 00:02:57
// Hits JIT assert for Release with Runtime Async:
// Assertion failed '!"Jump into middle of try region"' in 'Program:M0()' during 'Linear scan register alloc' (IL size 138; hash 0xaf50ff37; FullOpts)
//
//     File: C:\dev\dotnet\runtime3\src\coreclr\jit\fgdiagnostic.cpp Line: 2718
//
using System;
using System.Numerics;
using System.Threading.Tasks;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;

public class Program
{
    public static Vector128<int>[] s_1;
    public static int s_2;
    public static sbyte s_6;
    public static short s_11;
    public static short s_12;
    public static ulong s_13;
    public static void Main()
    {
        CollectibleALC alc = new CollectibleALC();
        System.Reflection.Assembly asm = alc.LoadFromAssemblyPath(System.Reflection.Assembly.GetExecutingAssembly().Location);
        System.Reflection.MethodInfo mi = asm.GetType(typeof(Program).FullName).GetMethod(nameof(MainInner));
        System.Type runtimeTy = asm.GetType(typeof(Runtime).FullName);
        mi.Invoke(null, new object[] { System.Activator.CreateInstance(runtimeTy) });
    }

    public static void MainInner(IRuntime rt)
    {
        M0().GetAwaiter().GetResult();
    }

    public static async Task M0()
    {
        s_1 = new Vector128<int>[]
        {
            Vector128.Create(0, 0, 0, 0)
        };
        ulong var1 = 0;
        s_2 = 0;
        var vr2 = Vector256.Create<sbyte>(0);
        var vr4 = Vector256.Create<sbyte>(0);
        if (Avx.TestC(vr2, vr4))
        {
            var vr0 = var1++;
        }

        await M4();
        uint[] var2 = new uint[]
        {
            0,
            1,
            0,
            0,
            0,
            0,
            1,
            1
        };
        try
        {
            s_12 = s_11;
            short var36 = await M5();
            var vr3 = var1 % var2[0];
            M2(s_13);
        }
        catch (System.Exception)
        {
        }
    }

    public static long M2(ulong arg1)
    {
        var vr1 = Vector128.CreateScalar(0);
        return (-(-Sse41.Extract(vr1, 39)));
    }

    public static async Task<byte> M4()
    {
        s_1[0] = Vector128.CreateScalar(0);
        return 0;
    }

    public static async Task<sbyte> M5()
    {
        return (sbyte)(-s_6++);
    }
}

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

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

public class CollectibleALC : System.Runtime.Loader.AssemblyLoadContext
{
    public CollectibleALC() : base(true)
    {
    }
}

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIruntime-async

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions