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

Assertion failed 'm_store->TypeGet() == m_src->TypeGet()' during 'Stress gtSplitTree' #93876

Closed
kunalspathak opened this issue Oct 23, 2023 · 2 comments · Fixed by #94413
Closed
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@kunalspathak
Copy link
Member

// Found by Antigen

using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
using System.Numerics;
public class TestClass
{
    public struct S1
    {
    }
    public struct S2
    {
    }
    static float s_float_12 = 0f;
    static S1 s_s1_40 = new S1();
    static S2 s_s2_41 = new S2();
    long long_49 = 0;
    Vector4 v4_78 = new Vector4(5.090909f, -2.1474836E+09f, 5.148148f, 0.054054055f);
    S1 s1_79 = new S1();
    S2 s2_80 = new S2();
    public S1 Method45(ref long p_long_1227, S1 p_s1_1228, out S2 p_s2_1229, ref S1 p_s1_1230, ref S2 p_s2_1231, S1 p_s1_1232, out Vector4 p_v4_1233, ref S2 p_s2_1234, ref S1 p_s1_1235)
    {
        unchecked
        {
            p_s2_1229 = s_s2_41;
            p_v4_1233 = Vector4.Multiply(s_float_12, Vector4.One);
            return p_s1_1235;
        }
    }
    public void Method0()
    {
        unchecked
        {
            S1 s1_2605 = new S1();
            S2 s2_2606 = new S2();
            s1_2605 = Method45(ref long_49, s_s1_40, out s2_80, ref s1_79, ref s2_2606, s1_2605, out v4_78, ref s_s2_41, ref s_s1_40);
            return;
        }
    }
    public static void Main(string[] args)
    {
        new TestClass().Method0();
    }
}
/*
Got output diff:
--------- Baseline ---------  
Environment:
--------- Test ---------  
Environment:
set DOTNET_TieredCompilation=0
set DOTNET_JitStress=1
set DOTNET_AltJitName=clrjit_universal_arm64_x64.dll
set DOTNET_AltJit=Method45
Assert failure(PID 42792 [0x0000a728], Thread: 1268 [0x04f4]): Assertion failed 'm_store->TypeGet() == m_src->TypeGet()' in 'TestClass:Method45(byref,TestClass+S1,byref,byref,byref,TestClass+S1,byref,byref,byref):TestClass+S1:this' during 'Stress gtSplitTree' (IL size 41; hash 0x5f755485; FullOpts)
    File: E:\git\runtime2\src\coreclr\jit\morphblock.cpp Line: 671
    Image: e:\git\runtime2\artifacts\tests\coreclr\windows.x64.Checked\tests\Core_Root\CoreRun.exe
*/
@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 Oct 23, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Oct 23, 2023
@kunalspathak kunalspathak removed the untriaged New issue has not been triaged by the area owner label Oct 23, 2023
@ghost
Copy link

ghost commented Oct 23, 2023

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

Issue Details
// Found by Antigen

using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
using System.Numerics;
public class TestClass
{
    public struct S1
    {
    }
    public struct S2
    {
    }
    static float s_float_12 = 0f;
    static S1 s_s1_40 = new S1();
    static S2 s_s2_41 = new S2();
    long long_49 = 0;
    Vector4 v4_78 = new Vector4(5.090909f, -2.1474836E+09f, 5.148148f, 0.054054055f);
    S1 s1_79 = new S1();
    S2 s2_80 = new S2();
    public S1 Method45(ref long p_long_1227, S1 p_s1_1228, out S2 p_s2_1229, ref S1 p_s1_1230, ref S2 p_s2_1231, S1 p_s1_1232, out Vector4 p_v4_1233, ref S2 p_s2_1234, ref S1 p_s1_1235)
    {
        unchecked
        {
            p_s2_1229 = s_s2_41;
            p_v4_1233 = Vector4.Multiply(s_float_12, Vector4.One);
            return p_s1_1235;
        }
    }
    public void Method0()
    {
        unchecked
        {
            S1 s1_2605 = new S1();
            S2 s2_2606 = new S2();
            s1_2605 = Method45(ref long_49, s_s1_40, out s2_80, ref s1_79, ref s2_2606, s1_2605, out v4_78, ref s_s2_41, ref s_s1_40);
            return;
        }
    }
    public static void Main(string[] args)
    {
        new TestClass().Method0();
    }
}
/*
Got output diff:
--------- Baseline ---------  
Environment:
--------- Test ---------  
Environment:
set DOTNET_TieredCompilation=0
set DOTNET_JitStress=1
set DOTNET_AltJitName=clrjit_universal_arm64_x64.dll
set DOTNET_AltJit=Method45
Assert failure(PID 42792 [0x0000a728], Thread: 1268 [0x04f4]): Assertion failed 'm_store->TypeGet() == m_src->TypeGet()' in 'TestClass:Method45(byref,TestClass+S1,byref,byref,byref,TestClass+S1,byref,byref,byref):TestClass+S1:this' during 'Stress gtSplitTree' (IL size 41; hash 0x5f755485; FullOpts)
    File: E:\git\runtime2\src\coreclr\jit\morphblock.cpp Line: 671
    Image: e:\git\runtime2\artifacts\tests\coreclr\windows.x64.Checked\tests\Core_Root\CoreRun.exe
*/
Author: kunalspathak
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch
Copy link
Member

I will take a look.

@jakobbotsch jakobbotsch self-assigned this Oct 24, 2023
@jakobbotsch jakobbotsch added this to the 9.0.0 milestone Oct 24, 2023
jakobbotsch added a commit to jakobbotsch/runtime that referenced this issue Nov 6, 2023
MultiplyByScalar on ARM/ARM64 can have differently typed operands, so we
cannot fold multiplications by one/zero without ensuring that we get the
proper result type.

Fix dotnet#93876
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Nov 6, 2023
jakobbotsch added a commit that referenced this issue Nov 7, 2023
)

MultiplyByScalar on ARM64 should not be handled by the same path
as other multiplications since it has different behavior.

Fix #93876
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Nov 7, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants