Skip to content

Commit bfec681

Browse files
Work around the "InferOpSizeAlign" problem
Handling it generally requires solving a larger problem of "eeGetArgSizeAlignment" not working well on ARM. (See also the use of "eeGetArgSizeAlignment" in "lvaInitUserArgs")
1 parent cf6a669 commit bfec681

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/coreclr/jit/morph.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2281,8 +2281,15 @@ void CallArgs::AddFinalArgsAndDetermineABIInfo(Compiler* comp, GenTreeCall* call
22812281
!callIsVararg && (isHfaArg || varTypeUsesFloatReg(argSigType)) && !comp->opts.compUseSoftFP;
22822282
bool passUsingIntRegs = passUsingFloatRegs ? false : (intArgRegNum < MAX_REG_ARG);
22832283

2284-
// TODO-Bug: this should use the signature type/class instead of "argx".
2285-
comp->codeGen->InferOpSizeAlign(argx, &argAlignBytes);
2284+
// TODO-Cleanup: use "eeGetArgSizeAlignment" here. See also: https://github.com/dotnet/runtime/issues/46026.
2285+
if (varTypeIsStruct(argSigType))
2286+
{
2287+
argAlignBytes = comp->info.compCompHnd->getClassAlignmentRequirement(argSigClass);
2288+
}
2289+
else
2290+
{
2291+
argAlignBytes = genTypeSize(argSigType);
2292+
}
22862293

22872294
argAlignBytes = roundUp(argAlignBytes, TARGET_POINTER_SIZE);
22882295

0 commit comments

Comments
 (0)