File tree 5 files changed +54
-12
lines changed
tests/JIT/Regression/JitBlue/Runtime_71831
5 files changed +54
-12
lines changed Original file line number Diff line number Diff line change @@ -1014,7 +1014,7 @@ void CodeGen::genCodeForStoreLclFld(GenTreeLclFld* tree)
1014
1014
1015
1015
GenTree* data = tree->gtOp1 ;
1016
1016
regNumber dataReg = REG_NA;
1017
- genConsumeReg (data);
1017
+ genConsumeRegs (data);
1018
1018
1019
1019
if (data->isContained ())
1020
1020
{
@@ -1073,18 +1073,13 @@ void CodeGen::genCodeForStoreLclVar(GenTreeLclVar* tree)
1073
1073
{
1074
1074
GenTree* data = tree->gtOp1 ;
1075
1075
GenTree* actualData = data->gtSkipReloadOrCopy ();
1076
- unsigned regCount = 1 ;
1077
- // var = call, where call returns a multi-reg return value
1078
- // case is handled separately.
1076
+
1077
+ // Stores from a multi-reg source are handled separately.
1079
1078
if (actualData->IsMultiRegNode ())
1080
1079
{
1081
- regCount = actualData->GetMultiRegCount (compiler);
1082
- if (regCount > 1 )
1083
- {
1084
- genMultiRegStoreToLocal (tree);
1085
- }
1080
+ genMultiRegStoreToLocal (tree);
1086
1081
}
1087
- if (regCount == 1 )
1082
+ else
1088
1083
{
1089
1084
unsigned varNum = tree->GetLclNum ();
1090
1085
LclVarDsc* varDsc = compiler->lvaGetDesc (varNum);
Original file line number Diff line number Diff line change @@ -812,7 +812,7 @@ bool GenTree::IsMultiRegNode() const
812
812
#if !defined(TARGET_64BIT)
813
813
if (OperIsMultiRegOp())
814
814
{
815
- return true ;
815
+ return AsMultiRegOp()->GetRegCount() > 1 ;
816
816
}
817
817
#endif
818
818
Original file line number Diff line number Diff line change @@ -3492,7 +3492,7 @@ int LinearScan::BuildStoreLoc(GenTreeLclVarCommon* storeLoc)
3492
3492
3493
3493
// Second, use source registers.
3494
3494
3495
- if (op1->IsMultiRegNode () && (op1-> GetMultiRegCount (compiler) > 1 ) )
3495
+ if (op1->IsMultiRegNode ())
3496
3496
{
3497
3497
// This is the case where the source produces multiple registers.
3498
3498
// This must be a store lclvar.
Original file line number Diff line number Diff line change
1
+ // Licensed to the .NET Foundation under one or more agreements.
2
+ // The .NET Foundation licenses this file to you under the MIT license.
3
+
4
+ using System ;
5
+ using System . Runtime . CompilerServices ;
6
+
7
+ unsafe class Runtime_71831
8
+ {
9
+ private static int Main ( )
10
+ {
11
+ return Problem ( 100 ) ? 101 : 100 ;
12
+ }
13
+
14
+ [ MethodImpl ( MethodImplOptions . NoInlining ) ]
15
+ private static bool Problem ( int i )
16
+ {
17
+ StructWithFloats s = default ;
18
+
19
+ s . FloatOne = BitConverter . Int32BitsToSingle ( i ) ;
20
+
21
+ return s . FloatOne != * ( float * ) & i ;
22
+ }
23
+
24
+ struct StructWithFloats
25
+ {
26
+ public float FloatOne ;
27
+ public float FloatTwo ;
28
+ }
29
+ }
Original file line number Diff line number Diff line change
1
+ <Project Sdk =" Microsoft.NET.Sdk" >
2
+ <PropertyGroup >
3
+ <OutputType >Exe</OutputType >
4
+ <Optimize >True</Optimize >
5
+ <AllowUnsafeBlocks >true</AllowUnsafeBlocks >
6
+ <CLRTestBatchPreCommands ><![CDATA[
7
+ $(CLRTestBatchPreCommands)
8
+ set DOTNET_JitNoStructPromotion=1
9
+ ]]> </CLRTestBatchPreCommands >
10
+ <BashCLRTestPreCommands ><![CDATA[
11
+ $(BashCLRTestPreCommands)
12
+ export DOTNET_JitNoStructPromotion=1
13
+ ]]> </BashCLRTestPreCommands >
14
+ </PropertyGroup >
15
+ <ItemGroup >
16
+ <Compile Include =" $(MSBuildProjectName).cs" />
17
+ </ItemGroup >
18
+ </Project >
You can’t perform that action at this time.
0 commit comments