diff options
author | jashoo <jashoo@microsoft.com> | 2017-07-19 16:32:16 -0700 |
---|---|---|
committer | jashook <jashoo@microsoft.com> | 2017-07-20 11:52:40 -0700 |
commit | 09fc7516422f7577f0ec1eb4c7903edc0e2c58de (patch) | |
tree | c9b57d46c8616169354316419a6180d9214ece89 | |
parent | dcf0637f2073d862bce3ab01fd2b9bad34796929 (diff) | |
download | coreclr-09fc7516422f7577f0ec1eb4c7903edc0e2c58de.tar.gz coreclr-09fc7516422f7577f0ec1eb4c7903edc0e2c58de.tar.bz2 coreclr-09fc7516422f7577f0ec1eb4c7903edc0e2c58de.zip |
For lb arm do not overwrite 1 element hfa type
On arm64 we will treat 1 element HFA types as the primitive
type that is contained. On Legacy Backend codegenlegacy will
incorrectly assign these two types. Instead keep the struct
type through the IR correctly to do a blockop.
-rw-r--r-- | src/jit/compiler.cpp | 13 | ||||
-rw-r--r-- | tests/arm/Tests.lst | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/jit/compiler.cpp b/src/jit/compiler.cpp index ab5f4743d7..06f31a4db6 100644 --- a/src/jit/compiler.cpp +++ b/src/jit/compiler.cpp @@ -1003,9 +1003,14 @@ var_types Compiler::getReturnTypeForStruct(CORINFO_CLASS_HANDLE clsHnd, // if (structSize <= sizeof(double)) { - // We set the "primitive" useType based upon the structSize - // and also examine the clsHnd to see if it is an HFA of count one - useType = getPrimitiveTypeForStruct(structSize, clsHnd); +#if defined LEGACY_BACKEND + if (!IsHfa(clsHnd)) +#endif + { + // We set the "primitive" useType based upon the structSize + // and also examine the clsHnd to see if it is an HFA of count one + useType = getPrimitiveTypeForStruct(structSize, clsHnd); + } } #endif // FEATURE_UNIX_AMD64_STRUCT_PASSING @@ -1043,8 +1048,10 @@ var_types Compiler::getReturnTypeForStruct(CORINFO_CLASS_HANDLE clsHnd, // Structs that are HFA's are returned in multiple registers if (IsHfa(clsHnd)) { +#if !defined(LEGACY_BACKEND) // HFA's of count one should have been handled by getPrimitiveTypeForStruct assert(GetHfaCount(clsHnd) >= 2); +#endif // !defined(LEGACY_BACKEND) // setup wbPassType and useType indicate that this is returned by value as an HFA // using multiple registers diff --git a/tests/arm/Tests.lst b/tests/arm/Tests.lst index 76bf0db2cd..af8dd2fd10 100644 --- a/tests/arm/Tests.lst +++ b/tests/arm/Tests.lst @@ -8993,7 +8993,7 @@ RelativePath=JIT\Directed\StructABI\StructABI\StructABI.cmd WorkingDir=JIT\Directed\StructABI\StructABI Expected=0 MaxAllowedDurationSeconds=600 -Categories=EXPECTED_FAIL;8093 +Categories=EXPECTED_PASS HostStyle=0 [Ackermann.cmd_1125] |