Skip to content

Assertion failed 'interval->isSpilled' during 'LSRA allocate' #66578

@jakobbotsch

Description

@jakobbotsch

Description

The following program hits a JIT assert on arm32 when optimizing.

Reproduction Steps

// Generated by Fuzzlyn v1.5 on 2022-03-13 15:19:20
// Run on Arm Linux
// Seed: 13161118502102171269
// Reduced from 313.8 KiB to 1.2 KiB in 00:16:29
// Hits JIT assert in Release:
// Assertion failed 'interval->isSpilled' in 'Program:M52(C0)' during 'LSRA allocate' (IL size 103; hash 0xb4fc4553; FullOpts)
// 
//     File: /__w/1/s/src/coreclr/jit/lsra.cpp Line: 5924
// 
public interface I0
{
}

public interface I1
{
}

public class C0 : I0, I1
{
    public sbyte F0;
    public bool F1;
    public uint F2;
    public ushort F5;
    public C0(sbyte f0, bool f1, uint f2, ushort f5)
    {
        F0 = f0;
        F1 = f1;
        F2 = f2;
        F5 = f5;
    }
}

public class Program
{
    public static I1[][] s_18;
    public static ushort[][] s_43;
    public static I1 s_64;
    public static I0 s_88;
    public static void Main()
    {
        var vr6 = new C0(0, false, 0, 0);
        M52(vr6);
    }

    public static void M52(C0 argThis)
    {
        I1 vr9 = s_18[0][0];
        if (argThis.F1)
        {
            return;
        }

        if (argThis.F1)
        {
            try
            {
                s_43 = new ushort[][]{new ushort[]{0}};
            }
            finally
            {
                for (int var8 = 0; var8 < 2; var8++)
                {
                    s_64 = argThis;
                }

                C0 vr10 = new C0(0, true, 0, 0);
                s_88 = new C0(-1, true, 0, 0);
            }

            I1 vr12 = s_18[0][0];
        }
    }
}

Expected behavior

No assert hit.

Actual behavior

Assert hit.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

category:correctness
theme:register-allocator

Metadata

Metadata

Assignees

Labels

Priority:3Work that is nice to havearch-arm32area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions