-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
arch-arm64area-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
Description
Funclets with large frame sizes in functions using stackalloc use an unusual kind of frame. The JIT does not generate correct prolog code for these funclets.
Reproduction Steps
using System;
using System.Runtime.CompilerServices;
public class Program
{
public static unsafe void Main()
{
int* foo = stackalloc int[30];
try
{
Console.WriteLine("try");
throw new Exception();
}
catch (Exception)
{
Console.WriteLine("catch");
foo[0] = 10;
ManyArgs(new Guid(foo[0], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
}
Console.WriteLine("after");
}
[MethodImpl(MethodImplOptions.NoInlining)]
private static void ManyArgs(
Guid g0 = default,
Guid g1 = default,
Guid g2 = default,
Guid g3 = default,
Guid g4 = default,
Guid g5 = default,
Guid g6 = default,
Guid g7 = default,
Guid g8 = default,
Guid g9 = default,
Guid g10 = default,
Guid g11 = default,
Guid g12 = default,
Guid g13 = default,
Guid g14 = default,
Guid g15 = default,
Guid g16 = default,
Guid g17 = default,
Guid g18 = default,
Guid g19 = default,
Guid g20 = default,
Guid g21 = default,
Guid g22 = default,
Guid g23 = default,
Guid g24 = default,
Guid g25 = default,
Guid g26 = default,
Guid g27 = default,
Guid g28 = default,
Guid g29 = default,
Guid g30 = default,
Guid g31 = default,
Guid g32 = default,
Guid g33 = default,
Guid g34 = default,
Guid g35 = default,
Guid g36 = default,
Guid g37 = default,
Guid g38 = default,
Guid g39 = default,
Guid g40 = default,
Guid g41 = default)
{
}
}Expected behavior
Prints "try", "catch" and "after".
Actual behavior
"after" is not printed.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
The JIT generates the following prolog for the funclet:
G_M27646_IG06: ;; offset=00C0H
F90007F3 str x19, [sp,#8]
A9017BFD stp fp, lr, [sp,#16]
D10983FF sub sp, sp, #608
910043A3 add x3, fp, #16
F90133E3 str x3, [sp,#608]This overrides caller stack with callee saves.
cc @dotnet/jit-contrib
Metadata
Metadata
Assignees
Labels
arch-arm64area-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