-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
JitStressCLR JIT issues involving JIT internal stress modesCLR JIT issues involving JIT internal stress modesarea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIbug
Milestone
Description
When COMPlus_TailcallStress=1 is set, the JIT converts as many call/ret pairs as possible into tail call, which it treats as tail. prefixed "explicit" tail calls. It does not in this case run the legality checks that are run when checking to determine if implicit tailcall optimization can be done, specifically the code under FEATURE_TAILCALL_OPT in fgMorphCall() that rejects a potential tail call if any variable in the function has had its address taken, if there are pinned locals, or if there are struct promoted struct arguments.
This causes code such as this to fail:
unsafe class Program
{
static void foo(IntPtr x)
{
Console.WriteLine(*(int*)x);
}
static void Main(string[] args)
{
int x = 42;
foo((IntPtr)(&x));
}
}
category:correctness
theme:tail-call
skill-level:intermediate
cost:small
Metadata
Metadata
Assignees
Labels
JitStressCLR JIT issues involving JIT internal stress modesCLR JIT issues involving JIT internal stress modesarea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIbug