* Revises compMethodReturnsMultiRegRetType for ARM
For ARM, the current implementation of 'compMethodReturnsMultiRegRetType'
always returns false.
Unfortunately, this behavior is inconsistent with JIT importer. JIT impoter
attempts to merge various return statements as one statement via inserting
an assignment statement just before each return statement if there are more
than 4 returns.
If the method of interest has a return value, then JIT importer
introduces a local temporary variable, and use it to return value.
Due to the above implementation, JIT importer never generates a return
variable, which results in assertion violation insider JIT morph, which
is discussed in dotnet/coreclr#5009.
This commit attempts to fix dotnet/coreclr#5009 via implementing 'compMethodReturnsMultiRegRetType'
for ARM.
* Uses compRetNativeType instead of compRetType
* Fix typo '_TARGET_ARM' as '_TARGET_ARM_'
Commit migrated from https://github.com/dotnet/coreclr/commit/
bcc8495653c03b8ba4bb61fbd4828cac90789c4e
bool compMethodReturnsMultiRegRetType()
{
#if FEATURE_MULTIREG_RET
-#ifdef FEATURE_UNIX_AMD64_STRUCT_PASSING
+#if defined(FEATURE_UNIX_AMD64_STRUCT_PASSING) || defined(_TARGET_ARM_)
// Methods returning a struct in two registers is considered having a return value of TYP_STRUCT.
// Such method's compRetNativeType is TYP_STRUCT without a hidden RetBufArg
return varTypeIsStruct(info.compRetNativeType) && (info.compRetBuffArg == BAD_VAR_NUM);
nativeSize = wNativeSize;
}
-#if !defined(_TARGET_ARM) && !(defined(UNIX_AMD64_ABI) && defined(FEATURE_UNIX_AMD64_STRUCT_PASSING))
+#if !defined(_TARGET_ARM_) && !(defined(UNIX_AMD64_ABI) && defined(FEATURE_UNIX_AMD64_STRUCT_PASSING))
switch (nativeSize)
{
case 1: typ = ELEMENT_TYPE_U1; break;