Skip to content

rangecheck bug around GT_MUL / GT_LSH #130425

Closed

Description

@EgorBo

Found by gpt-5.6 sol, repro:

using System.Runtime.CompilerServices;

internal static class Program
{
    [MethodImpl(MethodImplOptions.NoInlining)]
    private static int Test(int iterationCount)
    {
        int result = 0;
        int iteration = 0;
        for (int i = -1; (i < 0) && (iteration < iterationCount); i *= 2)
        {
            if (i < -2)
                result++;
            iteration++;
        }
        return result;
    }

    private static int Main()
    {
        int result = Test(3);
        Console.WriteLine($"Result: {result}; expected: 1");
        return result == 1 ? 100 : 1;
    }
}

Tier0: Result: 1; expected: 1
Tier1: Result: 0; expected: 1

Activity

  1. self-assigned this
    on Jul 9, 2026
  2. added this to the 11.0.0 milestone on Jul 9, 2026
  3. added
    untriaged
    on Jul 9, 2026
  4. added
    area-CodeGen-coreclr
    on Jul 9, 2026
  5. removed
    untriaged
    on Jul 9, 2026
  6. dotnet-policy-service commented on Jul 9, 2026

    @dotnet-policy-service
    Contributor

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

  7. added 2 commits that reference this issue on Jul 9, 2026
    bed1b4f
    26911b9
  8. added a commit that references this issue on Jul 15, 2026
    0831b07
  9. locked and limited conversation to collaborators on Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclr

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions