-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Open
Labels
area-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 SuperPMI
Milestone
Description
The following program works with TC=0 and fails with StackOverflowException in default (Tiered) mode:
FibRecursive(0, 1, 10000000);
long FibRecursive(long acc1, long acc2, int count) =>
count switch
{
0 => acc1,
1 => acc2,
_ => FibRecursive(acc2, acc1 + acc2, count - 1)
};Since Roslyn never emits .tail prefix, I think JIT should at least catch obvious recursive calls by bypassing Tier0 and compile such methods with optimizations immediately (or emit tails even in Tier0 ?)
@dotnet/jit-contrib for opinions
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-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 SuperPMI