-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Make getTypeForPrimitiveValueClass treat different signs as different types #71633
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/tests/JIT/Regression/JitBlue/Runtime_71632/Runtime_71632.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Numerics; | ||
using System.Runtime.CompilerServices; | ||
|
||
public class Runtime_71632 | ||
{ | ||
public static int Main() | ||
{ | ||
try | ||
{ | ||
Problem(1); | ||
return 101; | ||
} | ||
catch (InvalidCastException) {} | ||
|
||
try | ||
{ | ||
Problem2(1); | ||
return 102; | ||
} | ||
catch (InvalidCastException) {} | ||
|
||
return 100; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static sbyte Problem(byte a) | ||
{ | ||
object box = a; | ||
Use(ref box); | ||
return (sbyte)box; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static sbyte Problem2(byte a) | ||
{ | ||
object box = a; | ||
return (sbyte)box; | ||
} | ||
|
||
static void Use<T>(ref T arg) { } | ||
} |
9 changes: 9 additions & 0 deletions
9
src/tests/JIT/Regression/JitBlue/Runtime_71632/Runtime_71632.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a helper method for this. I think it should be possible to simplify the whole thing into:
It looks odd that this method is handling
ELEMENT_TYPE_PTR
andELEMENT_TYPE_FNPTR
. It does not match the namegetTypeForPrimitiveValueClass
.Is the JIT really expecting this method to handle
ELEMENT_TYPE_PTR
andELEMENT_TYPE_FNPTR
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for example in https://github.com/dotnet/runtime/blob/main/src/coreclr/jit/importer.cpp#L4203
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CorIsPrimitiveType
would also includeELEMENT_TYPE_END
, would that be okay?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see the connection between this line and the method being changed in this PR. Could you please shed some light on it?
Yes, that' ok.
ELEMENT_TYPE_END
is never returned by as CorElementType of a type.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, wrong line, here: https://github.com/dotnet/runtime/blob/main/src/coreclr/jit/importer.cpp#L6586
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try it after the CI finishes, want to see if everything's okay with the current changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkotas Could you take a look if the musl failure that appeared after removing the pointers looks related?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The failure looks like the same as #66413 (comment) which might be related to #71439. Does not look related to your change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The failure is unrelated and failed in other PRs - #66413 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have opened blocking-clean-in issue #71684 on this.
When merging on red, failures should be always tracked by active blocking-clean-in issue.