Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT: [arm32] Assertion failed 'baseRegUsed == reg2' during 'Generate code' #105620

Closed
jakobbotsch opened this issue Jul 29, 2024 · 3 comments · Fixed by #107564
Closed

JIT: [arm32] Assertion failed 'baseRegUsed == reg2' during 'Generate code' #105620

jakobbotsch opened this issue Jul 29, 2024 · 3 comments · Fixed by #107564
Assignees
Labels
arch-arm32 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI in-pr There is an active PR which will close this issue when it is merged
Milestone

Comments

@jakobbotsch
Copy link
Member

// Generated by Fuzzlyn v2.1 on 2024-07-28 20:48:11
// Run on Arm Linux
// Seed: 7638843082097772896
// Reduced from 1010.6 KiB to 5.3 KiB in 00:18:13
// Hits JIT assert in Release:
// Assertion failed 'baseRegUsed == reg2' in 'Program:M48(S0,S3,S2,S2)' during 'Generate code' (IL size 2164; hash 0x03983244; FullOpts)
// 
//     File: /__w/1/s/src/coreclr/jit/emitarm.cpp Line: 3919
// 
using System;
using System.Runtime.CompilerServices;

public struct S0
{
    public ulong F0;
    public int F1;
    public long F2;
    public uint F3;
    public byte F4;
    public float F5;
    public sbyte F6;
    public double F7;
    public sbyte F8;
}

public struct S1
{
    public double F0;
    public short F1;
    public bool F2;
    public S0 F3;
    public sbyte F4;
    public ushort F5;
    public ulong F6;
    public int F7;
    public S0 F8;
}

public struct S2
{
    public double F0;
    public S0 F1;
    public S1 F2;
    public ushort F4;
    public S2(S1 f2)
    {
        F2 = f2;
    }
}

public class C0
{
}

public struct S3
{
    public double F0;
    public float F1;
    public ushort F2;
    public long F3;
    public S1 F4;
    public S2 F5;
    public S2 F6;
    public uint F7;
    public S2 F8;
    public S3(S2 f5, S2 f8) : this()
    {
        F5 = f5;
        F8 = f8;
    }
}

public struct S4
{
    public double F0;
    public double F1;
    public float F2;
    public ulong F3;
    public bool F4;
    public int F5;
    public bool F6;
    public S3 F7;
    public float F8;
    public S4(S3 f7)
    {
        F7 = f7;
    }
}

public class Program
{
    public static IRuntime s_rt;
    public static S4 s_2;
    public static S4 s_3;
    public static S4[][] s_6;
    public static S3[] s_23 = new S3[]
    {
        new S3(new S2(new S1()), new S2(new S1()))
    };
    public static void Main()
    {
        var vr8 = new S4(new S3(new S2(new S1()), new S2(new S1())));
        var vr9 = s_23[0].F6.F1;
        var vr13 = s_2.F7;
        var vr14 = vr8.F7.F6;
        var vr15 = vr8.F7.F6;
        M48(vr9, vr13, vr14, vr15);
    }

    public static void M48(S0 argThis, S3 arg0, S2 arg1, S2 arg2)
    {
        arg2.F2.F0 = arg2.F2.F0;
        S4 var1 = new S4(new S3(new S2(new S1()), new S2(new S1())));
        var1.F7.F5.F2.F8.F5 = s_6[0][0].F7.F8.F2.F3.F5;
        var vr2 = new C0();
        M49(0, vr2, ref arg2.F2.F1, ref s_3.F7, ref arg1.F1.F8);
        S4 var2 = var1;
        s_rt.WriteLine(System.BitConverter.DoubleToUInt64Bits(var2.F7.F0));
        s_rt.WriteLine(System.BitConverter.SingleToUInt32Bits(var2.F7.F1));
        s_rt.WriteLine(var2.F7.F2);
        s_rt.WriteLine(var2.F7.F3);
        s_rt.WriteLine(System.BitConverter.DoubleToUInt64Bits(var2.F7.F4.F0));
        s_rt.WriteLine(var2.F7.F4.F1);
        s_rt.WriteLine(var2.F7.F4.F2);
        s_rt.WriteLine(var2.F7.F4.F3.F0);
        s_rt.WriteLine(var2.F7.F4.F3.F1);
        s_rt.WriteLine(var2.F7.F4.F3.F2);
        s_rt.WriteLine(var2.F7.F4.F3.F3);
        s_rt.WriteLine(var2.F7.F4.F3.F4);
        s_rt.WriteLine(System.BitConverter.SingleToUInt32Bits(var2.F7.F4.F3.F5));
        s_rt.WriteLine(var2.F7.F4.F3.F6);
        s_rt.WriteLine(System.BitConverter.DoubleToUInt64Bits(var2.F7.F4.F3.F7));
        s_rt.WriteLine(var2.F7.F4.F3.F8);
        s_rt.WriteLine(var2.F7.F4.F4);
        s_rt.WriteLine(var2.F7.F4.F5);
        s_rt.WriteLine(var2.F7.F4.F6);
        s_rt.WriteLine(var2.F7.F4.F7);
        s_rt.WriteLine(var2.F7.F4.F8.F0);
        s_rt.WriteLine(var2.F7.F4.F8.F1);
        s_rt.WriteLine(var2.F7.F4.F8.F2);
        s_rt.WriteLine(var2.F7.F4.F8.F3);
        s_rt.WriteLine(var2.F7.F4.F8.F4);
        s_rt.WriteLine(System.BitConverter.SingleToUInt32Bits(var2.F7.F4.F8.F5));
        s_rt.WriteLine(var2.F7.F4.F8.F6);
        s_rt.WriteLine(System.BitConverter.DoubleToUInt64Bits(var2.F7.F4.F8.F7));
        s_rt.WriteLine(var2.F7.F4.F8.F8);
        s_rt.WriteLine(System.BitConverter.DoubleToUInt64Bits(var2.F7.F5.F0));
        s_rt.WriteLine(var2.F7.F5.F1.F0);
        s_rt.WriteLine(var2.F7.F5.F1.F1);
        s_rt.WriteLine(var2.F7.F5.F1.F2);
        s_rt.WriteLine(var2.F7.F5.F1.F3);
        s_rt.WriteLine(var2.F7.F5.F1.F4);
        s_rt.WriteLine(System.BitConverter.SingleToUInt32Bits(var2.F7.F5.F1.F5));
        s_rt.WriteLine(var2.F7.F5.F1.F6);
        s_rt.WriteLine(System.BitConverter.DoubleToUInt64Bits(var2.F7.F5.F1.F7));
        s_rt.WriteLine(var2.F7.F5.F1.F8);
        s_rt.WriteLine(System.BitConverter.DoubleToUInt64Bits(var2.F7.F5.F2.F0));
        s_rt.WriteLine(var2.F7.F5.F2.F1);
        s_rt.WriteLine(var2.F7.F5.F2.F2);
        s_rt.WriteLine(var2.F7.F5.F2.F3.F0);
        s_rt.WriteLine(var2.F7.F5.F2.F3.F1);
        s_rt.WriteLine(var2.F7.F5.F2.F3.F2);
        s_rt.WriteLine(var2.F7.F5.F2.F3.F3);
        s_rt.WriteLine(var2.F7.F5.F2.F3.F4);
        s_rt.WriteLine(System.BitConverter.SingleToUInt32Bits(var2.F7.F5.F2.F3.F5));
        s_rt.WriteLine(var2.F7.F5.F2.F3.F6);
        s_rt.WriteLine(System.BitConverter.DoubleToUInt64Bits(var2.F7.F5.F2.F3.F7));
        s_rt.WriteLine(var2.F7.F5.F2.F3.F8);
        s_rt.WriteLine(var2.F7.F5.F2.F4);
        s_rt.WriteLine(var2.F7.F5.F2.F5);
        s_rt.WriteLine(var2.F7.F5.F2.F6);
        s_rt.WriteLine(var2.F7.F5.F2.F7);
        s_rt.WriteLine(var2.F7.F5.F2.F8.F0);
    }

    public static void M49(short arg0, C0 arg2, ref short arg3, ref S3 arg4, ref sbyte arg5)
    {
        s_rt.WriteLine(arg0);
    }
}

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

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

Attached an SPMI context captured on 0912e94.
3D8307E1.zip

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 29, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jul 29, 2024
@jakobbotsch jakobbotsch added arch-arm32 and removed untriaged New issue has not been triaged by the area owner labels Jul 29, 2024
Copy link
Contributor

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

@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib

@AndyAyersMS AndyAyersMS added this to the 9.0.0 milestone Jul 29, 2024
@JulieLeeMSFT
Copy link
Member

@TIHan, PTAL.

@kunalspathak kunalspathak assigned kunalspathak and unassigned TIHan Sep 4, 2024
@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Sep 9, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm32 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI in-pr There is an active PR which will close this issue when it is merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants