Skip to content

JIT: Bad codegen with runtime async #121552

@jakobbotsch

Description

@jakobbotsch
// Generated by Fuzzlyn v3.3 on 2025-11-12 13:45:27
// Run on X64 Windows
// Seed: 9361297366916585528-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 39.8 KiB to 1.1 KiB in 00:01:42
// Release: Outputs 1
// Release with Runtime Async: Outputs 0
using System.Threading.Tasks;

public struct S0
{
    public byte F0;
    public sbyte F1;
    public short F2;
    public ushort F3;
    public uint F4;
    public bool F5;
    public ulong F6;
    public S0(ushort f3) : this()
    {
        F3 = f3;
    }
}

public class Program
{
    public static S0[][] s_2 = new S0[][]
    {
        new S0[]
        {
            new S0(1)
        }
    };
    public static void Main()
    {
        M2().GetAwaiter().GetResult();
    }

    public static async Task<uint[, ]> M2()
    {
        S0 var17 = s_2[0][0];
        var17.F3 *= var17.F3++;
        await Task.Yield();
        System.Console.WriteLine(var17.F0);
        System.Console.WriteLine(var17.F1);
        System.Console.WriteLine(var17.F2);
        System.Console.WriteLine(var17.F3);
        System.Console.WriteLine(var17.F4);
        System.Console.WriteLine(var17.F5);
        System.Console.WriteLine(var17.F6);
        return new uint[, ]
        {
            {
                0
            }
        };
    }
}

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