You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The 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// publicstructS0{publicboolF1;publicushortF2;publicsbyteF3;publicushortM21(){varvr2=Program.s_6;Program.M25(vr2,0,this);return1;}}publicclassProgram{publicstaticS0s_6;publicstaticS0[][]s_90=newS0[][]{newS0[]{newS0()}};publicstaticvoidMain(){varvr6=s_90[0][0].M21();}publicstaticvoidM25(S0argThis,ulongarg0,S0arg1){varvr5=s_6.F1;}}
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
Activity
ghost added
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Codegen tries to generate ldrh\strh instruction pair for copying the remaining 2 bytes and ended up passing EA_2BYTE as attr to emitIns_R_R_I call. However, emitter expects (even for the small integer types byte\short) attr to be EA_4BYTE for these instructions.
I wonder why we never seen a similar situation on Arm64 - I am going try to repro this before submitting a fix.
Activity
echesakov commentedon Oct 28, 2021
I can take a look at this
echesakov commentedon Nov 2, 2021
This issue could be reproduced using a simplified version of the original program
The assert happens when generating
PUTARG_STK(OBJ)inM21to pass 6-byte struct argumentstkArgon stackCodegen tries to generate
ldrh\strhinstruction pair for copying the remaining 2 bytes and ended up passingEA_2BYTEasattrtoemitIns_R_R_Icall. However, emitter expects (even for the small integer typesbyte\short)attrto beEA_4BYTEfor these instructions.I wonder why we never seen a similar situation on Arm64 - I am going try to repro this before submitting a fix.
echesakov commentedon Mar 15, 2022
Un-assigning myself
cc @BruceForstall
jakobbotsch commentedon Apr 25, 2022
@JulieLeeMSFT can you assign someone for this?
jakobbotsch commentedon Apr 25, 2022
Actually I can take a look.
Fix wrong emitAttr passed for loads/stores in PUTARG_STK
JIT ARM32: Fix wrong emitAttr passed for loads/stores in PUTARG_STK (#…