runtime: PMI diffs are failing due to assert
jit-diff.bat diff --diff --pmi --frameworks currently fails for the following methods:
PREPALL type# 1350 method# 20377 System.Text.Encoding::GetCharsWithFallbackPREPALL type# 1350 method# 20378 System.Text.Encoding::GetCharsWithFallbackPREPALL type# 1350 method# 20472 System.Text.Encoding::GetBytesWithFallbackPREPALL type# 1350 method# 20473 System.Text.Encoding::GetBytesWithFallbackPREPALL type# 1350 method# 20477 System.Text.Encoding::GetCharCountWithFallbackPREPALL type# 1350 method# 20478 System.Text.Encoding::GetCharCountWithFallback
In all cases, an assert in emitOutputRR is firing: https://github.com/dotnet/runtime/blob/main/src/coreclr/jit/emitxarch.cpp#L11738-L11739
case INS_add:
case INS_sub:
assert(id->idGCref() == GCT_BYREF);
#ifdef DEBUG
regMaskTP regMask;
regMask = genRegMask(reg1) | genRegMask(reg2);
// r1/r2 could have been a GCREF as GCREF + int=BYREF
// or BYREF+/-int=BYREF
assert(((regMask & emitThisGCrefRegs) && (ins == INS_add)) ||
((regMask & emitThisByrefRegs) && (ins == INS_add || ins == INS_sub)));
#endif
// Mark r1 as holding a byref
emitGCregLiveUpd(GCT_BYREF, reg1, dst);
break;
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 27 (26 by maintainers)
Commits related to this issue
- Disable JIT xarch asserts on gcref/byref computation The emitter has asserts that an xarch RMW inc/dec/add/sub of a byref must have an incoming gcref/byref to be legal. This is (no longer) true due t... — committed to BruceForstall/runtime by BruceForstall 3 years ago
- Disable JIT xarch asserts on gcref/byref computation (#56192) The emitter has asserts that an xarch RMW inc/dec/add/sub of a byref must have an incoming gcref/byref to be legal. This is (no longer) ... — committed to dotnet/runtime by BruceForstall 3 years ago
This assert is planned to be disabled in https://github.com/dotnet/runtime/pull/55861
GC tracking has an inherent idea that GC refs are not created out of thin air. So
int + int -> byrefis not ok, it means one of thoseintwas really abyref, and the problem lies upstream somewhere.IIRC the object allocator phase does the right sort of analysis to motivate potentially retyping the local, if the only defs/uses of the local are byrefs.
Same as https://github.com/dotnet/runtime/issues/10821.
@AndyAyersMS