Skip to content

Commit

Permalink
Merge pull request #12943 from jashook/fix_8093
Browse files Browse the repository at this point in the history
For LEGACY_BACKEND ARM32 do not overwrite 1 element HFA type
  • Loading branch information
Jarret Shook committed Jul 24, 2017
2 parents 8b5dd6c + 09fc751 commit 6747fa1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions src/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/arm/Tests.lst
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 6747fa1

Please sign in to comment.