-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Assertion prop does not properly truncate stores to small-typed args #70607
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
bug
Milestone
Comments
dotnet-issue-labeler
bot
added
the
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
label
Jun 11, 2022
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue Detailspublic static void Main()
{
System.Console.WriteLine(M(0));
}
[MethodImpl(MethodImplOptions.NoInlining)]
public static int M(byte arg0)
{
IL.Emit.Ldc_I4(-1);
IL.Emit.Starg(0);
IL.Emit.Ldarg(0);
return IL.Return<int>();
} Expected: 255 ... *************** In fgMorphBlocks()
Morphing BB01 of 'Program:M(ubyte):int'
fgMorphTree BB01, STMT00000 (before)
[000002] -A--------- ▌ ASG ubyte
[000001] D------N--- ├──▌ LCL_VAR ubyte V00 arg0
[000000] ----------- └──▌ CNS_INT int -1
Notify VM instruction set (SSE2) must be supported.
GenTreeNode creates assertion:
[000002] -A--------- ▌ ASG ubyte
In BB01 New Local Constant Assertion: V00 == -1, index = #01
fgMorphTree BB01, STMT00001 (before)
[000004] ----------- ▌ RETURN int
[000003] ----------- └──▌ LCL_VAR ubyte V00 arg0
Assertion prop in BB01:
Constant Assertion: V00 == -1, index = #01
[000003] ----------- ▌ CNS_INT int -1
fgMorphTree BB01, STMT00001 (after)
[000004] -----+----- ▌ RETURN int
[000003] -----+----- └──▌ CNS_INT int -1
|
This is a small repro of a problem in #70518 (comment). |
jakobbotsch
added
bug
and removed
untriaged
New issue has not been triaged by the area owner
labels
Jun 11, 2022
ghost
added
the
in-pr
There is an active PR which will close this issue when it is merged
label
Jun 13, 2022
This was referenced Jun 27, 2022
jakobbotsch
added a commit
that referenced
this issue
Jun 27, 2022
For small locals we need to cast these to the type of the local when the assertion is created. Also add some checking on the loading side of these assertions. Fix #70607
ghost
removed
the
in-pr
There is an active PR which will close this issue when it is merged
label
Jun 27, 2022
ghost
locked as resolved and limited conversation to collaborators
Jul 27, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
bug
Expected: 255
Actual: 255 in debug, -1 in release
...
The text was updated successfully, but these errors were encountered: