-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Milestone
Description
Description
The following program gives a wrong result when optimizing:
Reproduction Steps
// Debug: 80
// Release: ffff0080
using System.Buffers.Binary;
short[] foo = { short.MinValue };
int test = BinaryPrimitives.ReverseEndianness(foo[0]);
System.Console.WriteLine(test.ToString("x"));Expected behavior
Same result.
Actual behavior
Different results.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
We do insert the cast when we import. Looks like value numbering ends up assigning the same liberal VN to the cast and the bswap16 and CSE then effectively removes the sign extension.
Reactions are currently unavailable
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