Skip to content

JIT: Assertion failed 'type == genActualType(type)' during 'Morph - Global'  #66269

Closed

Description

@jakobbotsch

Description

The following program hits a JIT assert when optimizing:

Reproduction Steps

// Generated by Fuzzlyn v1.5 on 2022-03-06 15:47:05
// Run on X64 Windows
// Seed: 15359287904507074268
// Reduced from 41.3 KiB to 0.3 KiB in 00:00:50
// Hits JIT assert in Release:
// Assertion failed 'type == genActualType(type)' in 'Program:M2(ushort,System.Int64[])' during 'Morph - Global' (IL size 19; hash 0x80f5fca2; FullOpts)
// 
//     File: D:\a\_work\1\s\src\coreclr\jit\compiler.hpp Line: 1484
// 
public class Program
{
    public static bool s_1;
    public static void Main()
    {
        var vr1 = new long[]{0};
        M2(0, vr1);
    }

    public static void M2(ushort arg1, long[] arg2)
    {
        s_1 = arg2[0] != 0;
        arg1 += arg1;
    }
}

Expected behavior

No JIT assert hit.

Actual behavior

JIT assert hit.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

This looks like a new assert added in #65257 (but perhaps uncovering some invalid IR), cc @SingleAccretion

cc @dotnet/jit-contrib

Activity

  1. ghost added
    area-CodeGen-coreclr
    on Mar 6, 2022
  2. ghost added
    untriaged
    on Mar 6, 2022
  3. SingleAccretion commented on Mar 6, 2022

    @SingleAccretion
    Contributor
    // V0 + V0 ... + V0 becomes V0 * foldCount, where postorder transform will optimize
    // accordingly
    consTree->BashToConst(foldCount, lclVarTree->TypeGet());

    Is the culprit. Should be an easy fix.

  4. ghost added
    in-pr
    on Mar 6, 2022
  5. removed
    untriaged
    on Mar 7, 2022
  6. ghost removed
    in-pr
    on Mar 7, 2022
  7. removed their assignment
    on Mar 7, 2022
  8. ghost locked as resolved and limited conversation to collaborators on Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-CodeGen-coreclr

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions