Skip to content

JIT: OSR is not conservative enough about exposing struct locals #83783

Description

@jakobbotsch
usingSystem;usingSystem.Runtime.CompilerServices;publicclassMissingExposure{[MethodImpl(MethodImplOptions.NoInlining)]staticvoidBar(){}[MethodImpl(MethodImplOptions.NoInlining)]staticvoidFoo(intn){Ss=newS{F=1234};refintfoo=refs.F;for(inti=0;i<n;i++){Bar();}intabc=s.F*3+4;foo=25;intdef=s.F*3+4;Console.WriteLine("abc = {0} (expected {1}), def = {2} (expected {3})",abc,1234*3+4,def,25*3+4);}publicstaticvoidMain(){Foo(50000);}publicstructS{publicintF;}}

Output with OSR enabled: abc = 3706 (expected 3706), def = 3706 (expected 79)

cc @AndyAyersMS

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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