Skip to content

Invalid ROL/ROR logic when accessing array element on x86 #86027

@tannergooding

Description

@tannergooding

Run the following program on x86:

long[] firstOp = new long[] { 7822136809956075968, 1 };

if (long.RotateRight(firstOp[0], 1) != 3911068404978037984)
{
    return 0;
}

return 100;

Expected Behavior

The program exits with code: 100

Actual Behavior

The program exits with code: 0

Notes

The bug does not present itself if manually rotating, such as doing: ((firstOp[0] >>> 1) | (firstOp[0] << (64 - 1)))

Metadata

Metadata

Assignees

Labels

arch-x86area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions