-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Description
Description
https://godbolt.org/z/jfPx7oenM
When constants are smaller than -0x1000000 and DOTNET_JitDisasm is set, the runtime prints these as 64-bit constants, even if the instruction expects a 32-bit constant (based on the register widths of the instruction). This can result in invalid assembly code like mov eax, 0xFFFFFFFFFEFFFFFF.
To be precise, the assembled program is correct, only the printing of the program is incorrect.
Reproduction Steps
using System.Runtime.CompilerServices;
class Program
{
public static void Main(string[] args)
{
}
[MethodImpl(MethodImplOptions.NoInlining)]
public int foo(int x)
{
return -0x1000001;
}
}Expected behavior
mov eax, 0xFEFFFFFFActual behavior
mov eax, 0xFFFFFFFFFEFFFFFFRegression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI