[Issue 6537] New: OS X optimizer bug (?)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 20 06:47:30 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6537

           Summary: OS X optimizer bug (?)
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Mac OS X
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: code at klickverbot.at


--- Comment #0 from klickverbot <code at klickverbot.at> 2011-08-20 06:47:28 PDT ---
to!string() seems to produce wrong results with -O using current DMD here on my
OS X Lion box:

---
import std.conv;
import std.stdio;

void main() {
  writefln("%s %s", long.min, to!string(long.min));
}
---

If I build the snippet without compiler flags, it prints (as expected):
-9223372036854775808 -9223372036854775808

If I add -O, however, the output becomes:
-9223372036854775808 -9223372032559808512

It seems like the lower 32 bits are zeroed out in the to!string() version (the
problem occurs also when to!string is used in isolation, the writefln is just
for demonstrative purposes).

Interestingly, this only occurs on my OS X box, I can't reproduce this in a
Linux VM (neither on x86 nor x86_64).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list