Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit a17fa33

Browse files
authored
Merge pull request #17135 from CarolEidt/DevDiv544985
ARM: correctly unassign constant double
2 parents f819fdc + 0462526 commit a17fa33

File tree

3 files changed

+223
-4
lines changed

3 files changed

+223
-4
lines changed

src/jit/lsra.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5359,10 +5359,8 @@ void LinearScan::allocateRegisters()
53595359
// Update overlapping floating point register for TYP_DOUBLE
53605360
if (assignedInterval->registerType == TYP_DOUBLE)
53615361
{
5362-
regRecord = getSecondHalfRegRec(regRecord);
5363-
assignedInterval = regRecord->assignedInterval;
5364-
5365-
assert(assignedInterval != nullptr && !assignedInterval->isActive && assignedInterval->isConstant);
5362+
regRecord = findAnotherHalfRegRec(regRecord);
5363+
assert(regRecord->assignedInterval == assignedInterval);
53665364
regRecord->assignedInterval = nullptr;
53675365
}
53685366
#endif
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
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+
// See the LICENSE file in the project root for more information.
4+
5+
.assembly extern mscorlib { auto }
6+
.assembly extern System.Runtime { auto }
7+
.assembly extern System.Console { auto }
8+
9+
.assembly DevDiv_544985 { }
10+
11+
.class public auto ansi beforefieldinit DevDiv_544985
12+
extends [System.Runtime]System.Object
13+
{
14+
.method public hidebysig static int32
15+
Test(int32 argI0, int32 argI1, int32 argI2, int16 argS3, int16 argS4, int16 argS5) cil managed noinlining
16+
{
17+
.locals init ([0] int64 locL0, int32 locI1, int8 locB2, int64 locL3, uint8 locUB4, uint16 locUS5,
18+
uint16 locUS6, uint8 locUB7, int16 locS8)
19+
ldc.i8 1
20+
stloc.0
21+
ldc.i4 1
22+
stloc.1
23+
ldc.i4 1
24+
stloc.2
25+
ldc.i8 1
26+
stloc.3
27+
ldc.i4 1
28+
stloc 4
29+
ldc.i4 1
30+
stloc 5
31+
ldc.i4 1
32+
stloc 6
33+
ldc.i4 1
34+
stloc 7
35+
ldc.i4 1
36+
stloc 8
37+
38+
ldc.i8 1
39+
ldarg.s 0x5
40+
stloc 0x4
41+
pop
42+
ldc.r8 2.7998176471286444e+172
43+
ldarg.s 0x5
44+
stloc.s 0x2
45+
ldarg.s 0x3
46+
stloc 0x8
47+
ldc.i8 0x330BB4E2
48+
ldloc 0x0
49+
ldc.i8 0x9C6A2B5
50+
and
51+
not
52+
ceq
53+
neg
54+
ldloc.s 0x4
55+
ldloc 0x3
56+
conv.i1
57+
or
58+
dup
59+
neg
60+
sub
61+
nop
62+
ldc.i8 0x27AF808A
63+
pop
64+
and
65+
stloc.s 0x6
66+
ldloc.s 0x0
67+
ldloc 0x7
68+
shr
69+
conv.i8
70+
conv.r4
71+
ldloc 0x5
72+
conv.u1
73+
starg 0x3
74+
neg
75+
ldc.r8 3.7091607632075579e+195
76+
conv.i8
77+
neg
78+
neg
79+
ldloc 0x7
80+
ldloc.s 0x2
81+
cgt.un
82+
ldloc 0x0
83+
ldc.i8 0xBCF8E9DB
84+
conv.i8
85+
rem.un
86+
conv.ovf.i4
87+
div
88+
shr
89+
not
90+
conv.r8
91+
div
92+
neg
93+
ldc.r8 -1.8469687730371883e+160
94+
ckfinite
95+
ldc.r8 6.7655721550212406e+3 // 6.7655721550212406e+303
96+
conv.r4
97+
ldarg.s 0x4
98+
conv.r4
99+
rem
100+
neg
101+
conv.r4
102+
rem
103+
conv.ovf.i8
104+
ldc.r8 -2.8239060779835572e+06 // -2.8239060779835572e+056
105+
ckfinite
106+
conv.i8
107+
add
108+
ldloc.s 0x0
109+
ldloc 0x0
110+
add
111+
pop
112+
pop
113+
ldc.i8 0x2AEA9007
114+
ldloc.s 0x3
115+
conv.r.un
116+
conv.i8
117+
div.un
118+
neg
119+
ldloc 0x4
120+
conv.i8
121+
ldarg.s 0x4
122+
shl
123+
clt.un
124+
conv.r8
125+
conv.r4
126+
nop
127+
mul
128+
neg
129+
clt
130+
ldarg 0x4
131+
conv.r4
132+
ckfinite
133+
ckfinite
134+
pop
135+
ret
136+
137+
} // end of method DevDiv_544985:Test
138+
139+
.method public hidebysig static int32 Main() cil managed
140+
{
141+
.entrypoint
142+
.locals init ([0] int32 retVal, [1] int32 testResult)
143+
144+
ldc.i4 100
145+
stloc.0
146+
ldc.i4 1
147+
ldc.i4 2
148+
ldc.i4 3
149+
ldc.i4 4
150+
ldc.i4 5
151+
ldc.i4 6
152+
call int32 DevDiv_544985::Test(int32 argI0, int32 argI1, int32 argI2, int16 argS3, int16 argS4, int16 argS5)
153+
stloc.1
154+
ldloc.1
155+
ldc.i4.0
156+
ceq
157+
brtrue.s L1
158+
159+
ldstr "Test Result = "
160+
call void [System.Console]System.Console::Write(string)
161+
ldloc.1
162+
call void [System.Console]System.Console::WriteLine(int32)
163+
ldstr "FAIL"
164+
call void [System.Console]System.Console::WriteLine(string)
165+
ldc.i4.m1
166+
stloc.0
167+
br L2
168+
169+
L1: ldstr "PASS"
170+
call void [System.Console]System.Console::WriteLine(string)
171+
172+
L2: ldloc.0
173+
ret
174+
} // end of method DevDiv_544985:Main
175+
176+
.method public hidebysig specialname rtspecialname
177+
instance void .ctor() cil managed
178+
{
179+
// Code size 8 (0x8)
180+
.maxstack 8
181+
ldarg.0
182+
call instance void [System.Runtime]System.Object::.ctor()
183+
ret
184+
} // end of method DevDiv_544985:.ctor
185+
186+
} // end of class DevDiv_544985
187+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
8+
<SchemaVersion>2.0</SchemaVersion>
9+
<ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
10+
<OutputType>Exe</OutputType>
11+
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
12+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
13+
</PropertyGroup>
14+
<!-- Default configurations to help VS understand the configurations -->
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "></PropertyGroup>
17+
<ItemGroup>
18+
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
19+
<Visible>False</Visible>
20+
</CodeAnalysisDependentAssemblyPaths>
21+
</ItemGroup>
22+
<PropertyGroup>
23+
<DebugType>None</DebugType>
24+
<Optimize>True</Optimize>
25+
</PropertyGroup>
26+
<ItemGroup>
27+
<Compile Include="$(MSBuildProjectName).il" />
28+
</ItemGroup>
29+
<ItemGroup>
30+
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
31+
</ItemGroup>
32+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
33+
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
34+
</Project>

0 commit comments

Comments
 (0)