-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Ensure the layout of StackAllocatedBox<T>
matches boxed layouts
#107050
Conversation
The boxed layout of a struct always has its data at +8, as evidenced by `Object::UnBox`. This means that `StackAllocatedBox<T>` should have `Pack = 1`, otherwise this may not be the case. In the test failure we had a `StackAllocatedBox<Int128>` which had its `_value` field at offset 16. After object stack allocation this meant that we were saving data in padding of the structure, which promotion does not guarantee to preserve. Fix dotnet#106947
src/coreclr/jit/valuenum.cpp
Outdated
@@ -10299,7 +10299,7 @@ void ValueNumStore::vnDumpSimdType(Compiler* comp, VNFuncApp* simdType) | |||
int simdSize = ConstantValue<int>(simdType->m_args[0]); | |||
CorInfoType baseJitType = (CorInfoType)ConstantValue<int>(simdType->m_args[1]); | |||
|
|||
printf("%s(simd%d, %s)", VNFuncName(simdType->m_func), simdSize, varTypeName(JitType2PreciseVarType(baseJitType))); | |||
printf("%s(simd%d, %s)", VNFuncName(simdType->m_func), simdSize, baseJitType == TYP_UNDEF ? varTypeName(TYP_UNDEF) : varTypeName(JitType2PreciseVarType(baseJitType))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hit assert inside JitType2PreciseVarType
with JitDump
enabled while investigating -- this fixes the problem.
/ba-g There are no machines in the Helix queue for Ubuntu.2204.amd64.open.rt, so the jobs are going to time out. There is current investigation happening about the issue. |
/backport to release/9.0 |
Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/10593809747 |
…tnet#107050) The boxed layout of a struct always has its data at +8, as evidenced by `Object::UnBox`. This means that `StackAllocatedBox<T>` should have `Pack = 1`, otherwise this may not be the case. In the test failure we had a `StackAllocatedBox<Int128>` which had its `_value` field at offset 16. After object stack allocation this meant that we were saving data in padding of the structure, which promotion does not guarantee to preserve. Fix dotnet#106947
The boxed layout of a struct always has its data at +8, as evidenced by
Object::UnBox
. This means thatStackAllocatedBox<T>
should havePack = 1
, otherwise this may not be the case. In the test failure we had aStackAllocatedBox<Int128>
which had its_value
field at offset16. After object stack allocation this meant that we were saving data in padding of the structure, which promotion does not guarantee to preserve.
Fix #106947