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

JIT: Redundant bound check #111027

Open
Tracked by #109677
EgorBo opened this issue Jan 2, 2025 · 1 comment
Open
Tracked by #109677

JIT: Redundant bound check #111027

EgorBo opened this issue Jan 2, 2025 · 1 comment
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI untriaged New issue has not been triaged by the area owner
Milestone

Comments

@EgorBo
Copy link
Member

EgorBo commented Jan 2, 2025

static bool ParseIP(string s)
{
    if (s.Length > 15)
    {
        return false;
    }

    Span<ushort> value = stackalloc ushort[16];
    value[s.Length] = '.';
    Consume(value);
    return true;
}


[MethodImpl(MethodImplOptions.NoInlining)]
static void Consume<T>(Span<T> _)
{
}

Currently, value[s.Length] = '.'; line produces a bound check while it shouldn't.

@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 Jan 2, 2025
@EgorBo EgorBo added this to the Future milestone Jan 2, 2025
@EgorBo EgorBo self-assigned this Jan 2, 2025
Copy link
Contributor

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

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

1 participant