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

[automated] Merge branch 'release/8.0-rc2' => 'release/8.0' #92401

3 changes: 2 additions & 1 deletion src/coreclr/debug/daccess/dacdbiimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7788,8 +7788,9 @@ HRESULT DacStackReferenceWalker::Next(ULONG count, DacGcReference stackRefs[], U
stackRefs[i].i64ExtraData = 0;

const SOSStackRefData &sosStackRef = mList.Get(i);
if (sosStackRef.Flags & GC_CALL_INTERIOR)
if (sosStackRef.Flags & GC_CALL_INTERIOR || sosStackRef.Address == 0)
{
// Direct pointer case - interior pointer, Frame ref, or enregistered var.
stackRefs[i].pObject = CLRDATA_ADDRESS_TO_TADDR(sosStackRef.Object) | 1;
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/di/rsclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ HRESULT CordbClass::GetStaticFieldValue(mdFieldDef fieldDef,
IMetaDataImport * pImport = NULL;
EX_TRY
{
RSLockHolder lockHolder(GetProcess()->GetProcessLock());
pImport = GetModule()->GetMetaDataImporter(); // throws

// Validate the token.
Expand Down Expand Up @@ -1191,4 +1192,3 @@ HRESULT CordbClass::SearchFieldInfo(
// Well, the field doesn't even belong to this class...
ThrowHR(E_INVALIDARG);
}

2 changes: 1 addition & 1 deletion src/coreclr/jit/valuenum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7891,7 +7891,7 @@ ValueNum ValueNumStore::EvalHWIntrinsicFunBinary(var_types type,
#endif
{
// Handle `x ^ x == 0`
return arg0VN;
return VNZeroForType(type);
}

default:
Expand Down
20 changes: 16 additions & 4 deletions src/mono/mono/mini/aot-compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -10708,6 +10708,18 @@ execute_system (const char * command)

#ifdef ENABLE_LLVM

#ifdef HOST_WIN32
#define OPT_NAME "opt.exe"
#else
#define OPT_NAME "opt"
#endif

#ifdef HOST_WIN32
#define LLC_NAME "llc.exe"
#else
#define LLC_NAME "llc"
#endif

/*
* emit_llvm_file:
*
Expand Down Expand Up @@ -10776,11 +10788,11 @@ emit_llvm_file (MonoAotCompile *acfg)
} else {
#if LLVM_API_VERSION >= 1600
/* The safepoints pass requires new pass manager syntax*/
opts = g_strdup ("-disable-tail-calls -passes='");
opts = g_strdup ("-disable-tail-calls -passes=\"");
if (!acfg->aot_opts.llvm_only) {
opts = g_strdup_printf ("%sdefault<O2>,", opts);
}
opts = g_strdup_printf ("%splace-safepoints' -spp-all-backedges", opts);
opts = g_strdup_printf ("%splace-safepoints\" -spp-all-backedges", opts);
#elif LLVM_API_VERSION >= 1300
/* The safepoints pass requires the old pass manager */
opts = g_strdup ("-disable-tail-calls -place-safepoints -spp-all-backedges -enable-new-pm=0");
Expand Down Expand Up @@ -10810,7 +10822,7 @@ emit_llvm_file (MonoAotCompile *acfg)
opts = g_strdup_printf ("%s -fp-contract=fast -enable-no-infs-fp-math -enable-no-nans-fp-math -enable-no-signed-zeros-fp-math -enable-no-trapping-fp-math -enable-unsafe-fp-math", opts);
}

command = g_strdup_printf ("\"%sopt\" -f %s -o \"%s\" \"%s\"", acfg->aot_opts.llvm_path, opts, optbc, tempbc);
command = g_strdup_printf ("\"%s" OPT_NAME "\" -f %s -o \"%s\" \"%s\"", acfg->aot_opts.llvm_path, opts, optbc, tempbc);
aot_printf (acfg, "Executing opt: %s\n", command);
if (execute_system (command) != 0)
return FALSE;
Expand Down Expand Up @@ -10885,7 +10897,7 @@ emit_llvm_file (MonoAotCompile *acfg)
g_string_append_printf (acfg->llc_args, " -mattr=%s", acfg->aot_opts.llvm_cpu_attr);
}

command = g_strdup_printf ("\"%sllc\" %s -o \"%s\" \"%s.opt.bc\"", acfg->aot_opts.llvm_path, acfg->llc_args->str, output_fname, acfg->tmpbasename);
command = g_strdup_printf ("\"%s" LLC_NAME "\" %s -o \"%s\" \"%s.opt.bc\"", acfg->aot_opts.llvm_path, acfg->llc_args->str, output_fname, acfg->tmpbasename);
g_free (output_fname);

aot_printf (acfg, "Executing llc: %s\n", command);
Expand Down
3 changes: 2 additions & 1 deletion src/mono/mono/mini/mini-generic-sharing.c
Original file line number Diff line number Diff line change
Expand Up @@ -2886,7 +2886,8 @@ info_equal (gpointer data1, gpointer data2, MonoRgctxInfoType info_type)
return data1 == data2;
case MONO_RGCTX_INFO_VIRT_METHOD:
case MONO_RGCTX_INFO_VIRT_METHOD_CODE:
case MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE: {
case MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE:
case MONO_RGCTX_INFO_GSHAREDVT_CONSTRAINED_CALL_INFO: {
MonoJumpInfoVirtMethod *info1 = (MonoJumpInfoVirtMethod *)data1;
MonoJumpInfoVirtMethod *info2 = (MonoJumpInfoVirtMethod *)data2;

Expand Down
37 changes: 37 additions & 0 deletions src/tests/JIT/Regression/JitBlue/Runtime_91252/Runtime_91252.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
// This test verifies if we correctly value number the operation of
// x ^ x to zero.
//
// Found by Antigen

using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using Xunit;

public class Issue_91252
{
static Vector64<int> s_v64_int_22 = Vector64.Create(-5);
Vector64<int> v64_int_72 = Vector64.Create(-1);

[MethodImpl(MethodImplOptions.NoInlining)]
public int Repro()
{
s_v64_int_22 = v64_int_72;
return Check(v64_int_72 ^ v64_int_72);
}

[MethodImpl(MethodImplOptions.NoInlining)]
public int Check(Vector64<int> a)
{
return (a == Vector64<int>.Zero) ? 100 : 101;
}

[Fact]
public static int EntryPoint()
{
var obj = new Issue_91252();
return obj.Repro();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>