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
}