Bug 19758 – (0x01 & 0xFF) == 0 by dmd 2.085.0(-m64) on Windows

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2019-03-22T05:56:32Z
Last change time
2019-06-19T21:17:50Z
Keywords
pull, wrong-code
Assigned to
No Owner
Creator
kntroh

Comments

Comment #0 by kntroh — 2019-03-22T05:56:32Z
PS[test]$ type oneiszero.d void main() { byte[1] a = [1]; int b = 0; // If delete this 4 lines, the result is correct. if (a[b] == 0) { a[b] = 0; if (1 << b) { } } // If enable this assertion, the result is correct. // assert ((a[b] & 0xFF) == 1); if ((a[b] & 0xFF) == 0) { // Oddly, this block is executed. dmd 2.085.0(-m64) with Windows 8.1 or 10. assert((a[b] & 0xFF) == 0); } } PS[test]$ dmd.exe -m64 -run oneiszero.d [email protected](16): Assertion failure ---------------- 0x00007FF6803611DB 0x00007FF68036110E 0x00007FF6803619F2 0x00007FF68036187F 0x00007FF68036195B 0x00007FF68036187F 0x00007FF6803617B1 0x00007FF680361134 0x00007FF68038B618 0x00007FFC809713D2 in BaseThreadInitThunk 0x00007FFC80CC54F4 in RtlUserThreadStart PS[test]$
Comment #1 by r.sagitario — 2019-06-16T18:04:28Z
Introduced by https://github.com/dlang/dmd/pull/9015 but the root cause is probably elsewhere.
Comment #2 by dlang-bot — 2019-06-16T19:45:45Z
@rainers created dlang/dmd pull request #10047 "fix Issue 19758 - (0x01 & 0xFF) == 0 by dmd 2.085.0(-m64) on Window" fixing this issue: - fix Issue 19758 - (0x01 & 0xFF) == 0 by dmd 2.085.0(-m64) on Window operation "test SIL,SIL" needs REX prefix https://github.com/dlang/dmd/pull/10047
Comment #3 by dlang-bot — 2019-06-19T21:17:50Z
dlang/dmd pull request #10047 "fix Issue 19758 - (0x01 & 0xFF) == 0 by dmd 2.085.0(-m64) on Window" was merged into stable: - 01b7ee6f0906b0fbc3a78b024b0a749d1b56d249 by Rainer Schuetze: fix Issue 19758 - (0x01 & 0xFF) == 0 by dmd 2.085.0(-m64) on Window operation "test SIL,SIL" needs REX prefix https://github.com/dlang/dmd/pull/10047