Skip to content

osx/arm64: Assertion failed 'emitJumpCrossHotColdBoundary(srcOffs, dstOffs) == false' during 'Emit code' #108611

@kunalspathak

Description

@kunalspathak
// Found by Antigen
// Reduced from 311.14 KB to 2.7 KB.


using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
using System.Runtime.Intrinsics.X86;
using System.Numerics;
public class TestClass
{
    public struct S1
    {
    }
    public struct S2
    {
    }
    static byte s_byte_3 = 127;
    static int s_int_8 = 0;
    static S1 s_s1_17 = new S1();
    static S2 s_s2_18 = new S2();
    S1 s1_34 = new S1();
    S2 s2_35 = new S2();
    static int s_loopInvariant = 3;
    private static List<string> toPrint = new List<string>();
    [MethodImpl(MethodImplOptions.NoInlining)]
    public bool LeafMethod0()
    {
        unchecked
        {
            return 15==4;
        }
    }
    public decimal LeafMethod3()
    {
        unchecked
        {
            return 15+4>> s_int_8 ^ s_int_8% 15|4;
        }
    }
    [MethodImpl(MethodImplOptions.NoInlining)]
    public SveMaskPattern LeafMethod14()
    {
        unchecked
        {
            return SveMaskPattern.LargestPowerOf2;
        }
    }
    public S2 Method23(ref S2 p_s2_580, out S1 p_s1_581, ref int p_int_582, out S2 p_s2_583, int p_int_584, ref float p_float_585, ref byte p_byte_586, out S1 p_s1_587, bool p_bool_588, ref S1 p_s1_589, ref S2 p_s2_590, S1 p_s1_591, S1 p_s1_592, ref S1 p_s1_593, out S1 p_s1_594, out S1 p_s1_595)
    {
        unchecked
        {
            decimal decimal_599 = 0.0303030303030303030303030303m;
            S1 s1_611 = new S1();
            p_s1_587 = p_s1_589;
            p_s1_594 = s1_611;
            p_s1_595 = p_s1_589;
            int __loopvar1 = 15-4, __loopSecondaryVar1_0 = s_loopInvariant;
            do
            {
                if (__loopvar1 > s_loopInvariant)
                    break;
                __loopvar1 += 3;
                while (15!=4)
                {
                    if (LeafMethod3() - decimal_599<= 15*4)
                    {
                        LeafMethod14();
                    }
                    else
                    {
                    }
                }
            }
            while (15>=4);
            return s2_35;
        }
    }
    public void Method0()
    {
        unchecked
        {
            float float_2711 = 2.03125f;
            S1 s1_2717 = new S1();
            s_s2_18 = Method23(ref s2_35, out s_s1_17, ref s_int_8, out s2_35, 15|4, ref float_2711, ref s_byte_3, out s_s1_17, LeafMethod0(), ref s_s1_17, ref s2_35, s1_2717, s_s1_17, ref s1_34, out s_s1_17, out s1_2717);
            return;
        }
    }
    public static void Main(string[] args)
    {
    }
    public static int Antigen()
    {
        new TestClass().Method0();
        return string.Join(Environment.NewLine, toPrint).GetHashCode();
    }
}
/*
Environment:

set DOTNET_JitFakeProcedureSplitting=1
set DOTNET_JitRandomEdgeCounts=1
set DOTNET_TailcallStress=1
set DOTNET_JitCFGUseDispatcher=0
set DOTNET_ReadyToRun=1
set DOTNET_JitSynthesizeCounts=5
set DOTNET_TieredCompilation=0
set DOTNET_MaxVectorTBitWidth=128
set DOTNET_PreferredVectorBitWidth=0
set DOTNET_JitStressRegs=0x1000
set DOTNET_JitThrowOnAssertionFailure=1
set DOTNET_LegacyExceptionHandling=1

Debug: 683581661

Release: 0
JIT assert failed:
Assertion failed 'emitJumpCrossHotColdBoundary(srcOffs, dstOffs) == false' in 'TestClass:Method23(byref,byref,byref,byref,int,byref,byref,byref,ubyte,byref,byref,TestClass+S1,TestClass+S1,byref,byref,byref):TestClass+S2:this' during 'Emit code' (IL size 132; hash 0xc4935bac; FullOpts)

    File: /Users/runner/work/1/s/src/coreclr/jit/emitarm64.cpp Line: 10441


*/

Although this repro is osx/arm64, it repros on other platforms as well.

Metadata

Metadata

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIin-prThere is an active PR which will close this issue when it is merged

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions