summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Andreenko <seandree@microsoft.com>2019-06-21 14:49:57 -0700
committerGitHub <noreply@github.com>2019-06-21 14:49:57 -0700
commit205e01fc5020f597ee69643c24fd56268cdf1b50 (patch)
treef5fc2f9eb2222b7d9134d951803f31ebaa2b0a65
parentec54de73c309d64fcf4683c5e23c9065cd16fd08 (diff)
downloadcoreclr-205e01fc5020f597ee69643c24fd56268cdf1b50.tar.gz
coreclr-205e01fc5020f597ee69643c24fd56268cdf1b50.tar.bz2
coreclr-205e01fc5020f597ee69643c24fd56268cdf1b50.zip
WorkAround for #25050. (#25316)
* WorkAround for #25050. A temporary workaround to push the milestone for this issue to 3.next. * Response review.
-rw-r--r--src/jit/emit.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/jit/emit.h b/src/jit/emit.h
index 595e2840b5..63d1c7c2bc 100644
--- a/src/jit/emit.h
+++ b/src/jit/emit.h
@@ -884,6 +884,16 @@ protected:
}
void idCodeSize(unsigned sz)
{
+ if (sz > 15)
+ {
+ // This is a temporary workaround for non-precise instr size
+ // estimator on XARCH. It often overestimates sizes and can
+ // return value more than 15 that doesn't fit in 4 bits _idCodeSize.
+ // If somehow we generate instruction that needs more than 15 bytes we
+ // will fail on another assert in emit.cpp: noway_assert(id->idCodeSize() >= csz).
+ // Issue https://github.com/dotnet/coreclr/issues/25050.
+ sz = 15;
+ }
assert(sz <= 15); // Intel decoder limit.
_idCodeSize = sz;
assert(sz == _idCodeSize);