-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 ARM32: Assertion failed 'size == EA_4BYTE' during 'Generate code' #60827
Comments
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsDescriptionThe following program hits a JIT assert when compiled with optimizations on. Reproduction Steps// Generated by Fuzzlyn v1.5 on 2021-10-24 15:05:24
// Run on Arm Linux
// Seed: 12233313255942773337
// Reduced from 205.3 KiB to 0.5 KiB in 00:03:57
// Hits JIT assert in Release:
// Assertion failed 'size == EA_4BYTE' in 'S0:M21():ushort:this' during 'Generate code' (IL size 20)
//
// File: /__w/1/s/src/coreclr/jit/emitarm.cpp Line: 2912
//
public struct S0
{
public bool F1;
public ushort F2;
public sbyte F3;
public ushort M21()
{
var vr2 = Program.s_6;
Program.M25(vr2, 0, this);
return 1;
}
}
public class Program
{
public static S0 s_6;
public static S0[][] s_90 = new S0[][]{new S0[]{new S0()}};
public static void Main()
{
var vr6 = s_90[0][0].M21();
}
public static void M25(S0 argThis, ulong arg0, S0 arg1)
{
var vr5 = s_6.F1;
}
} Expected behaviorNo assert hit. Actual behaviorWe hit the assert. Regression?No response Known WorkaroundsNo response ConfigurationNo response Other informationcc @dotnet/jit-contrib
|
I can take a look at this |
This issue could be reproduced using a simplified version of the original program using System.Runtime.CompilerServices;
public struct S0
{
public ushort F1;
public ushort F2;
public byte F3;
public void M21()
{
M25(0, 1, 2, 3, this);
}
[MethodImpl(MethodImplOptions.NoInlining)]
static void M25(int r0, int r1, int r2, int r3, S0 stkArg)
{
}
}
public class Program
{
public static int Main()
{
new S0().M21();
return 100;
}
} The assert happens when generating
Codegen tries to generate I wonder why we never seen a similar situation on Arm64 - I am going try to repro this before submitting a fix. |
Un-assigning myself |
@JulieLeeMSFT can you assign someone for this? |
Actually I can take a look. |
On arm architectures the small load/store instructions all work larger registers and for loads the instruction automatically normalizes the result. Due to this we always expect to pass the normalized size for loads/stores when generating these instructions, but in this particular place we did not do so, resulting in asserts on arm32. On arm64 the function ignores the size so nothing happens. Fix dotnet#60827
…68540) On arm architectures the small load/store instructions all work larger registers and for loads the instruction automatically normalizes the result. Due to this we always expect to pass the normalized size for loads/stores when generating these instructions, but in this particular place we did not do so, resulting in asserts on arm32. On arm64 the function ignores the size so nothing happens. Fix #60827
Description
The following program hits a JIT assert when compiled with optimizations on.
Reproduction Steps
Expected behavior
No assert hit.
Actual behavior
We hit the assert.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
cc @dotnet/jit-contrib
The text was updated successfully, but these errors were encountered: