Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/9.0] Fix infinite loop in genCreateAddrMode #106766

Merged
merged 3 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1365,9 +1365,8 @@ bool CodeGen::genCreateAddrMode(GenTree* addr,
{
cns += addConst->IconValue();
op2 = op2->AsOp()->gtOp1;
goto AGAIN;
}

goto AGAIN;
}
break;
#endif // TARGET_XARCH
Expand Down
40 changes: 40 additions & 0 deletions src/tests/JIT/Regression/JitBlue/Runtime_106607/Runtime_106607.il
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

.assembly extern System.Runtime { }
.assembly extern System.Console { }
.assembly extern xunit.core { }
.assembly Runtime_106607 { }

.class Runtime_106607 extends [System.Runtime]System.Object
{
.method public static int32 Main() nooptimization
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 8
.locals init ([0] int32 num)

ldc.i4 42
stloc.0
ldloc.0
ldc.i4 1620763441
ldc.i4 1453536392
add
add
ldloc.0
ldloc.0
sub
ldc.i4 152872638
ldc.i4.s 31
and
shl
add
call void [System.Console]System.Console::WriteLine(int32)

ldc.i4 100
ret
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).il" />
</ItemGroup>
</Project>
Loading