Bug 11565 – [Optimizer] Zeroes out the higher 32bits of register in ?: expression

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2013-11-20T13:38:00Z
Last change time
2015-06-09T05:11:46Z
Keywords
pull, wrong-code
Assigned to
yebblies
Creator
dmitry.olsh

Comments

Comment #0 by dmitry.olsh — 2013-11-20T13:38:27Z
This was a tricky devil to reduce. Marking as critical. Issue is specific to 64bit codegen: size_t replicateBits(size_t val) { return val ? size_t.max : 0; } unittest { import std.conv; auto v = replicateBits(true); assert(v == size_t.max, text(v)); // fails with -O, prints 4294967295 }
Comment #1 by yebblies — 2013-11-20T21:54:35Z
Comment #2 by github-bugzilla — 2013-11-22T13:36:11Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/87b9cf934f45a90333daa0d999ba602dd2ef6a81 Fix Issue 11565 - [Optimizer] Zeroes out the higher 32bits of register in ?: expression https://github.com/D-Programming-Language/dmd/commit/056cc7d45d687fda12e263205b54e17a5afc1fad Merge pull request #2841 from yebblies/issue11565 Issue 11565 - [Optimizer] Zeroes out the higher 32bits of register in ?: expression
Comment #3 by github-bugzilla — 2013-11-22T13:38:38Z
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/4f8561cc12c22ec5741c5ab967946f8b6aabd844 Merge pull request #2841 from yebblies/issue11565 Issue 11565 - [Optimizer] Zeroes out the higher 32bits of register in ?: expression