Skip to content

Assertion failed 'divMod->OperGet() != GT_UMOD' during 'Lowering nodeinfo' #68136

Closed
@jakobbotsch

Description

@jakobbotsch

Description

The following program hits an assertion on arm64.

Reproduction Steps

// Generated by Fuzzlyn v1.5 on 2022-04-17 16:25:43
// Run on Arm64 Linux
// Seed: 10863771617286163364
// Reduced from 174.2 KiB to 0.5 KiB in 00:03:09
// Hits JIT assert in Release:
// Assertion failed 'divMod->OperGet() != GT_UMOD' in 'Program:Main(Fuzzlyn.ExecutionServer.IRuntime)' during 'Lowering nodeinfo' (IL size 30; hash 0xade6b36b; FullOpts)
// 
//     File: /__w/1/s/src/coreclr/jit/lower.cpp Line: 5500
// 
public class Program
{
    public static IRuntime s_rt;
    public static ulong s_1;
    public static void Main()
    {
        var vr1 = (uint)((int)M2(ref s_1, 0) % (long)1);
        M2(ref s_1, vr1);
    }

    public static byte M2(ref ulong arg0, uint arg1)
    {
        s_rt.WriteLine(arg0);
        return 0;
    }
}

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

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

Expected behavior

No assertion hit.

Actual behavior

Assertion hit.

Regression?

Presumably from one of the recent modulo optimizations.

Known Workarounds

No response

Configuration

No response

Other information

cc @TIHan @dotnet/jit-contrib

Metadata

Metadata

Assignees

Labels

area-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