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

[mono][llvm] Fix alignment of local vars #106313

Merged
merged 2 commits into from
Aug 13, 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
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ public static void Value_ThrownException_DoesntCreateValue_PublicationOnly()
Assert.False(lazy.IsValueCreated);
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/105251", TestPlatforms.tvOS)]
[Fact]
public static void EnsureInitialized_SimpleRefTypes()
{
Expand Down Expand Up @@ -417,7 +416,6 @@ public static void EnsureInitialized_SimpleRefTypes()
Assert.Equal(strTemplate, d);
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/105251", TestPlatforms.tvOS)]
[Fact]
public static void EnsureInitialized_SimpleRefTypes_Invalid()
{
Expand All @@ -430,7 +428,6 @@ public static void EnsureInitialized_SimpleRefTypes_Invalid()
Assert.Throws<MissingMemberException>(() => LazyInitializer.EnsureInitialized(ref ndc));
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/105251", TestPlatforms.tvOS)]
[Fact]
public static void EnsureInitialized_ComplexRefTypes()
{
Expand Down Expand Up @@ -487,7 +484,6 @@ public static void EnsureInitialized_ComplexRefTypes()
Assert.Null(LazyInitializer.EnsureInitialized(ref e, ref einit, ref elock, () => { initCount++; return null; }));
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/105251", TestPlatforms.tvOS)]
[Fact]
public static void EnsureInitialized_ComplexRefTypes_Invalid()
{
Expand All @@ -498,7 +494,6 @@ public static void EnsureInitialized_ComplexRefTypes_Invalid()
Assert.Throws<MissingMemberException>(() => LazyInitializer.EnsureInitialized(ref ndc, ref ndcInit, ref ndcLock));
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/105251", TestPlatforms.tvOS)]
[Fact]
public static void LazyInitializerComplexValueTypes()
{
Expand Down Expand Up @@ -553,7 +548,6 @@ public static void Ctor_Value_ValueType()
VerifyLazy(lazyObject, 123, hasValue: true, isValueCreated: true);
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/105251", TestPlatforms.tvOS)]
[Fact]
public static void EnsureInitialized_FuncInitializationWithoutTrackingBool_Uninitialized()
{
Expand All @@ -565,7 +559,6 @@ public static void EnsureInitialized_FuncInitializationWithoutTrackingBool_Unini
Assert.NotNull(syncLock);
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/105251", TestPlatforms.tvOS)]
[Fact]
public static void EnsureInitialized_FuncInitializationWithoutTrackingBool_Initialized()
{
Expand All @@ -577,7 +570,6 @@ public static void EnsureInitialized_FuncInitializationWithoutTrackingBool_Initi
Assert.Null(syncLock);
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/105251", TestPlatforms.tvOS)]
[Fact]
public static void EnsureInitializer_FuncInitializationWithoutTrackingBool_Null()
{
Expand Down
6 changes: 3 additions & 3 deletions src/mono/mono/mini/mini-llvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2978,10 +2978,10 @@ build_named_alloca (EmitContext *ctx, MonoType *t, char const *name)

g_assert (!mini_is_gsharedvt_variable_type (t));

if (mini_class_is_simd (ctx->cfg, k))
align = mono_class_value_size (k, NULL);
if (mini_class_is_simd (ctx->cfg, k) && !m_type_is_byref (t))
align = mono_class_value_size (k, NULL); // FIXME mono_type_size should report correct alignment
else
align = mono_class_min_align (k);
mono_type_size (t, &align);

/* Sometimes align is not a power of 2 */
while (mono_is_power_of_two (align) == -1)
Expand Down
Loading